/** * Обработчик действия: Отдает форму редактирования. */ 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 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; } }
/** * Обработчик действия: Отдает список альбомов. */ 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; } }
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; } } }
/** * Обработчик действия: Отдает форму редактирования. */ 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 indexAll() { @set_time_limit(0); A::$DB->caching = false; if (!empty($_REQUEST['sections'])) { foreach ($_REQUEST['sections'] as $id) { $section = getSectionById($id); $module = getModuleBySection($section); if (function_exists($module . '_searchIndexAll')) { A_SearchEngine::getInstance()->deleteSection($id); call_user_func($module . '_searchIndexAll', $section); } } } A::$CACHE->resetSection(SECTION); return true; }
function createData() { $rss = array(); A::$DB->query("\r\r\n\tSELECT r.*,s.caption AS section\r\r\n\tFROM " . STRUCTURE . " AS r\r\r\n\tLEFT JOIN " . DOMAIN . "_sections AS s ON s.id=r.idsec\r\r\n\tORDER BY r.id"); while ($row = A::$DB->fetchRow()) { if ($section = getSectionById($row['idsec'])) { $lang = getLang($section); $lang = $lang != DEFAULTLANG ? $lang . "/" : ""; $sname = getName($section); } else { $lang = $sname = ""; } $row['link'] = "http://" . DOMAINNAME . "/{$lang}getfile/" . getName(STRUCTURE) . ($sname ? "/{$sname}.rss" : "/"); if ($row['idcat'] > 0) { $row['link'] .= "?idcat=" . $row['idcat']; } $rss[] = $row; } A::$DB->free(); $this->Assign("rss", $rss); }
function rss_showpage($template) { if (A_MODE == A_MODE_FRONT) { $rss = array(); $structures = getStructuresByPlugin('rss'); foreach ($structures as $structure) { A::$DB->query("SELECT * FROM {$structure}"); while ($row = A::$DB->fetchRow()) { $section = getSectionById($row['idsec']); $lang = getLang($section); $lang = $lang != DEFAULTLANG ? $lang . "/" : ""; $link = "http://" . DOMAINNAME . "/{$lang}getfile/" . getName($structure) . "/" . getName($section) . ".rss"; if ($row['idcat'] > 0) { $link .= "?idcat=" . $row['idcat']; } $rss[] = $link; } A::$DB->free(); } A::$MAINFRAME->Assign("rss", $rss); } }
/** * Обработчик действия: Отдает список категорий имеющих подуровни. */ function getOwnerCategories() { $this->RESULT['ids'] = array(); $this->RESULT['names'] = array(); $section = getSectionById($_POST['idsec']); $tables = A::$DB->getTables(); if (in_array($section . "_categories", $tables)) { $categories = array(); $this->getTreeList2($section . "_categories", $categories, 0); foreach ($categories as $id => $name) { $this->RESULT['ids'][] = $id; $this->RESULT['names'][] = $name; } } }
?> > <?php echo getCategoryById($categoryId)["name"]; ?> <?php } ?> </p> <?php } else { ?> <p class="breadcrumb"><?php echo getLocById($locationId)["fr_name"]; ?> > <?php echo getSectionById($sectionId)["fr_name"]; ?> <?php if ($categoryId !== 'all-categories') { ?> > <?php echo getCategoryById($categoryId)["fr_name"]; ?> <?php } ?> </p> <?php } ?>
function Del() { $idsec = (int) A_Session::get(STRUCTURE, 0); if ($section = getSectionById($idsec)) { $table = $section . "_categories"; } else { return false; } $dataset = new A_DataSet(STRUCTURE); if ($row = $dataset->Delete()) { A::$DB->execute("ALTER TABLE `{$table}` DROP `{$row['field']}`"); return true; } else { return false; } }