не задан - берем из настроек if(empty($module)) { return false; } // Создаем соответствующий класс if (is_file($this->modules_dir."$module.php")) { include_once($this->modules_dir."$module.php"); if (class_exists($module)) { $this->main = new $module($this); // $this->module = new $moduleName(); } else { return false; } } else { return false; } // Создаем основной блок страницы $content = $this->main->fetch(); if (!$content) { return false; } // Передаем основной блок в шаблон $this->design->assign('content', $content); // Передаем название модуля в шаблон, это может пригодиться $this->design->assign('module', $module); // Создаем текущую обертку сайта (обычно index.tpl) $wrapper = $this->design->get_var('wrapper'); if(is_null($wrapper)) { $wrapper = 'index.tpl'; } if(empty($_SESSION['admin'])) { if ($this->settings->site_work == "off") { header('HTTP/1.0 503 Service Temporarily Unavailable'); header('Status: 503 Service Temporarily Unavailable'); header('Retry-After: 300');//300 seconds return $this->design->fetch('tech.tpl'); } } if(!empty($wrapper)) { return $this->body = $this->design->fetch($wrapper); } else { return $this->body = $content; } /** * Подсчет количества видимых дочерних элементов * @param type $items * @param array $all_items * @param type $subitems_name */ private function count_visible($items = array(), array $all_items, $subitems_name = 'subcategories') { foreach ($items as $item) { if (!isset($all_items[$item->parent_id]->count_children_visible)) { $all_items[$item->parent_id]->count_children_visible = 0; } if ($item->parent_id && $item->visible) { $all_items[$item->parent_id]->count_children_visible++; } if (!empty($item->{$subitems_name})) { $this->count_visible($item->{$subitems_name}, $all_items, $subitems_name); } } } }