상속: extends BxDolMistake
예제 #1
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;
}
예제 #2
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']))));
 }
예제 #3
0
 /**
  * Parse system keys.
  *
  * @param  string $sKey key
  * @return string value associated with the key.
  */
 function parseSystemKey($sKey, $mixedKeyWrapperHtml = null)
 {
     global $logged;
     $aKeyWrappers = $this->_getKeyWrappers($mixedKeyWrapperHtml);
     $sRet = '';
     switch ($sKey) {
         case 'version':
             $sRet = $GLOBALS['site']['ver'];
             break;
         case 'current_version':
             $sRet = $GLOBALS['site']['ver'] . '.' . $GLOBALS['site']['build'];
             break;
         case 'page_charset':
             $sRet = 'UTF-8';
             break;
         case 'page_keywords':
             if (!empty($GLOBALS[$this->_sPrefix . 'PageKeywords']) && is_array($GLOBALS[$this->_sPrefix . 'PageKeywords'])) {
                 $sRet = '<meta name="keywords" content="' . process_line_output(implode(',', $GLOBALS[$this->_sPrefix . 'PageKeywords'])) . '" />';
             }
             break;
         case 'page_description':
             if (!empty($GLOBALS[$this->_sPrefix . 'PageDescription']) && is_string($GLOBALS[$this->_sPrefix . 'PageDescription'])) {
                 $sRet = '<meta name="description" content="' . process_line_output($GLOBALS[$this->_sPrefix . 'PageDescription']) . '" />';
             }
             break;
         case 'page_header':
             if (!empty($GLOBALS[$this->_sPrefix . 'PageTitle'])) {
                 $sRet = $GLOBALS[$this->_sPrefix . 'PageTitle'];
             } else {
                 if (isset($GLOBALS['_page']['header'])) {
                     $sRet = $GLOBALS['_page']['header'];
                 }
             }
             $sRet = process_line_output($sRet);
             break;
         case 'page_header_text':
             if (!empty($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle'])) {
                 $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageMainBoxTitle']);
             } else {
                 if (isset($GLOBALS['_page']['header_text'])) {
                     $sRet = $GLOBALS['_page']['header_text'];
                 }
             }
             $sRet = process_line_output($sRet);
             break;
         case 'main_div_width':
             if (!empty($GLOBALS[$this->_sPrefix . 'PageWidth'])) {
                 $sRet = process_line_output($GLOBALS[$this->_sPrefix . 'PageWidth']);
             }
             break;
         case 'top_menu':
             $sRet = BxDolAdminMenu::getTopMenu();
             break;
         case 'main_menu':
             $sRet = BxDolAdminMenu::getMainMenu();
             break;
         case 'dol_images':
             $sRet = $this->_processJsImages();
             break;
         case 'dol_lang':
             $sRet = $this->_processJsTranslations();
             break;
         case 'dol_options':
             $sRet = $this->_processJsOptions();
             break;
         case 'promo_code':
             if (defined('BX_PROMO_CODE')) {
                 $sRet = BX_PROMO_CODE;
             } else {
                 $sRet = ' ';
             }
             break;
         case 'copyright':
             $sRet = _t('_copyright', date('Y')) . getVersionComment();
             break;
     }
     $sRet = BxDolTemplate::processInjection($GLOBALS['_page']['name_index'], $sKey, $sRet);
     return $sRet;
 }
예제 #4
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']))));
 }