/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_html_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_archive_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $form->data['sections'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_sections WHERE module='archive'"); $this->RESULT['html'] = $form->getContent(); }
function getUrlForm() { $form = new A_Form("plugin_seo_url.tpl"); if ($_POST['url']) { $form->data = A::$DB->getRow("SELECT * FROM " . STRUCTURE . " WHERE url=?", $_POST['url']); } $form->data['url'] = $_POST['url']; $this->RESULT['html'] = $form->getContent(); }
function getEditForm() { $form = new A_Form("plugin_courier_edit.tpl"); $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE); $form->data['data'] = !empty($form->data['data']) ? unserialize($form->data['data']) : array(); $form->data['data'] = array_pad($form->data['data'], 6, array()); if ($section = getSectionByModule('shoplite')) { $form->data['valute'] = getOption($section, 'valute'); } $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_shoplite_items_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $form->data['sections'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_sections WHERE module='shoplite' ORDER BY sort"); $section = getSectionById($form->data['idsec']); $form->data['categories'] = array(); $this->getCategories($section, $form->data['categories'], 0); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_banner_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $form->data['structures'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_structures WHERE plugin='banners' ORDER BY sort"); if ($structure = getStructureById($form->data['idstr'])) { $form->data['categories'] = A::$DB->getAssoc("SELECT id,name FROM {$structure}_categories ORDER BY sort"); } $this->RESULT['html'] = $form->getContent(); }
function getEditURLForm() { $form = new A_Form("plugin_vars_editurl.tpl"); $form->data['url'] = $_POST['url']; $form->data['items'] = A::$DB->getAll("SELECT * FROM " . STRUCTURE . (!empty($_POST['id']) ? " WHERE id=" . (int) $_POST['id'] : "")); foreach ($form->data['items'] as $i => $row) { $data = !empty($row['data']) ? unserialize($row['data']) : array(); $form->data['items'][$i]['value'] = isset($data[$_POST['url']]) ? $data[$_POST['url']] : ""; } $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму переиндексирования. */ function getIndexForm() { $form = new A_Form("module_search_index.tpl"); $form->data['sections'] = array(); A::$DB->query("SELECT * FROM " . DOMAIN . "_sections WHERE lang='" . LANG . "' OR lang='all' ORDER BY sort"); while ($row = A::$DB->fetchRow()) { if (function_exists($row['module'] . '_searchIndexAll')) { $form->data['sections'][] = $row; } } A::$DB->free(); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_gallery_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $form->data['sections'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_sections WHERE module='gallery' ORDER BY sort"); $section = getSectionById($form->data['idsec']); $form->data['categories'] = array(); $this->getCategories($section, $form->data['categories'], 0); $idcat = !empty($form->data['idcat']) ? (int) $form->data['idcat'] : 0; $form->data['albums'] = A::$DB->getAssoc("SELECT id,name FROM {$section}_albums WHERE idcat={$idcat} ORDER BY name"); $this->RESULT['html'] = $form->getContent(); }
function getEditRSSForm() { $form = new A_Form("plugin_rss_edit.tpl"); $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE); $form->data['sections'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_sections WHERE module='catalog'"); $form->data['categories'] = array(); if ($form->data['sections']) { if ($section = getSectionById($form->data['idsec'])) { $this->getCats($section, $form->data['categories'], 0); } $this->RESULT['html'] = $form->getContent(); } else { $this->RESULT['html'] = AddLabel("Не найдены разделы материалов."); } }
function getEditBannerForm() { $form = new A_Form("plugin_banners_edit.tpl"); $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE); $form->data['categories'] = A::$DB->getAssoc("SELECT id,name FROM " . STRUCTURE . "_categories ORDER BY sort"); $form->data['showall'] = empty($form->data['show']) && empty($form->data['showurl']); $show = !empty($form->data['show']) ? unserialize($form->data['show']) : array(); $form->data['sections'] = array(); A::$DB->query("SELECT * FROM " . DOMAIN . "_sections ORDER BY sort"); while ($row = A::$DB->fetchRow()) { $form->data['sections'][] = array('id' => $row['id'], 'caption' => $row['caption'], 'checked' => in_array($row['id'], $show)); } A::$DB->free(); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_cloud_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); if (!isset($form->data['count'])) { $form->data['count'] = 50; } $form->data['sections'] = A_SearchEngine::getInstance()->getSections(); foreach ($form->data['sections'] as $idsec => $caption) { if (!getOption(getSectionById($idsec), 'usetags')) { unset($form->data['sections'][$idsec]); } } $this->RESULT['html'] = $form->getContent(); }
function Edit() { $form = new A_Form("block_categoriestree_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $tables = A::$DB->getTables(); $form->data['sections'] = array(); A::$DB->query("SELECT * FROM " . DOMAIN . "_sections"); while ($row = A::$DB->fetchRow()) { $section = DOMAIN . "_" . $row['lang'] . "_" . $row['name']; $usecats = $row['module'] != 'shoplite' ? A::$DB->existsRow("SELECT id FROM " . DOMAIN . "_options WHERE item='{$section}' AND var='usecats'") : false; if (in_array($section . "_categories", $tables) && (!$usecats || getOption($section, 'usecats'))) { $form->data['sections'][$row['id']] = $row['caption']; } } A::$DB->free(); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму редактирования. */ function Edit() { $form = new A_Form("block_links_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $links = array(); foreach ($form->data['links'] as $row) { $row2['sub'] = false; $links[] = $row; foreach ($row['sublinks'] as $row2) { $row2['sub'] = true; $links[] = $row2; } } $form->data['links'] = $links; $form->data['count'] = count($links); $form->data['alllinks'] = $this->getAllLinks(); $this->RESULT['html'] = $form->getContent(); }
function Edit() { $form = new A_Form("block_listdata_edit.tpl"); $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks"); $form->data = !empty($block['params']) ? unserialize($block['params']) : array(); $form->data['structures'] = array(); $list = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_structures WHERE plugin='listdata' ORDER BY sort"); foreach ($list as $id => $name) { $form->data['structures'][$id] = $name; } $list = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_structures WHERE plugin='listnum' ORDER BY sort"); foreach ($list as $id => $name) { $form->data['structures'][$id] = $name; } $list = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_structures WHERE plugin='liststr' ORDER BY sort"); foreach ($list as $id => $name) { $form->data['structures'][$id] = $name; } $this->RESULT['html'] = $form->getContent(); }
function getEditForm() { $idsec = (int) A_Session::get(STRUCTURE, 0); $form = new A_Form("plugin_fcategory_edit.tpl"); $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE); $form->data['vars'] = array(); A::$DB->query("SELECT * FROM " . DOMAIN . "_structures ORDER BY sort"); while ($row = A::$DB->fetchRow()) { $_item = DOMAIN . "_structure_" . $row['name']; if (function_exists($row['plugin'] . '_loadlist')) { $form->data['vars'][$_item] = $row['caption']; } } A::$DB->free(); A::$DB->query("SELECT * FROM " . DOMAIN . "_sections WHERE id<>{$idsec} ORDER BY sort"); while ($row = A::$DB->fetchRow()) { $_item = DOMAIN . "_" . $row['lang'] . "_" . $row['name']; if (function_exists($row['module'] . '_loadlist')) { $form->data['vars'][$_item] = $row['caption']; } } A::$DB->free(); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму перемещения записей. */ function getMoveItemsForm() { if (empty($_POST['items'])) { return; } $form = new A_Form("module_catalog_move.tpl"); $form->data['idcat'] = $_POST['idcat']; $form->data['items'] = array_values($_POST['items']); $form->data['categories'] = A::$DB->getAll("SELECT id,idker,name FROM " . SECTION . "_categories ORDER BY level,sort"); if (count($form->data['categories']) > 0) { $this->RESULT['html'] = $form->getContent(); } else { $this->RESULT['html'] = AddLabel("Нет вариантов перемещения."); } }
/** * Обработчик действия: Отдает форму с тестом архивного сообщения. */ function getmessageform() { $form = new A_Form("module_feedback_message.tpl"); $form->data = A::$DB->getRowById($_POST['id'], SECTION . "_arch"); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает таблицу с элементами текущего уровня. */ function getGrid() { $form = new A_Form("module_pages_grid.tpl"); $curdir = (int) A_Session::get(SECTION . "_cid", 0); $rows = (int) A_Session::get(SECTION . "_rows", isset($_COOKIE[SECTION . '_rows']) ? $_COOKIE[SECTION . '_rows'] : 20); $form->data['seo'] = getStructureByPlugin('seo'); $form->data['title'] = $this->getPath($curdir); $form->data['pages'] = array(); $pager = new A_Pager($rows, "gopage"); $pager->query("SELECT * FROM " . SECTION . " WHERE idker={$curdir} ORDER BY sort"); if ($curdir > 0 && ($row = A::$DB->getRowById($curdir, SECTION))) { $grow[0] = " "; $grow[1] = AddImageButton("/templates/admin/images/back.gif", "indir({$row['idker']})", "Уровень выше", 16, 16); $grow[2] = AddClickText("...", "indir({$row['idker']})"); $grow[3] = $grow[5] = $grow[6] = $grow[7] = $grow[8] = " "; $grow[4] = 0; $form->data['sub'] = true; $form->data['pages'][] = $grow; } else { $form->data['sub'] = false; } $crows = 0; while ($row = $pager->fetchRow()) { $grow[0] = "<input type=\"checkbox\" id=\"checkp{$crows}\" name=\"checkpages[]\" value=\"{$row['id']}\"/>"; $grow['link'] = pages_createItemLink($row['id'], SECTION); if ($row['type'] == 'dir') { $grow[1] = AddImage("/templates/admin/images/dir.gif", 16, 16); $grow[2] = AddLink(truncate($row['name'], 100), "javascript:indir({$row['id']})", "Войти в подраздел"); $grow[3] = " "; $grow[4] = $row['date']; $grow[5] = AddImageButton("/templates/admin/images/edit.gif", "geteditdirform({$row['id']})", "Редактировать", 16, 16); $grow[6] = AddImageButtonLink("/templates/admin/images/browse.gif", $grow['link'], "Просмотр на сайте", 16, 16, ' target="_blank"'); } else { $grow[1] = AddImage("/templates/admin/images/text.gif", 16, 16); $grow[2] = AddLink(truncate($row['name'], 100), "javascript:geteditpageform({$row['id']})", "Редактировать"); $grow[3] = "<a href=\"javascript:edittpl('{$row['template']}')\" title=\"Редактировать шаблон\">{$row['template']}</a>"; $grow[4] = $row['date']; $grow[5] = " "; $grow[6] = AddImageButtonLink("/templates/admin/images/browse.gif", $grow['link'], "Просмотр на сайте", 16, 16, ' target="_blank"'); } $grow[7] = AddImageButton("/templates/admin/images/move.gif", "getmoveform({$row['id']})", "Переместить", 16, 16); $grow[8] = AddImageButton("/templates/admin/images/del.gif", "delitem({$row['id']},'{$row['urlname']}')", "Удалить", 16, 16); $grow['id'] = $row['id']; $grow['active'] = $row['active']; $form->data['pages'][] = $grow; $crows++; } $pager->free(); $form->data['pager'] = $pager; $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму импорта каталога. */ function getImportForm() { $form = new A_Form("module_shoplite_import.tpl"); $this->RESULT['html'] = $form->getContent(); }
function getImportForm() { $form = new A_Form("plugin_listdata_import.tpl"); $this->RESULT['html'] = $form->getContent(); }
/** * Обработчик действия: Отдает форму добавления фото. */ function getAddImageForm() { $form = new A_Form("module_gallery_addimage.tpl"); $form->data['idalb'] = (int) $_POST['idalb']; $this->RESULT['html'] = $form->getContent(); }