Пример #1
0
 function getBlockCode_Categories($iBlockId)
 {
     $oCategories = new BxTemplCategories();
     $oCategories->getTagObjectConfig(array('status' => 'active'));
     if (empty($oCategories->aTagObjects)) {
         return '';
     }
     $aParam = array('type' => isset($_REQUEST['tags_mode']) && isset($oCategories->aTagObjects[$_REQUEST['tags_mode']]) ? $_REQUEST['tags_mode'] : $oCategories->getFirstObject(), 'limit' => getParam('categ_perpage_browse'), 'orderby' => 'popular');
     $sMenu = $oCategories->getCategTopMenu($aParam);
     $sContent = $oCategories->display($aParam, $iBlockId, '', false, getParam('categ_show_columns'));
     return array($sContent, $sMenu, array(), false);
 }
Пример #2
0
function showCategories($aParam = array(), $iBoxId = 1, $sAction = '', $isBox = false, $bOrderPanel = false, $sTitle = '')
{
    $oCateg = new BxTemplCategories();
    $oCateg->getTagObjectConfig($aParam);
    if (empty($oCateg->aTagObjects)) {
        if ($isBox) {
            return DesignBoxContent($sTitle, MsgBox(_t('_Empty')), 1);
        } else {
            return MsgBox(_t('_Empty'));
        }
    }
    $aParam['type'] = isset($_GET['tags_mode']) && isset($oCateg->aTagObjects[$_GET['tags_mode']]) ? $_GET['tags_mode'] : $oCateg->getFirstObject();
    $sCode = $oCateg->display($aParam, $iBoxId, $sAction, $bOrderPanel, getParam('categ_show_columns'));
    if ($isBox) {
        $aCaptionMenu = $oCateg->getCategTopMenuHtml($aParam, $iBoxId, $sAction);
        $sCode = DesignBoxContent($sTitle, $sCode, 1, $aCaptionMenu);
        $sCode = '<div id="page_block_' . $iBoxId . '">' . $sCode . '<div class="clear_both"></div></div>';
        return $sCode;
    } else {
        return array($sCode, $oCateg->getCategTopMenu($aParam, $sAction), array(), $sDate ? _t('_categ_by_day') . $sDate : '');
    }
}