HomeHelpTrac

Changeset 15211 for trunk/categories.php


Ignore:
Timestamp:
06/07/11 23:41:51 (12 months ago)
Author:
Alexander Trofimov
Message:

Code cleaning:

  • converting new lines to \n
  • deleting spaces at the end of every line
  • converting all tabs to 4 spaces
  • automated script for future cleaning was added
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/categories.php

    r15201 r15211  
    4141{ 
    4242    $oCateg = new BxTemplCategories(); 
    43          
     43 
    4444    $oCateg->getTagObjectConfig($aParam); 
    45      
     45 
    4646    if (empty($oCateg->aTagObjects)) 
    4747    { 
     
    5151            return MsgBox(_t('_Empty')); 
    5252    } 
    53          
     53 
    5454    $aParam['type'] = isset($_GET['tags_mode']) && isset($oCateg->aTagObjects[$_GET['tags_mode']]) ? $_GET['tags_mode'] : $oCateg->getFirstObject(); 
    55      
     55 
    5656    $sCode = $oCateg->display($aParam, $iBoxId, $sAction, $bOrderPanel, getParam('categ_show_columns')); 
    57      
     57 
    5858    if ($isBox) 
    5959    { 
     
    7373 
    7474 
    75 class CategoriesCalendar extends BxTemplCalendar  
    76 { 
    77     function CategoriesCalendar($iYear, $iMonth)  
     75class CategoriesCalendar extends BxTemplCalendar 
     76{ 
     77    function CategoriesCalendar($iYear, $iMonth) 
    7878    { 
    7979        parent::BxTemplCalendar($iYear, $iMonth); 
    8080    } 
    81      
     81 
    8282    function display() { 
    8383        $aVars = array ( 
     
    9696        $GLOBALS['oSysTemplate']->addCss('calendar.css'); 
    9797        return $sHtml; 
    98     }     
    99      
    100     function getData()  
     98    } 
     99 
     100    function getData() 
    101101    { 
    102102        $oDb = new BxDolDb(); 
    103          
     103 
    104104        return $oDb->getAll("SELECT *, DAYOFMONTH(`Date`) AS `Day` 
    105105            FROM `sys_categories` 
    106             WHERE `Date` >= TIMESTAMP('{$this->iYear}-{$this->iMonth}-1')  
    107             AND `Date` < TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1')  
     106            WHERE `Date` >= TIMESTAMP('{$this->iYear}-{$this->iMonth}-1') 
     107            AND `Date` < TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1') 
    108108            AND `Owner` <> 0 AND `Status` = 'active'"); 
    109109    } 
    110      
    111     function getBaseUri()  
     110 
     111    function getBaseUri() 
    112112    { 
    113113        return BX_DOL_URL_ROOT . 'categories.php?action=calendar'; 
    114114    } 
    115      
    116     function getBrowseUri()  
     115 
     116    function getBrowseUri() 
    117117    { 
    118118        return BX_DOL_URL_ROOT . 'categories.php?action=calendar'; 
    119119    } 
    120      
    121     function getEntriesNames ()  
     120 
     121    function getEntriesNames () 
    122122    { 
    123123        return array(_t('_categ_single'), _t('_categ_plural')); 
    124124    } 
    125      
    126     function _getCalendar ()  
     125 
     126    function _getCalendar () 
    127127    { 
    128128        $sBrowseUri = $this->getBrowseUri(); 
     
    131131        $this->_getCalendarGrid($aCalendarGrid); 
    132132        $aRet = array (); 
    133         for ($i = 0; $i < 6; $i++) {             
     133        for ($i = 0; $i < 6; $i++) { 
    134134 
    135135            $aRow = array ('bx_repeat:cell'); 
     
    156156                        'href' => $sBrowseUri . '&year=' . $this->iYear . '&month=' . $this->iMonth . '&day=' . $aCell['day'], 
    157157                        'entries' => 1 == $aCalendarGrid[$i][$j]['num'] ? $sEntriesSingle : $sEntriesMul, 
    158                     ));                     
     158                    )); 
    159159                    $isRowEmpty = false; 
    160160                } else { 
     
    166166                        'entries' => '', 
    167167                    )); 
    168                 }        
     168                } 
    169169 
    170170                if ($aCell) 
     
    178178        return $aRet; 
    179179    } 
    180      
    181 } 
    182  
    183 class CategoriesCalendarPage extends BxDolPageView  
    184 {   
     180 
     181} 
     182 
     183class CategoriesCalendarPage extends BxDolPageView 
     184{ 
    185185    var $sPage; 
    186        
    187     function CategoriesCalendarPage()  
     186 
     187    function CategoriesCalendarPage() 
    188188    { 
    189189        $this->sPage = 'categ_calendar'; 
    190190        parent::BxDolPageView($this->sPage); 
    191191    } 
    192      
     192 
    193193    function getBlockCode_Calendar($iBlockId) 
    194194    { 
     
    196196        $sMonth = isset($_GET['month']) ? (int)$_GET['month'] : ''; 
    197197        $oCalendar = new CategoriesCalendar($sYear, $sMonth); 
    198          
     198 
    199199        return $oCalendar->display(); 
    200200    } 
    201      
     201 
    202202    function getBlockCode_CategoriesDate($iBlockId) 
    203203    { 
     
    212212                ) 
    213213            ); 
    214              
     214 
    215215            return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_CALENDAR, false, false, _t('_categ_caption_calendar')); 
    216216        } 
     
    221221 
    222222class CategoriesSearchPage extends BxDolPageView { 
    223          
     223 
    224224    var $aSearchForm; 
    225225    var $oForm; 
    226226    var $sPage; 
    227      
    228     function CategoriesSearchPage()  
     227 
     228    function CategoriesSearchPage() 
    229229    { 
    230230        $this->sPage = 'categ_search'; 
    231231        parent::BxDolPageView($this->sPage); 
    232          
     232 
    233233        bx_import('BxTemplFormView'); 
    234234        $this->aSearchForm = array( 
     
    237237                'action'   => '', 
    238238                'method'   => 'post', 
    239             ),       
    240      
     239            ), 
     240 
    241241            'params' => array ( 
    242242                'db' => array( 
     
    244244                ), 
    245245            ), 
    246                    
     246 
    247247            'inputs' => array( 
    248248                'Keyword' => array( 
     
    257257                    ), 
    258258                    'db' => array ( 
    259                         'pass' => 'Xss',  
     259                        'pass' => 'Xss', 
    260260                    ), 
    261                 ),                 
     261                ), 
    262262                'Submit' => array ( 
    263263                    'type' => 'submit', 
     
    266266                    'colspan' => true, 
    267267                ), 
    268             ),             
     268            ), 
    269269        ); 
    270          
     270 
    271271        $this->oForm = new BxTemplFormView($this->aSearchForm); 
    272272        $this->oForm->initChecker(); 
    273273    } 
    274      
     274 
    275275    function getBlockCode_Form() 
    276276    { 
    277277        return $GLOBALS['oSysTemplate']->parseHtmlByName('search_tags_box.html', array('form' => $this->oForm->getCode())); 
    278278    } 
    279      
     279 
    280280    function getBlockCode_Founded($iBlockId) 
    281281    { 
     
    288288        else if ($this->oForm->isSubmittedAndValid()) 
    289289            $aParam['filter'] = $this->oForm->getCleanValue('Keyword'); 
    290          
     290 
    291291        if (isset($aParam['filter'])) 
    292292            return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_SEARCH, false, false, _t('_categ_caption_founded_categ')); 
     
    301301        'pagination' => getParam('categ_perpage_browse') 
    302302    ); 
    303      
     303 
    304304    return showCategories($aParam, 1, BX_CATEG_ACTION_ALL, true, true, _t('_categ_caption_all')); 
    305305} 
     
    311311        'common' => true, 
    312312    ); 
    313      
     313 
    314314    return showCategories($aParam, 1, BX_CATEG_ACTION_COMMON, true, false, _t('_categ_caption_common')); 
    315315} 
     
    321321        'common' => false 
    322322    ); 
    323      
     323 
    324324    return showCategories($aParam, 1, BX_CATEG_ACTION_USERS, true, false, _t('_categ_caption_users')); 
    325325} 
     
    328328{ 
    329329    $oCalendarPage = new CategoriesCalendarPage(); 
    330      
     330 
    331331    return $oCalendarPage->getCode(); 
    332332} 
     
    335335{ 
    336336    $oSearchPage = new CategoriesSearchPage(); 
    337      
     337 
    338338    return $oSearchPage->getCode(); 
    339339} 
     
    345345        $sContent = getPage_Common(); 
    346346        break; 
    347          
     347 
    348348    case BX_CATEG_ACTION_USERS: 
    349349        $sContent = getPage_Users(); 
    350350        break; 
    351          
     351 
    352352    case BX_CATEG_ACTION_CALENDAR: 
    353353        $sContent = getPage_Calendar(); 
    354354        break; 
    355          
     355 
    356356    case BX_CATEG_ACTION_SEARCH: 
    357357        $sContent = getPage_Search(); 
    358358        break; 
    359          
     359 
    360360    default: 
    361361        $sContent = getPage_All(); 
     
    367367    global $_page_cont; 
    368368    $iIndex = 25; 
    369      
     369 
    370370    $_page['name_index']    = $iIndex; 
    371371    $_page['css_name']      = 'tags.css'; 
    372      
     372 
    373373    $_page['header'] = _t('_Categories'); 
    374374    $_page['header_text'] = _t('_Categories'); 
    375375    $_page_cont[$iIndex]['page_main_code'] = $sContent; 
    376      
     376 
    377377    check_logged(); 
    378378    PageCode(); 
    379379} 
    380 else  
     380else 
    381381    echo $sContent; 
    382382 
Note: See TracChangeset for help on using the changeset viewer.