예제 #1
0
 function _getMainMenuSubitem($aItem, $bActive)
 {
     global $oAdmTemplate;
     if (strlen($aItem['check']) > 0) {
         $oFunction = create_function('', $aItem['check']);
         if (!$oFunction()) {
             return '';
         }
     }
     if (!$bActive) {
         list($sLink, $sOnClick) = BxDolAdminMenu::getMainMenuLink($aItem['url']);
     }
     return array('class' => $bActive ? 'adm-mmi-active' : '', 'bx_if:subicon' => array('condition' => false !== strpos($aItem['icon'], '.'), 'content' => array('icon' => $oAdmTemplate->getIconUrl($aItem['icon']))), 'bx_if:textsubicon' => array('condition' => false === strpos($aItem['icon'], '.'), 'content' => array('icon' => $aItem['icon'])), 'bx_if:subitem-text' => array('condition' => $bActive, 'content' => array('title' => _t($aItem['title']))), 'bx_if:subitem-link' => array('condition' => !$bActive, 'content' => array('link' => empty($sLink) ? '' : $sLink, 'onclick' => empty($sOnClick) ? '' : $sOnClick, 'title' => 'manage_modules' == $aItem['name'] || 'flash_apps' == $aItem['name'] ? '<b>' . _t($aItem['title']) . '</b>' : _t($aItem['title']))));
 }
예제 #2
0
function PageCategoryCode($sCategoryName)
{
    global $oAdmTemplate, $MySQL;
    $aItems = $MySQL->getAll("SELECT `tma1`.`title` AS `title`, `tma1`.`url` AS `url`, `tma1`.`description` AS `description`, `tma1`.`icon` AS `icon`, `tma1`.`check` AS `check` FROM `sys_menu_admin` AS `tma1` LEFT JOIN `sys_menu_admin` AS `tma2` ON `tma1`.`parent_id`=`tma2`.`id` WHERE `tma2`.`name`='" . $sCategoryName . "' ORDER BY `tma1`.`Order`");
    foreach ($aItems as $aItem) {
        if (strlen($aItem['check']) > 0) {
            $oFunction = create_function('', $aItem['check']);
            if (!$oFunction()) {
                continue;
            }
        }
        $aItem['url'] = str_replace(array('{siteUrl}', '{siteAdminUrl}'), array(BX_DOL_URL_ROOT, BX_DOL_URL_ADMIN), $aItem['url']);
        list($sLink, $sOnClick) = BxDolAdminMenu::getMainMenuLink($aItem['url']);
        $aVariables[] = array('bx_if:icon' => array('condition' => false !== strpos($aItem['icon'], '.'), 'content' => array('icon' => $oAdmTemplate->getIconUrl($aItem['icon']))), 'bx_if:texticon' => array('condition' => false === strpos($aItem['icon'], '.'), 'content' => array('icon' => $aItem['icon'])), 'link' => $sLink, 'onclick' => $sOnClick, 'title' => _t($aItem['title']), 'description' => $aItem['description']);
    }
    $iNameIndex = 0;
    $sPageTitle = _t($MySQL->getOne("SELECT `title` FROM `sys_menu_admin` WHERE `name`='" . $sCategoryName . "' LIMIT 1"));
    $sPageContent = $oAdmTemplate->parseHtmlByName('categories.html', array('bx_repeat:items' => $aVariables));
    $GLOBALS['_page'] = array('name_index' => $iNameIndex, 'css_name' => array('index.css'), 'header' => $sPageTitle, 'header_text' => $sPageTitle);
    $GLOBALS['_page_cont'][$iNameIndex]['page_main_code'] = $sPageContent;
}
예제 #3
0
 function _getMainMenuSubitem($aItem, $bActive)
 {
     global $oAdmTemplate;
     if (strlen($aItem['check']) > 0) {
         $oFunction = create_function('', $aItem['check']);
         if (!$oFunction()) {
             return '';
         }
     }
     if (!$bActive) {
         list($sLink, $sOnClick) = BxDolAdminMenu::getMainMenuLink($aItem['url']);
     }
     return array('icon' => $GLOBALS['oAdmTemplate']->getIconUrl($aItem['icon']), 'bx_if:subitem-text' => array('condition' => $bActive, 'content' => array('title' => _t($aItem['title']))), 'bx_if:subitem-link' => array('condition' => !$bActive, 'content' => array('link' => empty($sLink) ? '' : $sLink, 'onclick' => empty($sOnClick) ? '' : $sOnClick, 'title' => _t($aItem['title']))));
 }