/** * Загрузка шаблонов и данных для расширений * @param $post */ public function loadTemplateExtansion($post) { $result = array(); if (isset($post['extansionName']) && $post['extansionName'] !== '') { if (isset($post['templates'])) { $result['template'] = array(); foreach ($post['templates'] as $v) { $url = root . '/' . Fx::service_context()->config['folder']['extension'] . '/' . $post['extansionName'] . '/' . $v; $result['template'][$v] = file_get_contents($url); } } if (isset($post['controller'])) { Fx::cLoader()->setPath(root . '/' . Fx::service_context()->config['folder']['extension'] . '/' . $post['extansionName'] . '/controller/'); $result = Fx::cLoader()->load($post['controller'])->run($result, $post); } } header('Content-type: text/json'); header('Content-type: application/json'); echo json_encode($result); }
req($config, '/class/class_controller_loader.php'); req($config, '/class/class_io.php'); req($config, '/class/class_lib.php'); req($config, '/class/class_compress_static.php'); req($config, '/class/class_extension.php'); req($config, '/class/class_translate.php'); req($config, '/class/class_convert_schem.php'); req($config, '/templating/lessphp/lessc.inc.php'); req($config, '/class/class_less.php'); req($config, '/class/class_glob.php'); if (!req($config, '/class/db/' . $config['db']['type'] . '.php')) { req($config, '/class/db/mysql.php'); } req($config, '/class/class_templating.php'); /** Устанлвка базового пути для контроллеров */ Fx::cLoader()->setPath(sys . '/template/controller/'); /** Устанлвка базового пути для статики */ Fx::cStatic()->root(sys); /** Добавляем конфиги в контекст приложения */ Fx::service_context()->config = $config; /** Добавляем манифест в контекст приложения */ Fx::service_context()->manifest = $manifest; /** Алиасы имен бд */ Fx::service_context()->namespace = array(); foreach ($manifest['baseCollection'] as $k => $v) { Fx::service_context()->namespace[$k] = Fx::service_context()->config['db']['sys_namespace'] . $k; } Fx::service_context()->dict = $lang; if (system_static) { Fx::cStatic()->set('template/js/jq.js'); Fx::cStatic()->set('template/js/underscore.js');