Example #1
0
        $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE);
        $this->RESULT['html'] = $form->getContent();
    }
    function getAddURLForm()
    {
        $form = new A_Form("plugin_vars_addurl.tpl");
        $form->data['items'] = A::$DB->getAll("SELECT * FROM " . STRUCTURE . (!empty($_POST['id']) ? " WHERE id=" . (int) $_POST['id'] : ""));
        $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 setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(STRUCTURE, array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new Vars_Request();
Example #2
0
    {
        switch ($action) {
            case "add":
                $this->Add();
                break;
            case "edit":
                $this->Edit();
                break;
        }
    }
    /**
     * Обработчик действия: Отдает форму добавления.
     */
    function Add()
    {
        $form = new A_Form("block_html_add.tpl");
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    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();
    }
}
A::$REQUEST = new html_BlockRequest();
Example #3
0
        $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 getAddImageForm()
    {
        $form = new A_Form("module_gallery_addimage.tpl");
        $form->data['idalb'] = (int) $_POST['idalb'];
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Сортировка.
     */
    function setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(DOMAIN . "_images", array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new GalleryModule_Request();
Example #4
0
                $name = "";
                for ($i = 0; $i < $row['level']; $i++) {
                    $name .= " > ";
                }
                $values[$row['id']] = $name . $row['name'];
                $this->getTreeList1($table, $values, $row['id']);
            }
        }
        A::$DB->free();
    }
    private function getTreeList2($table, &$values, $id)
    {
        A::$DB->query("SELECT * FROM {$table} WHERE idker={$id} ORDER BY sort");
        if (A::$DB->numRows()) {
            while ($row = A::$DB->fetchRow()) {
                $childs = A::$DB->getOne("SELECT COUNT(*) FROM {$table} WHERE idker=" . $row['id']);
                if ($childs > 0) {
                    $name = "";
                    for ($i = 0; $i < $row['level']; $i++) {
                        $name .= " > ";
                    }
                    $values[$row['id']] = $name . $row['name'];
                    $this->getTreeList2($table, $values, $row['id']);
                }
            }
        }
        A::$DB->free();
    }
}
A::$REQUEST = new categories_BlockRequest();
Example #5
0
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    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 getCategories($section, &$values, $id, $owner = "")
    {
        A::$DB->query("SELECT * FROM {$section}_categories WHERE idker={$id} ORDER BY sort");
        if (A::$DB->numRows()) {
            if (!empty($owner)) {
                $owner .= " > ";
            }
            while ($row = A::$DB->fetchRow()) {
                $values[$row['id']] = $owner . $row['name'];
                $this->getCategories($section, $values, $row['id'], $owner . $row['name']);
            }
        }
        A::$DB->free();
    }
}
A::$REQUEST = new shoplite_items_BlockRequest();
Example #6
0
        $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 setCategorySort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(STRUCTURE . "_categories", array('sort' => $i++), "id=" . (int) $id);
        }
    }
    function setBannerSort()
    {
        $rows = (int) A_Session::get(STRUCTURE . "_rows", isset($_COOKIE[STRUCTURE . '_rows']) ? $_COOKIE[STRUCTURE . '_rows'] : 10);
        $page = !empty($_POST['page']) ? (int) $_POST['page'] : 0;
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = $rows * $page + 1;
        foreach ($sort as $id) {
            A::$DB->Update(STRUCTURE, array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new Banners_Request();
Example #7
0
    function getAddForm()
    {
        $form = new A_Form("plugin_courier_add.tpl");
        $form->data['data'] = array_pad(array(), 6, array());
        if ($section = getSectionByModule('shoplite')) {
            $form->data['valute'] = getOption($section, 'valute');
        }
        $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 setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(STRUCTURE, array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new Courier_Request();
Example #8
0
        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 saveUrl()
    {
        $data = array();
        $PURL = parse_url(trim($_POST['url']));
        if ($data['url'] = urldecode($PURL['path'])) {
            $data['title'] = strip_tags(trim($_POST['title']));
            $data['keywords'] = strip_tags(trim($_POST['keywords']));
            $data['description'] = strip_tags(trim($_POST['description']));
            $MURL = parse_url(trim($_POST['move']));
            $data['move'] = !empty($MURL['host']) ? "http://" . $MURL['host'] : "";
            if (!empty($MURL['path'])) {
                $data['move'] .= urldecode($MURL['path']);
            }
            $data['notfound'] = isset($_POST['notfound']) ? 'Y' : 'N';
            if ($id = A::$DB->getOne("SELECT id FROM " . STRUCTURE . " WHERE url=?", $data['url'])) {
                A::$DB->Update(STRUCTURE, $data, "id={$id}");
            } else {
                A::$DB->Insert(STRUCTURE, $data);
            }
        }
        $this->RESULT['result'] = true;
    }
}
A::$REQUEST = new Seo_Request();
Example #9
0
        $form->data['idsec'] = A::$DB->getOne("SELECT id FROM " . DOMAIN . "_sections WHERE module='search'");
        $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_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();
    }
}
A::$REQUEST = new cloud_BlockRequest();
Example #10
0
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    function Edit()
    {
        $form = new A_Form("block_albums_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);
        $this->RESULT['html'] = $form->getContent();
    }
    private function getCategories($section, &$values, $id, $owner = "")
    {
        A::$DB->query("SELECT * FROM {$section}_categories WHERE idker={$id} ORDER BY sort");
        if (A::$DB->numRows()) {
            if (!empty($owner)) {
                $owner .= " > ";
            }
            while ($row = A::$DB->fetchRow()) {
                $values[$row['id']] = $owner . $row['name'];
                $this->getCategories($section, $values, $row['id'], $owner . $row['name']);
            }
        }
        A::$DB->free();
    }
}
A::$REQUEST = new albums_BlockRequest();
Example #11
0
    {
        $form = new A_Form("module_feedback_edit.tpl");
        $form->data = A::$DB->getRowById($_POST['id'], DOMAIN . "_fields");
        $form->data['vars'] = getLists();
        $form->data['name'] = $form->data['name_' . LANG];
        $form->data['full'] = is_dir('plugins');
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Отдает форму с тестом архивного сообщения.
     */
    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 setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(DOMAIN . "_fields", array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new FeedbackModule_Request();
Example #12
0
     * Обработчик действия: Отдает список альбомов.
     */
    function getAlbums()
    {
        $section = getSectionById($_POST['idsec']);
        $idcat = !empty($_POST['idcat']) ? (int) $_POST['idcat'] : 0;
        $albums = A::$DB->getAssoc("SELECT id,name FROM {$section}_albums WHERE idcat={$idcat} ORDER BY name");
        $this->RESULT['ids'] = array();
        $this->RESULT['names'] = array();
        foreach ($albums as $id => $name) {
            $this->RESULT['ids'][] = $id;
            $this->RESULT['names'][] = $name;
        }
    }
    private function getCategories($section, &$values, $id, $owner = "")
    {
        A::$DB->query("SELECT * FROM {$section}_categories WHERE idker={$id} ORDER BY sort");
        if (A::$DB->numRows()) {
            if (!empty($owner)) {
                $owner .= " > ";
            }
            while ($row = A::$DB->fetchRow()) {
                $values[$row['id']] = $owner . $row['name'];
                $this->getCategories($section, $values, $row['id'], $owner . $row['name']);
            }
        }
        A::$DB->free();
    }
}
A::$REQUEST = new gallery_BlockRequest();
Example #13
0
    {
        switch ($action) {
            case "add":
                $this->Add();
                break;
            case "edit":
                $this->Edit();
                break;
        }
    }
    /**
     * Обработчик действия: Отдает форму добавления.
     */
    function Add()
    {
        $form = new A_Form("block_text_add.tpl");
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    function Edit()
    {
        $form = new A_Form("block_text_edit.tpl");
        $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks");
        $form->data = !empty($block['params']) ? unserialize($block['params']) : array();
        $this->RESULT['html'] = $form->getContent();
    }
}
A::$REQUEST = new text_BlockRequest();
Example #14
0
            case "add":
                $this->Add();
                break;
            case "edit":
                $this->Edit();
                break;
        }
    }
    /**
     * Обработчик действия: Отдает форму добавления.
     */
    function Add()
    {
        $form = new A_Form("block_shoplite_basket_add.tpl");
        $form->data['sections'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_sections WHERE module='shoplite'");
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    function Edit()
    {
        $form = new A_Form("block_shoplite_basket_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'");
        $this->RESULT['html'] = $form->getContent();
    }
}
A::$REQUEST = new shoplite_basket_BlockRequest();
Example #15
0
{
    /**
     * Маршрутизатор действий.
     */
    function Action($action)
    {
        switch ($action) {
            case "getindexform":
                $this->getIndexForm();
                break;
        }
    }
    /**
     * Обработчик действия: Отдает форму переиндексирования.
     */
    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();
    }
}
A::$REQUEST = new SearchModule_Request();
Example #16
0
                $grow[4] = $row['date'];
                $grow[5] = "&nbsp;";
                $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 setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $page = !empty($_POST['page']) ? (int) $_POST['page'] : 0;
        $rows = (int) A_Session::get(SECTION . "_rows", isset($_COOKIE[SECTION . '_rows']) ? $_COOKIE[SECTION . '_rows'] : 20);
        $i = $page * $rows + 1;
        foreach ($sort as $id) {
            A::$DB->Update(SECTION, array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new PagesModule_Request();
Example #17
0
            $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 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();
    }
}
A::$REQUEST = new listdata_BlockRequest();
Example #18
0
    function getDirs()
    {
        $dirs = array();
        $section = getSectionById($_POST['idsec']);
        $this->_getDirs($section, $dirs, 0);
        $this->RESULT['ids'] = array();
        $this->RESULT['names'] = array();
        foreach ($dirs as $id => $name) {
            $this->RESULT['ids'][] = $id;
            $this->RESULT['names'][] = $name;
        }
    }
    private function _getDirs($section, &$values, $id = 0)
    {
        A::$DB->query("SELECT * FROM {$section} WHERE idker={$id} AND type='dir' ORDER BY sort");
        while ($row = A::$DB->fetchRow()) {
            $childs = A::$DB->getOne("SELECT COUNT(*) FROM {$section} WHERE idker=" . $row['id']);
            if ($childs > 0) {
                $name = "";
                for ($i = 0; $i < $row['level']; $i++) {
                    $name .= " > ";
                }
                $values[$row['id']] = $name . $row['name'];
                $this->_getDirs($section, $values, $row['id']);
            }
        }
        A::$DB->free();
    }
}
A::$REQUEST = new pages_BlockRequest();
Example #19
0
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    function Edit()
    {
        $form = new A_Form("block_catalog_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='catalog' ORDER BY sort");
        $section = getSectionById($form->data['idsec']);
        $form->data['categories'] = array();
        $this->getCategories($section, $form->data['categories'], 0);
        $this->RESULT['html'] = $form->getContent();
    }
    private function getCategories($section, &$values, $id, $owner = "")
    {
        A::$DB->query("SELECT * FROM {$section}_categories WHERE idker={$id} ORDER BY sort");
        if (A::$DB->numRows()) {
            if (!empty($owner)) {
                $owner .= " > ";
            }
            while ($row = A::$DB->fetchRow()) {
                $values[$row['id']] = $owner . $row['name'];
                $this->getCategories($section, $values, $row['id'], $owner . $row['name']);
            }
        }
        A::$DB->free();
    }
}
A::$REQUEST = new catalog_BlockRequest();
Example #20
0
    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 getCategories()
    {
        $this->RESULT['ids'] = array();
        $this->RESULT['names'] = array();
        if ($section = getSectionById($_POST['id'])) {
            $categories = array();
            $this->getCats($section, $categories, 0);
            foreach ($categories as $id => $name) {
                $this->RESULT['ids'][] = $id;
                $this->RESULT['names'][] = $name;
            }
        }
    }
}
A::$REQUEST = new RSS_Request();
Example #21
0
        $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 setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(STRUCTURE, array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new FCategory_Request();
Example #22
0
    {
        $form = new A_Form("module_shoplite_import.tpl");
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Сортировка столбцов.
     */
    function setImportSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(SECTION . "_cols", array('sort' => $i++), "id=" . (int) $id);
        }
    }
    function applyItem()
    {
        $this->RESULT['result'] = false;
        $row = A::$DB->getRowById($_REQUEST['id'], SECTION . "_catalog");
        if (!$row) {
            return false;
        }
        require_once "modules/shoplite/admin/shoplite.php";
        if (ShopLiteModule_Admin::EditItem()) {
            $this->RESULT['date'] = date("d.m.Y H:i", $_REQUEST['date']);
            $this->RESULT['result'] = true;
        }
    }
}
A::$REQUEST = new ShopLiteModule_Request();
Example #23
0
        }
        $form->fieldseditor_addprepare();
        $this->RESULT['html'] = $form->getContent();
    }
    function getEditForm()
    {
        $form = new A_Form("plugin_listdata_edit.tpl");
        $form->data = A::$DB->getRowById($_POST['id'], STRUCTURE);
        $form->data['languages'] = array();
        foreach (A::$LANGUAGES as $key => $name) {
            $form->data['languages'][] = array("field" => "name_{$key}", "caption" => $name, "value" => $form->data['name_' . $key]);
        }
        $form->fieldseditor_editprepare();
        $this->RESULT['html'] = $form->getContent();
    }
    function getImportForm()
    {
        $form = new A_Form("plugin_listdata_import.tpl");
        $this->RESULT['html'] = $form->getContent();
    }
    function setSort()
    {
        $sort = !empty($_POST['sort']) ? explode(",", $_POST['sort']) : array();
        $i = 1;
        foreach ($sort as $id) {
            A::$DB->Update(STRUCTURE, array('sort' => $i++), "id=" . (int) $id);
        }
    }
}
A::$REQUEST = new ListData_Request();
Example #24
0
            case "add":
                $this->Add();
                break;
            case "edit":
                $this->Edit();
                break;
        }
    }
    /**
     * Обработчик действия: Отдает форму добавления.
     */
    function Add()
    {
        $form = new A_Form("block_search_add.tpl");
        $form->data['idsec'] = A::$DB->getOne("SELECT id FROM " . DOMAIN . "_sections WHERE module='search'");
        $this->RESULT['html'] = $form->getContent();
    }
    /**
     * Обработчик действия: Отдает форму редактирования.
     */
    function Edit()
    {
        $form = new A_Form("block_search_edit.tpl");
        $block = A::$DB->getRowById($_POST['id'], DOMAIN . "_blocks");
        $form->data = !empty($block['params']) ? unserialize($block['params']) : array();
        $form->data['idsec'] = A::$DB->getOne("SELECT id FROM " . DOMAIN . "_sections WHERE module='search'");
        $this->RESULT['html'] = $form->getContent();
    }
}
A::$REQUEST = new search_BlockRequest();
Example #25
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();
    }
    private function getCategories()
    {
        $structure = getStructureById($_POST['idstr']);
        $categories = A::$DB->getAssoc("SELECT id,name FROM {$structure}_categories ORDER BY sort");
        $this->RESULT['ids'] = array();
        $this->RESULT['names'] = array();
        foreach ($categories as $id => $name) {
            $this->RESULT['ids'][] = $id;
            $this->RESULT['names'][] = $name;
        }
    }
}
A::$REQUEST = new banner_BlockRequest();
Example #26
0
            case "add":
                $this->Add();
                break;
            case "edit":
                $this->Edit();
                break;
        }
    }
    /**
     * Обработчик действия: Отдает форму добавления.
     */
    function Add()
    {
        $form = new A_Form("block_archive_add.tpl");
        $form->data['sections'] = A::$DB->getAssoc("SELECT id,caption FROM " . DOMAIN . "_sections WHERE module='archive'");
        $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();
    }
}
A::$REQUEST = new archive_BlockRequest();
Example #27
0
                    }
                    $link .= $srow['name'] != A::$OPTIONS['mainsection'] ? $srow['urlname'] . '/' : '';
                    if ($row['type'] == 'page') {
                        if ($row['urlname'] == 'index') {
                            $links[$link] = '* ' . $row['name'];
                        } else {
                            $links[$link . $row['urlname'] . '.html'] = '* ' . $row['name'];
                        }
                    } else {
                        $links[$link . $row['urlname'] . '/'] = '* ' . $row['name'];
                    }
                }
                A::$DB->free();
            }
        }
        A::$DB->query("SELECT * FROM " . DOMAIN . "_sections WHERE module<>'users' AND module<>'voting' ORDER BY sort");
        while ($row = A::$DB->fetchRow()) {
            if ($row['name'] != A::$OPTIONS['mainsection']) {
                $link = '/';
                if ($row['lang'] != DEFAULTLANG) {
                    $link .= $row['lang'] != 'all' ? $row['lang'] . '/' : (A::$LANG != DEFAULTLANG ? A::$LANG . '/' : '');
                }
                $links[$link . $row['urlname'] . '/'] = '# ' . $row['caption'];
            }
        }
        A::$DB->free();
        return $links;
    }
}
A::$REQUEST = new links_BlockRequest();
Example #28
0
    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 applyItem()
    {
        $this->RESULT['result'] = false;
        $row = A::$DB->getRowById($_REQUEST['id'], SECTION . "_catalog");
        if (!$row) {
            return false;
        }
        require_once "modules/catalog/admin/catalog.php";
        if (CatalogModule_Admin::EditItem()) {
            $this->RESULT['date'] = date("d.m.Y H:i", $_REQUEST['mdate']);
            $this->RESULT['result'] = true;
        }
    }
}
A::$REQUEST = new CatalogModule_Request();