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); }
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); }
/** * Оторажение списка персон * @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); }
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' => 'm.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'm.name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT, 'type' => 'text'), array('select' => 'UNIX_TIMESTAMP(m.date)', 'display' => 'date', 'flags' => FLAG_FILTER | FLAG_SORT, 'type' => 'date', 'filter_type' => 'date', 'filter_display' => 'Фильтровать по дате'), array('select' => 'm.message', 'display' => 'message', 'size' => '50'), array('select' => 'm.visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT), array('select' => 'm.visiblemain', 'display' => 'visiblemain', 'type' => 'visible', 'flags' => FLAG_SORT)), 'from' => $this->table . " AS m", 'orderby' => 'm.date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value'), $this); $this->AddStrings($data); return $this->Parse($data, LIST_TEMPLATE); }
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' => 'c.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'UNIX_TIMESTAMP(c.date)', 'as' => 'date', 'display' => 'date', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'date', 'filter_value' => 'date', 'type' => 'date'), array('select' => 'IF(p.name IS NOT NULL, p.name, "-")', 'as' => 'publication', 'display' => 'publication', 'type' => 'publication_link'), array('select' => 'IF(a.name IS NOT NULL, a.name, c.name)', 'as' => 'user_name', 'display' => 'user_name', 'flags' => FLAG_SEARCH | FLAG_SORT, 'type' => 'user_link'), array('select' => 'c.text', 'type' => 'text', 'as' => 'descr', 'display' => 'text'), array('select' => 'c.visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('') + array('1' => 'Да', '2' => 'Нет'), 'filter_field' => 'IF(c.visible=0,2,1)'), array('select' => 'c.user_id'), array('select' => 'c.publication_id'), array('select' => 'c.text', 'flags' => FLAG_SEARCH)), 'from' => $this->table . " as c\n\t\t\tLEFT JOIN `auth_users` as a ON a.id = c.user_id\n\t\t\tLEFT JOIN `publications` as p ON p.id = c.publication_id\n\t\t\tLEFT JOIN `tree` as t ON t.id = p.pid\n\t\t\t", 'where' => '(t.root_id=' . domainRootId() . ' OR t.root_id IS NULL)', 'orderby' => 'c.date DESC', '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); }
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'); }
function Show() { if (!empty($GLOBALS['_POST'])) { $actions = get('actions', '', 'p'); if ($actions) { return $this->{$actions}(); } } require_once core('list_table'); $ret['thisname'] = $this->name . '.editform'; $ret['table'] = list_table(array('columns' => array(array('select' => 'id'), array('select' => 'date', 'display' => 'date'), array('select' => 'event', 'display' => 'event', 'flags' => FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array(0 => $str[get_class_name($this)]['all_events']) + sql_getRows("SELECT DISTINCT `event`,`event` FROM `notify_events` ORDER BY `event`", true)), array('select' => 'email', 'display' => 'email')), 'from' => $this->table, 'orderby' => '`date` DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this); $this->AddStrings($ret); return $this->Parse($ret, LIST_TEMPLATE); }
function Show() { if (!empty($GLOBALS['_POST'])) { $actions = get('actions', '', 'p'); if ($actions) { return $this->{$actions}(); } } require_once core('list_table'); $ret['thisname'] = $this->name . '.editform'; $ret['table'] = list_table(array('columns' => array(array('select' => 'id'), array('select' => 'event', 'display' => 'event', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'description', 'display' => 'description', 'flags' => FLAG_SEARCH)), 'from' => $this->table, 'orderby' => '`event` ASC', 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this); $this->AddStrings($ret); return $this->Parse($ret, LIST_TEMPLATE); }
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' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH), array('select' => 'fname', 'display' => 'fname'), array('select' => 'visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT)), 'from' => $this->table, 'orderby' => 'priority ASC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value'), $this); $this->AddStrings($data); return $this->Parse($data, LIST_TEMPLATE); }
/** * Оторажение списка персон * @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_site', 'display' => 'name_site', 'flags' => FLAG_SEARCH | FLAG_SORT), 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' => 'hash', 'display' => 'hash', 'type' => 'code')), 'from' => $this->table, 'params' => array('page' => $this->name, 'do' => 'show'), 'orderby' => 'name'), $this); $ret['table'] .= "\n <script>\n \$(document).ready(function(){\n\n function setcode(text, ptext){\n var toret = '';\n if (text) {\n switch (ptext) {\n case true:\n toret = 'text_popup_html';\n break;\n case false:\n toret = 'text_html';\n break;\n default:\n toret = 'text_html';\n break;\n }\n } else {\n switch (ptext) {\n case true:\n toret = 'text_popup_normal';\n break;\n case false:\n toret = 'text_normal';\n break;\n default:\n toret = 'text_normal';\n break;\n }\n }\n return toret;\n }\n\n \$('.popup_code_shower').change(function(){\n var text_obj = \$('#code_text_'+\$(this).attr('popup_code_id'));\n text_obj.text(text_obj.attr(setcode(\$('#code_shower_'+\$(this).attr('popup_code_id')).is(':checked'), \$(this).is(':checked'))));\n });\n \$('.code_shower').change(function(){\n var text_obj = \$('#code_text_'+\$(this).attr('code_id'));\n text_obj.text(text_obj.attr(setcode(\$(this).is(':checked'), \$('#popup_code_shower_'+\$(this).attr('code_id')).is(':checked'))));\n });\n\n \$('.code_shower_text').click(function(){\n \$(this).focus().select();\n });\n \$('.code_shower_href').click(function(){\n \$(this).hide();\n \$(this).next('div').show();\n });\n });\n </script>\n "; $ret['thisname'] = $this->name; return $this->Parse($ret, LIST_TEMPLATE); }
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' => 'm.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'm.date', 'display' => 'date', 'flags' => FLAG_SORT, 'type' => 'text'), array('select' => 'm.email', 'display' => 'email'), array('select' => 'm.page_name', 'display' => 'page_name', 'type' => 'page', 'flags' => FLAG_SORT), array('select' => 'm.page_url'), array('select' => 'm.text', 'display' => 'text', 'type' => 'text_content', 'flags' => FLAG_SEARCH)), 'from' => $this->table . " AS m", 'orderby' => 'm.date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'click' => 'ID=cb.value'), $this); $this->AddStrings($data); return $this->Parse($data, LIST_TEMPLATE); }
function Show() { if (!empty($GLOBALS['_POST'])) { $actions = get('actions', '', 'p'); if ($actions) { return $this->{$actions}(); } } $ret['thisname'] = $this->name . '.editform'; require_once core('list_table'); $ret['table'] = list_table(array('columns' => array(array('select' => 's.id', 'as' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 's.name', 'display' => 'name', 'flags' => FLAG_SORT), array('select' => 'CONCAT(s.descr, \' - \', l.descr)', 'as' => 'descr', 'display' => 'descr', 'lang_select' => LANG_SELECT, 'flags' => FLAG_SORT), array('select' => 't.root_id', 'display' => 'root_id', 'flags' => FLAG_SORT)), 'from' => $this->table . " as s\n LEFT JOIN sites_langs as l ON l.pid=s.id\n LEFT JOIN tree as t ON t.root_id=l.root_id AND t.id=t.pid", 'where' => "", 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'orderby' => 't.priority', 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this); $this->AddStrings($ret); $ret['thisname2'] = str_replace('/', '', $this->name); return $this->Parse($ret, 'sites.tmpl'); }
function Show() { // define ('DEV_MODE', true); 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' => 'n.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'n.name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT, 'type' => 'text'), array('select' => 'UNIX_TIMESTAMP(n.date)', 'display' => 'date', 'flags' => FLAG_FILTER | FLAG_SORT, 'type' => 'date', 'filter_type' => 'date', 'filter_display' => 'Фильтровать по дате'), array('select' => 'n.notice', 'display' => 'text'), array('select' => 'n.text', 'display' => 'text'), array('select' => 'n.visible', 'display' => 'visible', 'type' => 'visible', 'flags' => FLAG_SORT)), 'from' => $this->table . " AS n", 'where' => 'n.pid=' . $this->pid, 'orderby' => 'n.date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), '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); }
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('list_table'); $data['table'] = list_table(array('columns' => array(array('select' => 'IFNULL(t2.id,t1.id)', 'as' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => "CONCAT(IF(t1.module='site', '', CONCAT(t1.module, '_')), t1.name)", 'as' => 'name', 'display' => 'name', 'flags' => FLAG_SEARCH | FLAG_SORT), array('select' => 't1.module', 'display' => 'module', 'type' => 'module_name', 'flags' => FLAG_SEARCH | FLAG_SORT | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => array('' => $this->str('all')) + $this->getSiteModules(), 'filter_str' => false), array('select' => 'IFNULL(t2.value,t1.value)', 'as' => 'value', 'display' => 'value', 'flags' => FLAG_SEARCH), array('select' => 'IF(t2.value IS NULL,1,0)', 'as' => 'is_default', 'display' => 'is_default', 'type' => 'visible', 'flags' => FLAG_SORT), array('select' => 'IFNULL(t2.def,t1.def)', 'display' => 'def', 'flags' => FLAG_SEARCH), array('select' => 'IFNULL(t2.description,t1.description)', 'display' => 'description', 'flags' => FLAG_SEARCH)), 'from' => $this->table . ' AS t1 LEFT JOIN ' . $this->table . ' AS t2 ON (t1.module=t2.module AND t1.name=t2.name AND t2.root_id=' . domainRootID() . ')', 'where' => domainRootId() > 0 ? 't1.root_id=' . getMainRootID() : '', 'orderby' => 't1.module,t1.name', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value'), $this); $this->AddStrings($data); return $this->Parse($data, LIST_TEMPLATE); }
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(); } } } $this->AddStrings($data); require_once core('list_table'); $data['table'] = list_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'module', 'display' => 'module', 'flags' => FLAG_SORT), array('select' => 'name', 'display' => 'name', 'flags' => FLAG_SORT)), 'orderby' => 'module, name', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID = cb.value'), $this); return $this->Parse($data, LIST_TEMPLATE); }
function Show() { if (!empty($GLOBALS['_POST'])) { $actions = get('actions', '', 'p'); if ($actions) { return $this->{$actions}(); } } require_once core('list_table'); $data['thisname'] = $this->name; $logins = array('' => '-') + sql_getRows('SELECT DISTINCT login FROM ' . $this->table . ' ORDER BY login', true); $data['root'] = is_root(); $this->AddStrings($data); $data['table'] = list_table(array('columns' => array(array('select' => 'login', 'display' => 'login', 'flags' => FLAG_SORT | FLAG_SEARCH | FLAG_FILTER, 'filter_type' => 'array', 'filter_value' => $logins), array('select' => 'ip', 'display' => 'ip', 'width' => '1px', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'date', 'display' => 'date', 'type' => 'datetime', 'width' => '100px', 'flags' => FLAG_SORT)), 'from' => ' log_access ', 'orderby' => 'date DESC', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => '', 'click' => ''), $this); $this->AddStrings($data); return $this->Parse($data, LIST_TEMPLATE); }
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('list_table'); $ret['thisname'] = $this->name; $ret['table'] = list_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'name', 'display' => 'name'), array('select' => 'priority', 'display' => 'priority', 'type' => 'priority', 'width' => '1')), 'orderby' => 'priority, name', 'params' => array('page' => $this->name, 'do' => 'show', 'move' => 0), 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this); return $this->Parse($ret, LIST_TEMPLATE); }
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' => 'u.id', 'display' => 'id', 'type' => 'checkbox', 'width' => '1px'), array('select' => 'u.login', 'display' => 'login', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'u.name', 'display' => 'name', 'flags' => FLAG_SORT | FLAG_SEARCH), array('select' => 'u.email', 'display' => 'email', 'flags' => FLAG_SORT | FLAG_SEARCH)), 'from' => $this->table . " as u", 'where' => '', 'orderby' => 'login', 'params' => array('page' => $this->name, 'do' => 'show'), 'dblclick' => 'editItem(id)', 'click' => 'ID=cb.value'), $this); // Запись в сессию текущую выборку по клиентам session_start(); $_SESSION['client_selection'] = $GLOBALS['where']; session_write_close(); $this->AddStrings($data); return $this->Parse($data, LIST_TEMPLATE); }
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('list_table'); $columns = array(array('select' => 'u.id', 'display' => 'id', 'type' => 'checkbox'), array('select' => 'u.login', 'display' => 'login', 'flags' => FLAG_SEARCH), array('select' => 'g.name', 'display' => 'group', 'flags' => FLAG_SEARCH), array('select' => 'u.fullname', 'display' => 'fullname', 'flags' => FLAG_SEARCH), array('select' => 'u.email', 'display' => 'email', 'flags' => FLAG_SEARCH), array('select' => 'u.phone', 'display' => 'phone', 'flags' => FLAG_SEARCH), array('select' => 'u.description', 'display' => 'description', 'flags' => FLAG_SEARCH)); $admins_columns = sql_getRows("SHOW COLUMNS FROM `admins`", true); if (isset($admins_columns['department_id'])) { $columns[] = array('select' => '(SELECT name FROM tree WHERE id=u.department_id)', 'as' => 'department', 'display' => 'department', 'flags' => FLAG_SEARCH); } $ret['table'] = list_table(array('columns' => $columns, 'from' => "{$this->table} as u LEFT JOIN admin_groups as g ON g.id=u.group_id", 'params' => array('page' => $this->name, 'do' => 'show'), 'orderby' => 'u.group_id, u.id', 'click' => 'ID=cb.value', 'dblclick' => 'editItem(id)'), $this); $ret['thisname'] = $this->name; return $this->Parse($ret, LIST_TEMPLATE); }
function Show() { # универсальный обработчик поста if (!empty($_POST)) { $action = get('actions', '', 'p'); if ($action) { if ($this->Allow($action, 'tree')) { return $this->{$action}(); } else { return; } } } require_once core('list_table'); $row['delete'] = $this->str('delete'); $this->AddStrings($row); $row['thisname'] = $this->name; $row['close'] = $this->str('close'); $row['reset'] = $this->str('reset'); $row['table'] = list_table(array('columns' => array(array('select' => 'id', 'display' => 'id', 'type' => 'checkbox'), array('lang_select' => defined('LANG_SELECT') ? LANG_SELECT : 0, 'select' => 'name', 'display' => 'name')), 'where' => 'visible<0', 'orderby' => 'uptime desc', 'params' => array('page' => $row['thisname'], 'do' => 'show', 'noedit' => true)), $this); return $this->Parse($row, 'recycle.show.tmpl'); }
/** * строим список с элемами * * @return html */ function ElemList($tabname = "") { $id = (int) get('id', 0); $rows = array(); $pid = $this->id; $this->table = $this->elem_table; // если редактируем $rows = $this->getObject(); if (count($rows['object'])) { foreach ($rows['object'] as $kobj => $vobj) { $rows['object'][$kobj]['tabname'] = $tabname; $rows['object'][$kobj]['onclick'] = $tabname . ".showSelectDiv(" . $vobj['id'] . ", this);"; } } if ($this->elem_type == 'link') { unset($this->list_buttons['create']); } if (isset($this->list_buttons['create']['div_id'])) { $this->list_buttons['create']['div_id'] = 'tmp' . $tabname . $this->name . $id; } if (isset($this->list_buttons['delete']['div_id'])) { $this->list_buttons['delete']['div_id'] = 'tmp' . $tabname . $this->name . $id; } // Если указан класс для использования редактирования берем его // Если нет то получаем название класса из имени элема if (!empty($this->elem_class)) { $class_name = $this->elem_class; } else { $str = explode("_", $this->elem_name); $class_name = isset($str[1]) ? $str[1] : ''; } if (!elem($class_name . "/" . $class_name)) { die("У multielem - " . $this->elem_name . " не найден класс для подключения создания/редактирования"); } $_GET['limit'] = "-1"; // Параметр is_fancy=1 обозначает что всплывающий фрейм организован на основе fancybox $table = array('columns' => $this->columns, 'dataset' => isset($rows['object']) ? $rows['object'] : array(), 'params' => array('id' => $id, 'page' => $this->name, 'tab' => $tabname, 'class' => $class_name), 'action' => 'editor.php', 'click' => $this->click, 'dblclick' => $this->dblclick, 'tabframename' => 'tmp' . $tabname . $this->name . $id, 'id_table_list_name' => 'tbl' . $tabname . $this->name . $id, 'list_buttons' => $this->list_buttons, 'script' => isset($this->script) ? $this->script : "", 'src_frame' => "'./editor.php?page=" . $class_name . "&frame=view&pid=" . $pid . "&tabname=" . $tabname . "&page_name=" . $this->name . "&elem_name=" . $this->elem_name . "&is_fancy=1'", 'tmpl' => 'table_no_form.tmpl'); //debug if ($this->sql) { $table['_sql'] = true; } require_once core('list_table'); $data['table'] = list_table($table, $this); $data['window_size'] = $this->window_size; $this->AddStrings($data); $data['id'] = $id; $data['tab'] = $tabname; $data['elem_actions'] = $this->elem_actions; $data['thisname2'] = str_replace('/', '', $data['thisname']); $data['elem_type'] = $this->elem_type; if ($this->elem_type == 'link') { $data['autosuggest'] = array('table' => $this->elem_table, 'field' => @$this->autosuggest['field'], 'where' => @$this->autosuggest['where'], 'note' => @$this->autosuggest['note'], 'lang_select' => LANG_SELECT); } return Parse($data, OBJECT_EDITOR_MODULE . '/list.tmpl'); }
} if (isset($_GET["newdomain"])) { $_POST["white-list-domain"] = $_GET["newdomain"]; add_domain_white_save(); exit; } if (isset($_POST["white-list-host-del"])) { hosts_WhiteList_del(); exit; } if (isset($_POST["white-list-host"])) { hosts_WhiteList_add(); exit; } if (isset($_GET["list-table"])) { list_table(); exit; } if (isset($_GET["add-domain-white-js"])) { add_domain_white_js(); exit; } if (isset($_GET["add-domain-white"])) { add_domain_white_popup(); exit; } if (isset($_POST["white-list-domain"])) { add_domain_white_save(); exit; } page();