Пример #1
0
 function buildMainPage($page_fields = null)
 {
     $this->_TMS->AddFileSection($this->loadModuleTpls($this->_module_name, array(array('tplName' => 'run')), true), true);
     if ($moduleList = xCore::getModuleList()) {
         $users = xCore::loadCommonClass('users');
         //$maccess=$users->roles_tree->GetChildsParam($_SESSION['user']['id'], array('is_accesible'), true);
         foreach ($moduleList as $module) {
             if ($_SESSION['user']['type'] == '_SUPERADMIN' or $_SESSION['user']['maccess'][$module['name']]) {
                 $i++;
                 $this->_TMS->AddMassReplace('js_modules', $module);
                 $this->_TMS->parseSection('js_modules', true);
                 $lang = Common::getModuleLang($this->_module_name, $_SESSION['lang'], 'modules');
                 $m = array('name' => $module['name'], 'alias' => $lang[$module['name']], 'info' => $lang[$module['name'] . '_info']);
                 $this->_TMS->AddMassReplace('fw_module', $m);
                 $column1 .= $this->_TMS->parseSection('fw_module');
                 if ($i % 3 == 0) {
                     $this->_TMS->AddReplace('fw_module_all', 'fw_module', $column1);
                     $this->_TMS->parseSection('fw_module_all', true);
                     $column1 = '';
                 }
                 $this->_TMS->AddMassReplace('module_menu', $m);
                 $menu_html = $this->_TMS->parseSection('module_menu');
                 switch ($module['moduleCategory']) {
                     case 0:
                         $mm['menu_content'] .= $menu_html;
                         break;
                     case 1:
                         $mm['menu_control'] .= $menu_html;
                         break;
                     case 2:
                         $mm['menu_special'] .= $menu_html;
                         break;
                 }
             }
         }
         $this->_TMS->AddReplace('fw_module_all', 'fw_module', $column1);
         $this->_TMS->parseSection('fw_module_all', true);
     }
     $this->_TMS->AddMassReplace('main', $mm);
     $this->_TMS->AddMassReplace('main', $this->getAdminPanelData());
     $this->_TMS->AddMassReplace('main', $page_fields);
     return $this->_TMS->parseSection('main');
 }