Esempio n. 1
0
 private function configInit($data = null)
 {
     if ($this->_config_inited) {
         return;
     }
     $d = array('control_lang' => 'ru', 'control_lang_current' => array(), 'control_lang_data' => array('en' => array('login_exit' => 'Logout', 'login_enter' => 'Login', 'login_password' => 'password', 'login_username' => 'login', 'login_login' => 'Login', 'login_exit' => 'Logout', 'reload' => 'Reload', 'admin_panel' => 'Control panel', 'visit' => 'Visit homepage', 'no_connect' => 'No connect to server', 'no_template' => 'Template loading error', 'no_config' => 'Configuration loading error', 'no_lang' => 'Language loading error', 'try_again' => 'Try again?', 'no_menu' => 'Menu loading error', 'txt_alert_title' => 'Info', 'no_login' => 'Authorization data error', 'no_logout' => 'Logout error', 'no_loggin' => 'Login error', 'no_login_err' => 'Login / password are uncorrect', 'no_sel' => 'You should select an element', 'no_response' => 'Module loading error', 'no_filter' => 'Enter a request', 'file_error' => 'File uploading error', 'no_multi' => 'Language loading error', 'no_multi_change' => 'Language change error', 'menu' => 'Menu', 'panel_loading' => 'Control panel loading', 'old_browser' => 'Your browser is too old. The control panel works uncorrectly', 'load_stop' => 'Abort loading', 'error_javascript' => 'Your browser doesn`t support JavaScript or its usage is restricted by security policy. You need to enable JavaScript to operate the control panel.', 'generator' => 'Generator', 'action' => 'Action', 'controller' => 'Controller', 'key' => 'Key', 'value' => 'Value', 'value_type' => 'Value type', 'master' => 'Master', 'all' => 'All', 'delete' => 'Delete', 'add' => 'Add', 'edit' => 'Edit', 'add_place' => 'Add', 'edit_place' => 'Edit', 'no_controller' => 'Controller not found', 'access_error' => 'You have no access this partition', 'meta_title' => 'Is shown in browser title. By default TITLE changes all the content. If start with +, it`ll be added to the content, if -, wil be inserted before content', 'meta_keywords' => 'Separate keywords with comma', 'meta_description' => 'Description has to describe page content', 'meta_url' => 'Address should be inner. Example: /news/*, /page/about', 'meta_show_title' => 'Show site title', 'meta_show_desc' => 'Turn On/Off site title visibility at start of page`s TITLE', 'cancel' => 'Cancel', 'submit' => 'Apply', 'data_saved' => 'Data saved', 'element_moved' => 'Element moved', 'element_not_moved' => 'Element didn\'t move', 'element_deleted' => 'Elements deleted: ', 'home' => 'Homepage', 'home_page' => '<p><strong>Control panel</strong> is specified for editing your site.</p><p>&nbsp;</p><p>You can change static and dinamic pages content here and upload files to server. All changes are applied in on-line mode.</p>', 'loading' => 'Loading', 'not_specified' => 'Not specified', 'title' => 'Title', 'description' => 'Description', 'message' => 'Message', 'partition' => 'Partition', 'partition_desc' => 'Choose a partition or input URL into the next field. If you fill both fields site uses URL link', 'back' => 'Back', 'view_place' => 'View', 'button' => 'Browse...', 'meta_show_title_title' => 'Show website title', 'meta_show_title' => 'Switch on/off website title before TITLE', 'more' => 'More', 'control_panel' => 'Control panel', 'yes' => 'Yes', 'no' => 'No'), 'ru' => array('login_enter' => 'Войти', 'login_password' => 'Пароль', 'login_username' => 'Имя пользователя', 'login_login' => 'Войти', 'login_exit' => 'Выйти', 'reload' => 'Перезагрузить', 'admin_panel' => 'Панель управления', 'visit' => 'Перейти на сайт', 'menu' => 'Меню', 'no_connect' => 'Сервер не отвечает', 'no_template' => 'Ошибка загрузки шаблона', 'no_config' => 'Ошибка загрузки конфигурации', 'no_lang' => 'Ошибка загрузки языка', 'try_again' => 'Повторить попытку?', 'no_menu' => 'Ошибка загрузки меню', 'txt_alert_title' => 'Информация', 'no_login' => 'Ошибка получения сведений об авторизации', 'no_logout' => 'Ошибка выхода', 'no_loggin' => 'Ошибка входа', 'no_login_err' => 'Логин / пароль неверны', 'no_sel' => 'Элемент не выбран', 'no_response' => 'Ошибка загрузки модуля', 'no_filter' => 'Укажите запрос', 'file_error' => 'Ошибка загрузки файла', 'no_multi' => 'Ошибка загрузки языка', 'no_multi_change' => 'Ошибка смены языка', 'panel_loading' => 'загрузка панели управления', 'old_browser' => 'Вы используете устаревший браузер. Панель управления может работать некорректно', 'load_stop' => 'Отменить загрузку', 'error_javascript' => 'Ваш браузер не поддерживает JavaScript, либо их использование ограничено политикой безопасности. Для работы панели управления необходимо разрешить использование JavaScript.', 'generator' => 'Генератор', 'action' => 'Действие', 'controller' => 'Контроллер', 'key' => 'Ключ', 'value' => 'Значение', 'value_type' => 'Тип значения', 'master' => 'Мастер', 'all' => 'Все', 'delete' => 'Удалить', 'add' => 'Добавить', 'edit' => 'Изменить', 'add_place' => 'Добавление', 'edit_place' => 'Изменение', 'no_controller' => 'Контроллер не найден', 'access_error' => 'У вас нет доступа в этот раздел', 'meta_title' => 'Отображается в заголовке окна браузера, По-умолчанию TITLE заменяет все содержимое. Если вначале +, то добавит к содержимому, если -, то вставит перед содержимым', 'meta_keywords' => 'Ключевые слова перечисляются через запятую', 'meta_description' => 'Описание должно характеризовать содержимое страницы', 'meta_url' => 'Адрес должен быть внутренним. Напимер: /news/*, /page/about', 'meta_show_title' => 'Показывать название сайта', 'meta_show_desc' => 'Включить/выключить отображения названия сайта в самом начале TITLE страницы', 'cancel' => 'Отменить', 'submit' => 'Применить', 'data_saved' => 'Данные сохранены', 'element_moved' => 'Элемент перемещен', 'element_not_moved' => 'Элемент не был перемещен', 'element_deleted' => 'Элементов удалено: ', 'home' => 'Главная', 'home_page' => '<p><strong>Панель управления</strong> предназначена для редактирования содержимого вашего сайта.</p><p>&nbsp;</p><p>С ее помощью Вы можете вносить изменения в содержимое статических и динамических страниц, загружать файлы на сервер. Все изменения производятся в режиме on-line и вступают в силу как только запрос на изменение был обработан на сервере.</p>', 'loading' => 'Загрузка', 'not_specified' => 'Не указан', 'title' => 'Название', 'description' => 'Описание', 'message' => 'Сообщение', 'partition' => 'Раздел', 'partition_desc' => 'Выберите либо раздел, либо введите URL в следующем поле. Если вы выберите раздел и введете URL одновременно, то будет использован URL', 'back' => 'Назад', 'view_place' => 'Просмотр', 'button' => 'Обзор...', 'meta_show_title_title' => 'Показывать название сайта', 'meta_show_title' => 'Включить/выключить отображения названия сайта в самом начале TITLE страницы', 'more' => 'Дополнительно', 'control_panel' => 'Панель управления', 'yes' => 'Да', 'no' => 'Нет')), 'wysiwyg' => 'mce', 'post' => array(), 'param' => array(), 'theme' => 'redmond', 'model' => null, 'where' => null, 'tree' => false, 'tree_field' => 'parentid', 'tree_opened' => array(), 'field_orderid' => 'orderid', 'field_title' => 'title', 'field_link' => 'parentid', 'param_link' => 'cid', 'controller' => null, 'action' => null, 'stop_frame' => false, 'info' => array(), 'info_type' => 'i', 'type' => '', 'text' => '', 'button_top' => array(), 'button_bottom' => array(), 'button_top_ex' => true, 'scroll_top' => true, 'use_db' => true, 'request_ok' => array('controller' => '', 'action' => '', 'param' => ''), 'request_cancel' => array('controller' => '', 'action' => '', 'param' => ''), 'oac_apply' => true, 'oac_cancel' => true, 'oac_ok_title' => 'OK', 'oac_add_apply' => false, 'post_field_extend' => array(), 'post_field_unset' => array(), 'orderby' => '', 'orderdir' => 'asc', 'field' => array(), 'formatter_function' => array(), 'pager_list' => array(10, 20, 30, 50, 100, 200, 500, 1000), 'pager_scroll' => true, 'pager_perpage' => 0, 'pager_page' => 1, 'pre_view' => null, 'func_override' => null, 'func_success' => null, 'func_preset' => null, 'func_check' => null, 'navpane' => array('start' => array(), 'middle' => true, 'finish' => array()), 'data' => array(), 'static_field' => false, 'zk_meta' => 0, 'search' => array(), 'delete_mode' => 'db', 'cell_edit' => false);
     if ($data !== null) {
         $d = array_merge($d, $data);
     }
     $this->config = new Zkernel_Config_Control($d);
     $this->config->request_cancel->controller = $this->config->controller;
     $this->config->request_ok->controller = $this->config->controller;
     if ($this->config->controller) {
         $db = Zkernel_Common::getDocblock(ucfirst($this->config->controller) . 'Controller');
         $this->config->zk_meta = isset($db['zk_meta']) && $db['zk_meta'] ? 1 : 0;
     }
     $this->config->control_lang_current = $this->config->control_lang_data[$this->config->control_lang];
     $this->_config_inited = true;
     ini_set('session.cookie_lifetime', 86400 * 30);
     ini_set('session.gc_maxlifetime', 86400 * 30);
 }
Esempio n. 2
0
 function fetchControlList()
 {
     $data = array();
     $dir = Zend_Controller_Front::getInstance()->getControllerDirectory();
     $dir = @$dir['default'];
     $handle = @opendir($dir);
     while ($path = @readdir($handle)) {
         if (is_file($dir . '/' . $path)) {
             $n = $nn = strtolower(str_ireplace('Controller.php', '', $path));
             $c = ucfirst($n) . 'Controller';
             if (!class_exists($c)) {
                 include $dir . '/' . $path;
             }
             $db = Zkernel_Common::getDocblock($c);
             if (isset($db['zk_title'])) {
                 $nn = $db['zk_title'];
             }
             $model = file_exists($dir . '/../models/' . ucfirst($n) . '.php');
             $data[] = array('id' => $n, 'name' => $n, 'zk_title' => $nn);
         }
     }
     @closedir($handle);
     return new Zkernel_View_Data($data);
 }
Esempio n. 3
0
 static function getControllerDocblock($c = null)
 {
     $dbs = array();
     $controllers = $c ? array($c) : array();
     $dir = Zend_Controller_Front::getInstance()->getControllerDirectory();
     if (!$c) {
         $dir = @$dir['default'];
         $handle = @opendir($dir);
         while ($path = @readdir($handle)) {
             if (is_file($dir . '/' . $path)) {
                 $controllers[] = strtolower(str_ireplace('Controller.php', '', $path));
             }
         }
         @closedir($handle);
     }
     if ($controllers) {
         foreach ($controllers as $el) {
             $cc = ucfirst($el) . 'Controller';
             if (!class_exists($cc)) {
                 include $dir . '/' . $cc . '.php';
             }
             $dbs[$el] = Zkernel_Common::getDocblock($cc);
         }
     }
     if ($c) {
         $keys = array_keys($dbs);
         return @$dbs[$keys[0]];
     } else {
         return $dbs;
     }
 }
Esempio n. 4
0
                         $ap = $pp[0];
                         $k_1 = $pp[1];
                     } else {
                         $k_1 = $pp[0];
                     }
                     $inner[$n . '|' . ($is_route === false ? $k_1 : $ap . '|' . $k_1)] = $el_1;
                 }
             }
             break;
         }
     }
     if (!$exist) {
         foreach ($met as $el) {
             $db1 = Zkernel_Common::getDocblock($el, 'method');
             if (substr($el->name, -6) == 'Action') {
                 $db1 = Zkernel_Common::getDocblock($el, 'method');
                 if ($db1 && array_key_exists('zk_routable', $db1) && !(int) $db1['zk_routable']) {
                     continue;
                 }
                 if (!isset($db1['zk_title'])) {
                     continue;
                 }
                 $inner[$n . '|' . substr($el->name, 0, -6)] = $db1['zk_title'];
             }
         }
     }
 }
 if ($db && array_key_exists('zk_routable', $db) && !(int) $db['zk_routable']) {
     if ($inner) {
         $tt[$nn] = $inner;
     }