Exemple #1
0
 /**
  * Автоматическое определение и запуск метода действия
  * @todo добавить сюда события events ДО, ПОСЛЕ и ВМЕСТО выполнения задачи контроллера
  */
 public function run()
 {
     $router = $this->router = joosCore::instance()->get_router();
     $controller_class_name = 'actions' . ucfirst($router->param('controller'));
     $controller = new $controller_class_name();
     $action = $router->param('action');
     JDEBUG ? joosDebug::add($controller_class_name . '->' . $action) : null;
     if (method_exists($controller_class_name, $action)) {
         $results = $controller->{$action}();
         $page_body = $this->views($results);
         // главное содержимое - стек вывода компонента - mainbody
         joosDocument::set_body($page_body);
         return $this;
     } else {
         //  в контроллере нет запрашиваемого метода
         joosPages::page404('Метод не найден');
     }
 }
Exemple #2
0
$sysstart = microtime(true);
// корень файлов панели управления
define('JPATH_BASE_ADMIN', __DIR__);
require_once dirname(JPATH_BASE_ADMIN) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'joostina.php';
require_once JPATH_BASE . DS . 'core' . DS . 'admin.root.php';
joosDocument::header();
// работа с сессиями начинается до создания главного объекта взаимодействия с ядром
joosCoreAdmin::start();
// стартуем пользователя
joosCoreAdmin::init_user();
if (helperAcl::is_allowed('admin_panel::init') !== true) {
    joosRoute::redirect(JPATH_SITE_ADMIN, 'В доступе отказано');
}
ob_start();
joosAutoadmin::dispatch();
joosDocument::set_body(ob_get_clean());
ob_start();
// начало вывода html
// загрузка файла шаблона
$template_file = JPATH_BASE . DS . 'app' . DS . 'templates' . DS . JTEMPLATE_ADMIN . DS . 'index.php';
if (file_exists($template_file)) {
    require_once $template_file;
} else {
    throw new joosException('Файл index.php шаблона :template_name не найден', array(':template_name' => JTEMPLATE_ADMIN));
}
// подсчет времени генерации страницы
if (JDEBUG) {
    if (defined('_MEM_USAGE_START')) {
        $mem_usage = joosFile::convert_size(memory_get_usage() - _MEM_USAGE_START);
    } else {
        $mem_usage = 'недоступно';