HomeHelpTrac

Changeset 10956 for trunk/categories.php


Ignore:
Timestamp:
06/22/09 03:19:27 (3 years ago)
Author:
Alexey Penskikh
Message:

Add categories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/categories.php

    r10781 r10956  
    1616$bAjaxMode = isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ? true : false; 
    1717 
    18 function showCategories($aParam = array(), $iBoxId = 1, $sAction = '', $isBox = false, $sTitle) 
     18function showCategories($aParam = array(), $iBoxId = 1, $sAction = '', $isBox = false, $bOrderPanel = false, $sTitle) 
    1919{ 
    2020    $oCateg = new BxTemplCategories(); 
     
    2424    $aParam['type'] = isset($_REQUEST['tags_mode']) ? $_REQUEST['tags_mode'] : $oCateg->getFirstObject(); 
    2525     
    26     $sCode = $oCateg->display($aParam, $iBoxId, $sAction); 
     26    $sCode = $oCateg->display($aParam, $iBoxId, $sAction, $bOrderPanel, getParam('categ_show_columns')); 
    2727     
    2828    if ($isBox) 
     
    3838            $oCateg->getCategTopMenu($aParam, $sAction), 
    3939            array(), 
    40             ($sDate ? _t('_tags_by_day') . $sDate : '') 
     40            ($sDate ? _t('_categ_by_day') . $sDate : '') 
    4141        ); 
    4242} 
     
    7474        return $oDb->getAll("SELECT *, DAYOFMONTH(`Date`) AS `Day` 
    7575            FROM `sys_categories` 
    76             WHERE `Date` >= TIMESTAMP('{$this->iYear}-{$this->iMonth}-1') AND `Date` < TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1')"); 
     76            WHERE `Date` >= TIMESTAMP('{$this->iYear}-{$this->iMonth}-1')  
     77            AND `Date` < TIMESTAMP('{$this->iNextYear}-{$this->iNextMonth}-1')  
     78            AND `Owner` <> 0"); 
    7779    } 
    7880     
     
    8991    function getEntriesNames ()  
    9092    { 
    91         return array(_t('_cat_single'), _t('_cat_plural')); 
     93        return array(_t('_categ_single'), _t('_categ_plural')); 
    9294    } 
    9395     
     
    155157    function CategoriesCalendarPage()  
    156158    { 
    157         $this->sPage = 'cat_calendar'; 
     159        $this->sPage = 'categ_calendar'; 
    158160        parent::BxDolPageView($this->sPage); 
    159161    } 
     
    173175        { 
    174176            $aParam = array( 
    175                 'pagination' => getParam('cat_perpage_browse'), 
     177                'pagination' => getParam('categ_perpage_browse'), 
    176178                'date' => array( 
    177179                    'year' => $_REQUEST['year'], 
     
    181183            ); 
    182184             
    183             return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_CALENDAR, false, _t('_cat_caption_calendar')); 
     185            return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_CALENDAR, false, false, _t('_categ_caption_calendar')); 
    184186        } 
    185187        else 
     
    196198    function CategoriesSearchPage()  
    197199    { 
    198         $this->sPage = 'cat_search'; 
     200        $this->sPage = 'categ_search'; 
    199201        parent::BxDolPageView($this->sPage); 
    200202         
     
    202204        $this->aSearchForm = array( 
    203205            'form_attrs' => array( 
    204                 'name'     => 'form_search_tags', 
     206                'name'     => 'form_search_categories', 
    205207                'action'   => '', 
    206208                'method'   => 'post', 
     
    217219                    'type' => 'text', 
    218220                    'name' => 'Keyword', 
    219                     'caption' => _t('_tags_caption_keyword'), 
     221                    'caption' => _t('_categ_caption_keyword'), 
    220222                    'required' => true, 
    221223                    'checker' => array ( 
    222224                        'func' => 'length', 
    223225                        'params' => array(1, 100), 
    224                         'error' => _t ('_tags_err_keyword'), 
     226                        'error' => _t ('_categ_err_keyword'), 
    225227                    ), 
    226228                    'db' => array ( 
     
    249251    { 
    250252        $aParam = array( 
    251             'pagination' => getParam('cat_perpage_browse') 
     253            'pagination' => getParam('categ_perpage_browse') 
    252254        ); 
    253255         
     
    258260         
    259261        if (isset($aParam['filter'])) 
    260             return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_SEARCH, false, _t('_cat_caption_founded_tags')); 
     262            return showCategories($aParam, $iBlockId, BX_CATEG_ACTION_SEARCH, false, false, _t('_categ_caption_founded_categ')); 
    261263        else 
    262264            return MsgBox(_t('_Empty')); 
     
    267269{ 
    268270    $aParam = array( 
    269         'pagination' => getParam('cat_perpage_browse') 
     271        'pagination' => getParam('categ_perpage_browse') 
    270272    ); 
    271273     
    272     if (isset($_REQUEST['orderby']) && $_REQUEST['orderby']) 
    273         $aParam['orderby'] = $_REQUEST['orderby']; 
    274      
    275     return showCategories($aParam, 1, BX_CATEG_ACTION_ALL, true, _t('_cat_caption_all')); 
     274    return showCategories($aParam, 1, BX_CATEG_ACTION_ALL, true, true, _t('_categ_caption_all')); 
    276275} 
    277276 
     
    279278{ 
    280279    $aParam = array( 
    281         'pagination' => getParam('cat_perpage_browse'), 
     280        'pagination' => getParam('categ_perpage_browse'), 
    282281        'admin' => true, 
    283282    ); 
    284283     
    285     return showCategories($aParam, 1, BX_CATEG_ACTION_ADMIN, true, _t('_cat_caption_admin')); 
     284    return showCategories($aParam, 1, BX_CATEG_ACTION_ADMIN, true, false, _t('_categ_caption_admin')); 
    286285} 
    287286 
     
    289288{ 
    290289    $aParam = array( 
    291         'pagination' => getParam('cat_perpage_browse'), 
     290        'pagination' => getParam('categ_perpage_browse'), 
    292291        'admin' => false 
    293292    ); 
    294293     
    295     return showCategories($aParam, 1, BX_CATEG_ACTION_USERS, true, _t('_cat_caption_users')); 
     294    return showCategories($aParam, 1, BX_CATEG_ACTION_USERS, true, false, _t('_categ_caption_users')); 
    296295} 
    297296 
     
    310309} 
    311310 
    312 $sContent = DesignBoxContent(_t('_Categories'), MsgBox('Under development'), 1); 
    313  
    314 /* 
    315311switch ($_REQUEST['action']) 
    316312{ 
     
    334330        $sContent = getPage_All(); 
    335331} 
    336 */ 
     332 
    337333if (!$bAjaxMode) 
    338334{ 
Note: See TracChangeset for help on using the changeset viewer.