コード例 #1
0
ファイル: infoblocks.php プロジェクト: romlg/cms36
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     $positions = $this->getFilterPositions();
     if (!$positions) {
         echo "<p style='color: red;'>Не задан массив infoblocks_positions в файле settings.cfg.php</p>";
     }
     // строим таблицу
     require_once core('list_table');
     $columns = array(array('select' => 'p.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'p.name', 'display' => 'name', 'flags' => FLAG_SORT | FLAG_SEARCH), domainRootID() > 0 ? array('select' => 'p.position', 'display' => 'position', 'type' => 'position', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + $positions) : array('select' => 'p.position', 'display' => 'position', 'type' => 'position', 'flags' => FLAG_SEARCH), array('select' => 'IF(p.visible=1,1,2)', 'as' => 'visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет')), array('select' => 'IF(p.publ_announce=1,1,2)', 'as' => 'publ_announce', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_display' => 'announce', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет')), array('select' => 'p.priority', 'display' => 'priority', 'flags' => FLAG_SORT), array('select' => 'p.id', 'display' => 'showurl', 'type' => 'showurl'), array('select' => 'p.id', 'display' => 'hiddenurl', 'type' => 'hiddenurl'), array('select' => 'p.title', 'flags' => FLAG_SEARCH), array('select' => 'p.header_text', 'flags' => FLAG_SEARCH), array('select' => '(SELECT GROUP_CONCAT(",", ir.url) FROM infoblocks_rules AS ir WHERE p.id=ir.pid GROUP BY p.id)', 'flags' => FLAG_SEARCH));
     // проверим сколько сайтов, если несколько то выводим колонку
     global $site_domains;
     $current = current($site_domains);
     if (count($site_domains) > 1 || count($current['langs']) > 1) {
         $columns[] = array('select' => 'p.root_id', 'display' => 'root_id', 'type' => 'showsites');
     }
     $data['table'] = list_table(array('columns' => $columns, 'from' => $this->table . " as p", 'orderby' => 'p.name ASC', 'where' => domainRootId() > 0 ? 'root_id=' . domainRootID() : '', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(p.id)', 'click' => 'ID=cb.value'), $this);
     $this->AddStrings($data);
     return $this->Parse($data, LIST_TEMPLATE);
 }
コード例 #2
0
ファイル: publications_base.php プロジェクト: romlg/cms36
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     // проверим есть ли pid и если есть то относится ли к нужному root_id
     $filter = get('filter', array());
     if ($filter['all_pids']) {
         $page_root_id = sql_getValue("SELECT root_id FROM `tree` WHERE id='" . (int) $filter['all_pids'] . "'");
         if ($page_root_id != domainRootID()) {
             $_GET['filter']['all_pids'] = 0;
         }
     }
     $tree = array();
     $root_id = domainRootId();
     if ($root_id > 0 && allowDomainForUser($root_id)) {
         $tree = $tree + $this->getPages((int) $root_id);
         $temp = $tree;
         $tree = array();
         foreach ($temp as $val) {
             $tree[$val['id']] = $val['name'];
         }
     }
     $filter_pid_value = array('' => 'все') + $tree;
     // строим таблицу
     require_once core('list_table');
     $data['table'] = list_table(array('columns' => array(array('select' => 'p.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'p.name', 'display' => 'name', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'UNIX_TIMESTAMP(p.date)', 'as' => 'date', 'display' => 'date', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'date', 'filter_value' => 'date', 'type' => 'date'), array('select' => 'p.pid', 'display' => 'pid', 'type' => 'dir'), $root_id > 0 ? array('select' => 'CAST(CONCAT(p.pid,\',\',p.pids) AS CHAR)', 'as' => 'all_pids', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => $filter_pid_value, 'filter_display' => 'pid', 'filter_rule' => 'find_in_set') : array('select' => 'CAST(CONCAT(p.pid,\',\',p.pids) AS CHAR)', 'as' => 'all_pids'), array('select' => 'p.visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет'), 'filter_field' => 'IF(p.visible=0,2,1)'), array('select' => 'p.id', 'display' => 'showInSite', 'type' => 'show'), array('select' => 't.dir'), array('select' => 't.root_id'), array('select' => 't.name', 'as' => 't_name', 'flags' => FLAG_SEARCH), array('select' => 'p.notice', 'flags' => FLAG_SEARCH), array('select' => 'p.text', 'flags' => FLAG_SEARCH)), 'from' => $this->table . " as p\n\t\t\tLEFT JOIN `tree` as t ON t . id = p . pid\n\t\t\t", 'where' => (domainRootId() > 0 ? ' (t.root_id=' . domainRootId() . ' OR t.root_id IS NULL OR FIND_IN_SET(' . domainRootId() . ', (SELECT GROUP_CONCAT( DISTINCT CAST(root_id AS CHAR)) FROM tree WHERE FIND_IN_SET(id, CONCAT(p.pid, ",", p.pids)))) )' : '') . $this->where_extra, 'orderby' => 'p.date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(p.id)', 'click' => 'ID=cb.value'), $this);
     $data['table'] .= "<script type='text/javascript'>\n        \$('ul.navPanel').find('a:first').attr('onclick','').click(function(){\n            \$('.createbox').show().find('input[type=text]').focus();\n        });\n        </script>\n        <style type='text/css'>\n        .createbox {\n            width:307px;\n            height:100px;\n            background-color:#fff;\n            border:2px solid #FAAE3E;\n            position:fixed;\n            left:550px;\n            top:400px;\n            display:none;\n            padding:10px;\n            box-shadow:5px 5px 5px rgba(0,0,0,0.5);\n        }\n            .createbox .close {\n                text-decoration:none;\n                position:relative;\n                top:-7px;\n                left:304px;\n                font-size:16px;\n                color:#f00;\n            }\n        </style>\n        <div class='createbox'>\n            <a href='javascript:void(0);' onclick='\$(\".createbox\").hide();' class='close'>X</a>\n            <form action='' method='post'>\n                <input type='hidden' name='page' value='{$this->name}' />\n                <input type='hidden' name='do' value='editCreate' />\n                <!--input type='hidden' name='ref' value='/admin/editor.php?page={$this->name}' /-->\n                <label>Введите название новой публикации:</label>\n                <input type='text' class='text' name='fld[name]' id='fld_name' value='' />\n                <a href='javascript:void(0);' onclick='if(\$(this).parent().find(\"#fld_name\").val()) \$(this).parent().submit(); else alert(\"Вы не ввели название публикации\");' class='button' style='position:relative;left:90px;top:5px;'><span>Создать</span></a>\n            </form>\n        </div>";
     $this->AddStrings($data);
     return $this->Parse($data, LIST_TEMPLATE);
 }
コード例 #3
0
ファイル: elem_main.php プロジェクト: romlg/cms36
 function get_module_list()
 {
     global $cfg, $intlang;
     $function_modules = $cfg['function_modules'][domainRootID()];
     $filter_modules = array('site' => 'Ядро сайта', 'meta' => 'Мета-теги');
     foreach ($function_modules as $key => $val) {
         $filter_modules[$key] = $val['name'][$intlang];
     }
     return $filter_modules;
 }
コード例 #4
0
ファイル: dynamic_img.php プロジェクト: romlg/cms36
 /**
  * Оторажение списка персон
  * @return mixed
  */
 function Show()
 {
     if (!empty($_POST)) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('list_table');
     $ret['table'] = list_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'image', 'type' => 'imagepath', 'display' => 'image'), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет'), 'filter_field' => 'IF(visible=0,2,1)'), array('select' => 'priority', 'display' => 'priority', 'flags' => FLAG_SEARCH | FLAG_SORT)), 'from' => $this->table, 'where' => domainRootId() > 0 ? '(FIND_IN_SET(' . domainRootID() . ', root_ids) OR root_ids="")' : "", 'params' => array('page' => $this->name, 'do' => 'show'), 'orderby' => 'name', 'script' => "function pic_preview(obj) {\n                obj_href = \$(obj).attr('link');\n                obj_init = \$(obj).attr('init');\n                if (typeof(obj_init)=='undefined') {\n                \t\$(obj).fancybox({\n                \t    'href' : obj_href,\n                        'centerOnScroll': true,\n                        'autoScale'     : false,\n                        'transitionIn'\t: 'none',\n                        'transitionOut'\t: 'none',\n                        'hideOnOverlayClick' : false\n                \t});\n                \t\$(obj).attr('init', 1);\n                    \$(obj).click();\n                }\n            }"), $this);
     $ret['thisname'] = $this->name;
     return $this->Parse($ret, LIST_TEMPLATE);
 }
コード例 #5
0
ファイル: voting.php プロジェクト: romlg/cms36
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     require_once core('ajax_table');
     $ret['thisname'] = $this->name;
     $ret['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'date', 'display' => 'date', 'type' => 'text', 'flags' => FLAG_SORT), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT), array('select' => 'open', 'display' => 'open', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT)), 'where' => "lang='" . lang() . "' AND root_id=" . domainRootID(), 'orderby' => 'priority', 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     return $this->Parse($ret, $this->name . '.tmpl');
 }
コード例 #6
0
ファイル: surveys.php プロジェクト: romlg/cms36
 function Show()
 {
     if (!empty($GLOBALS['_POST'])) {
         $actions = get('actions', '', 'p');
         if ($actions) {
             return $this->{$actions}();
         }
     }
     // строим таблицу
     require_once core('list_table');
     $data['table'] = list_table(array('columns' => array(array('select' => 's.id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 's.name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 'UNIX_TIMESTAMP(s.date_from)', 'as' => 'date_from', 'display' => 'date_from', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'date', 'filter_value' => 'date', 'type' => 'date'), array('select' => 'UNIX_TIMESTAMP(s.date_till)', 'as' => 'date_till', 'display' => 'date_till', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'date', 'filter_value' => 'date', 'type' => 'date'), array('select' => 'IF(s.closed=1,1,2)', 'as' => 'closed', 'display' => 'closed', 'type' => 'closed', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет')), array('select' => 's.id', 'display' => 'export', 'type' => 'export'), array('select' => 's.id', 'display' => 'results', 'type' => 'results')), 'from' => $this->table . "  AS s", 'orderby' => 's.id DESC', 'where' => $this->selector ? 'root_id = ' . domainRootID() : null, 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(s.id)', 'click' => 'ID=cb.value'), $this);
     $this->AddStrings($data);
     return $this->Parse($data, $this->name . '.tmpl');
 }
コード例 #7
0
ファイル: strings.php プロジェクト: romlg/cms36
 function getSiteModules()
 {
     global $cfg, $intlang;
     if (isset($cfg['function_modules'][domainRootID()])) {
         $function_modules = $cfg['function_modules'][domainRootID()];
     } else {
         $function_modules = array();
         foreach ($cfg['function_modules'] as $modules) {
             foreach ($modules as $name => $module) {
                 if (!isset($function_modules[$name])) {
                     $function_modules[$name] = $module;
                 }
             }
         }
     }
     $filter_modules = array('site' => 'Ядро сайта', 'meta' => 'Мета-теги');
     foreach ($function_modules as $key => $val) {
         $filter_modules[$key] = $val['name'][$intlang];
     }
     return $filter_modules;
 }
コード例 #8
0
ファイル: custom_tree.php プロジェクト: romlg/cms36
 /**
  * Сюда постится форма с CopyDlg() и тут все происходит
  * @return mixed
  */
 function EditProcCopy()
 {
     @ignore_user_abort();
     $trg = (int) $_GET['trg'] ? (int) $_GET['trg'] : domainRootID();
     $src = (int) $_GET['src'] ? (int) $_GET['src'] : domainRootID();
     if ($src && $src == $trg && isset($_GET['move'])) {
         page_error($this->str('e_move_to_same'));
         return;
     }
     if (isset($_GET['move']) && $src) {
         # перемещение раздела
         $this->MoveTree($src, $trg);
         $this->Validate(0, '', 0, array());
     } elseif (isset($_GET['copy']) && $src) {
         # копирование (каскадное)
         $this->CopyTree($src, $trg);
         $this->Validate(0, '', 0, array());
     } else {
         page_error($this->str('e_unknown'));
         return;
     }
     echo "\n\t\tDone. Closing window...\n\t\t<script type='text/javascript'>\n\t\tif (opener) opener.location.href = '/admin/?page=" . $this->name . "&id=" . $trg . "';\n\t\twindow.close();\n\t\t</script>\n\t\t";
 }
コード例 #9
0
ファイル: banners.php プロジェクト: romlg/cms36
 function EditForm()
 {
     $id = (int) get('id', 0);
     if ($id) {
         $row = $this->getRow($id);
         $type = $row['html'] ? 'html' : 'img';
     } else {
         $row['id'] = $id;
         $row['visible'] = 1;
         $row['target'] = 1;
         $row['position'] = '';
         $row['root_id'] = get('root_id', '100');
         $columns = sql_getRows('SHOW COLUMNS FROM banners', true);
         if (isset($columns['alt_image'])) {
             $row['alt_image'] = '';
         }
         if (isset($columns['show_at_sites'])) {
             $row['show_at_sites'] = '';
         }
         $type = 'image';
     }
     $GLOBALS['title'] = $this->str($id ? 'edit' : 'add');
     $this->AddStrings($row);
     $row['visible_checked'] = $row['visible'] ? 'checked' : '';
     if (!empty($row['pages'])) {
         $row['pages_checked'] = 'checked';
     }
     if (isset($row['image']) && is_file(".." . $row['image'])) {
         $ext = strtolower(get_file_ext($row['image']));
         $size = getimagesize(".." . $row['image']);
         // Рисуем картинку
         if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') {
             $row['img_preview'] = '<img src="' . $row['image'] . '" ' . $size[3] . ' alt="" />';
         } elseif ($ext == '.swf') {
             $row['img_preview'] = str_replace(array('{filename}', '{width}', '{height}'), array($row['image'], $size[0], $size[1]), $this->swf_code);
         }
     }
     if (isset($row['alt_image']) && is_file(".." . $row['alt_image'])) {
         $ext = strtolower(get_file_ext($row['alt_image']));
         $size = getimagesize(".." . $row['alt_image']);
         // Рисуем картинку
         if ($ext == '.gif' || $ext == '.jpg' || $ext == '.png') {
             $row['alt_img_preview'] = '<img src="' . $row['alt_image'] . '" ' . $size[3] . ' alt="" />';
         }
     }
     $row['options_target'] = $this->GetArrayOptions(array('_self', '_blank'), $row['target'], true, true);
     // Список положений баннера
     foreach ($this->position as $key => $val) {
         $options_pos[$key] = utf($val['display'][int_langId()]);
     }
     $row['options_pos'] = $this->GetArrayOptions($options_pos, $row['position'], true, false);
     // Список сайтов
     if (isset($row['show_at_sites'])) {
         global $site_domains;
         $sites = array();
         $root = domainRootID();
         foreach ($site_domains as $key => $val) {
             foreach ($val['langs'] as $l) {
                 if ($l['root_id'] != $root) {
                     $sites[$l['root_id']] = (LANG_SELECT && !empty($val['descr_' . lang()]) ? $val['descr_' . lang()] : (!empty($val['descr']) ? $val['descr'] : $val['name'])) . ' (' . $l['descr'] . ')';
                 }
             }
         }
         $row['sites'] = $sites;
         if (!empty($row['show_at_sites'])) {
             $row['show_at_sites'] = explode(",", $row['show_at_sites']);
         }
     }
     // Список вариантов для редактирования баннеров
     $options_type = array('img', 'html');
     $row['options_type'] = $this->GetArrayOptions($options_type, $type, false, true);
     // Текст для HTML баннера
     include_fckeditor();
     $oFCKeditor = new FCKeditor();
     $oFCKeditor->ToolbarSet = 'Common';
     $oFCKeditor->Value = isset($row['html']) ? $row['html'] : '';
     $row['html'] = $oFCKeditor->ReturnFCKeditor('fld[html]', '100%', '300px');
     return $this->Parse($row, $this->name . '.editform.tmpl');
 }
コード例 #10
0
ファイル: tree.php プロジェクト: romlg/cms36
 function Validate($pid = 0, $page = '', $level = 0, $data = array(), $root_id)
 {
     $level++;
     $root_id = $root_id ? $root_id : domainRootID();
     $pid = $pid ? $pid : $root_id;
     $data['pids'][$level] = $pid;
     if ($page) {
         $data['page'][$level] = $page;
     }
     if (defined('LANG_SELECT') && LANG_SELECT) {
         $name_select = "IF (name_" . lang() . " <> '', name_" . lang() . ", name_" . LANG_DEFAULT . ") as name";
     } else {
         $name_select = "name";
     }
     $rows = sql_query("SELECT id, pid, {$name_select}, type, page FROM " . $this->table . " WHERE pid=" . $pid . " AND id<>pid ORDER BY priority,name");
     if ($rows) {
         while ($row = mysql_fetch_assoc($rows)) {
             $sets = array();
             # nextid
             $sets[] = 'next=0';
             # pids
             $sets[] = "pids='/" . join("/", $data["pids"]) . "/'";
             # levels
             $sets[] = 'level=' . $level;
             # dir
             if (!$row['page']) {
                 $row['page'] = $row['id'];
                 $sets[] = "page='" . $row['page'] . "'";
             }
             if (sizeof($data['page'])) {
                 $sets[] = "dir='/" . join("/", $data['page']) . "/" . $row['page'] . "/'";
             } else {
                 $sets[] = "dir='/" . $row["page"] . "/'";
             }
             $res = sql_query("UPDATE " . $this->table . " SET " . join(', ', $sets) . " WHERE id=" . $row['id']);
             if ($row['pid']) {
                 $res = sql_query("UPDATE " . $this->table . " SET next=" . $row['id'] . " WHERE id=" . $row['pid']);
             }
             $this->check_id[] = $row['id'];
             $this->Validate($row['id'], $row['page'], $level, $data, $root_id);
         }
         mysql_free_result($rows);
         //            touch('sid/.cache');
     } else {
         die(mysql_error());
     }
 }
コード例 #11
0
ファイル: elem_main_base.php プロジェクト: romlg/cms36
 function getRootId()
 {
     return domainRootID();
 }
コード例 #12
0
ファイル: banners.php プロジェクト: romlg/cms36
 function Show()
 {
     if (!empty($_POST)) {
         $action = get('actions', '', 'p');
         if ($action) {
             if ($this->Allow($action)) {
                 return $this->{$action}();
             } else {
                 return $this->alert_method_not_allowed();
             }
         }
     }
     require_once core('ajax_table');
     $data['thisname'] = $this->name;
     $this->AddStrings($data);
     $options_pos = array();
     foreach ($this->position as $key => $val) {
         $options_pos[$key] = utf($val['display'][int_langID()]);
     }
     $data['table'] = ajax_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT), array('select' => 'image', 'display' => 'preview', 'type' => 'image'), array('select' => 'link', 'display' => 'link', 'type' => 'link'), array('select' => 'position', 'display' => 'position', 'type' => 'position', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + $options_pos), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'align' => 'center', 'flags' => FLAG_SORT), array('select' => 'priority', 'display' => 'priority', 'type' => 'text', 'align' => 'center', 'flags' => FLAG_SORT), array('select' => "clicks"), array('select' => "views", 'display' => 'ctr', 'type' => 'ctr', 'align' => 'center', 'flags' => FLAG_SORT)), 'where' => "lang='" . lang() . "' AND visible>=0 AND root_id=" . domainRootID(), 'orderby' => 'priority', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this);
     $data['root_id'] = domainRootID();
     return $this->Parse($data, $this->name . '.tmpl');
 }
コード例 #13
0
ファイル: elem_main.php プロジェクト: romlg/cms36
 function get_domain()
 {
     return domainRootID();
 }
コード例 #14
0
ファイル: help_generator.php プロジェクト: romlg/cms36
 /**
  * Генерация документации
  *
  * @return array
  */
 function showGenerate()
 {
     //        $res = mysql_query('SELECT * FROM ' . $this->table . ' ORDER BY module');
     //        if (!$res) return $this->error('Таблица ' . $this->table . ' пустая!');
     $ret = array();
     // Запишем все в массив
     $help = array();
     /*
             while ($row = mysql_fetch_assoc($res)) {
                 list($module, $submodule) = explode('/', $row['module']);
                 if (!$submodule) $submodule = $module;
     
                 list($submodule, $method) = explode('.', $submodule);
     
                 if ($module == $submodule . '.' . $method) {
                     if (!isset($help[$submodule])) {
                         $help[$submodule] = array(
                             'module' => $submodule,
                         );
                     }
                     $help[$submodule]['methods'][$method] = $row;
                 }
                 else {
                     if (!isset($help[$module])) {
                         $help[$module] = array(
                             'module' => $module,
                         );
                     }
                     $help[$module]['sub'][$submodule]['methods'][$method] = $row;
                 }
     
             }
             if (!$help) return $this->error('Не могу сформировать массив!');
     
             foreach ($help as $key => $val) {
                 $methods = $val['methods'];
                 unset($help[$key]['methods']);
                 if (isset($methods['show'])) $help[$key]['methods']['show'] = $methods['show'];
                 if (isset($methods['editform'])) $help[$key]['methods']['editform'] = $methods['editform'];
                 unset($methods['show'], $methods['editform']);
                 if (!empty($methods)) $help[$key]['methods'] = array_merge($help[$key]['methods'], $methods);
             }
     */
     if (isset($help['strings'])) {
         $help['strings']['methods']['list'] = array('module' => 'strings.list', 'name' => 'Список строковых констант', 'text' => '');
         $site_modules = $this->getSiteModules();
         $strings = sql_getRows('SELECT * FROM strings WHERE root_id = ' . domainRootID() . ' ORDER BY module, name');
         $ret['strings'] = array();
         foreach ($strings as $k => $v) {
             if (!isset($ret['strings'][$v['module']])) {
                 $ret['strings'][$v['module']] = array('title' => isset($site_modules[$v['module']]) ? $site_modules[$v['module']] : $v['module'], 'items' => array());
             }
             $ret['strings'][$v['module']]['items'][] = $v;
         }
     }
     // Получаем список модулей в таком порядке, как они отображаются в админке слева в меню
     $all_modules = $this->getAllModules();
     array_unshift($all_modules[0]['items'], array('name' => 'fck', 'title' => 'FCK Editor'));
     // Дополним пустые значения данными с ctool
     $empty_help = '<p>Документация по вашему запросу не найдена. Пожалуйста, поставьте задачу на <a href="http://help.rusoft.ru">http://help.rusoft.ru</a>.</p>';
     foreach ($all_modules as $key => $section) {
         foreach ($section['items'] as $k => $module) {
             //                if (!isset($help[$module['name']])) {
             $help[$module['name']]['module'] = $module['name'];
             // сходим за данными в ctool
             $url = "http://help.rusoft.ru/getmanual.php?engine=3.6&module=" . $module['name'] . ".show" . "&site=" . $_SERVER['HTTP_HOST'];
             $content = file_get_contents($url);
             if ($content != $empty_help) {
                 if (preg_match('|<h1.*?>(.*)</h1>|sei', $content, $arr)) {
                     $title = $arr[1];
                 } else {
                     $title = '';
                 }
                 $help[$module['name']]['methods']['show'] = array('module' => $module['name'] . '.show', 'name' => $title, 'text' => str_replace("<h1>" . $title . "</h1>", "", $content));
             }
             $url = "http://help.rusoft.ru/getmanual.php?engine=3.6&module=" . $module['name'] . ".editform" . "&site=" . $_SERVER['HTTP_HOST'];
             $content = file_get_contents($url);
             if ($content != $empty_help) {
                 if (preg_match('|<h1.*?>(.*)</h1>|sei', $content, $arr)) {
                     $title = $arr[1];
                 } else {
                     $title = '';
                 }
                 $help[$module['name']]['methods']['editform'] = array('module' => $module['name'] . '.editform', 'name' => $title, 'text' => str_replace("<h1>" . $title . "</h1>", "", $content));
             }
         }
         if (!isset($help[$module['name']]['methods'])) {
             unset($help[$module['name']]);
         }
         //            }
     }
     //        $ret['fck_style'] = !isset($help['fck']) ? 'style="color: red"' : '';
     foreach ($all_modules as $key => $section) {
         foreach ($section['items'] as $k => $module) {
             $all_modules[$key]['items'][$k]['style'] = !isset($help[$module['name']]) ? 'style="color: red"' : '';
         }
     }
     $ret['sections'] = $all_modules;
     $ret['help'] = $help;
     $temp = @$help['footer']['sub']['footer']['methods'];
     if ($temp) {
         $temp = current($temp);
         $ret['footer'] = $temp['text'];
     }
     $temp = @$help['header']['sub']['header']['methods'];
     if ($temp) {
         $temp = current($temp);
         $ret['header'] = $temp['text'];
     }
     return $ret;
 }