示例#1
0
 /**
  * Обработчик действия: Удаление столбца в структуре импорта.
  */
 function DelCol()
 {
     $dataset = new A_DataSet(SECTION . "_cols");
     return $dataset->Delete();
 }
示例#2
0
 /**
  * Обработчик действия: Удаление записи архива.
  */
 function DelArch()
 {
     $dataset = new A_DataSet(SECTION . "_arch");
     return $dataset->Delete();
 }
示例#3
0
 function DelBanner($id = 0)
 {
     if ($id > 0) {
         $_REQUEST['id'] = $id;
     }
     $dataset = new A_DataSet(STRUCTURE);
     if ($row = $dataset->Delete()) {
         delfile($row['filepath']);
         return true;
     } else {
         return false;
     }
 }
示例#4
0
 /**
  * Обработчик действия: Изменение страницы.
  */
 function EditPage()
 {
     $row = A::$DB->getRowById($_REQUEST['id'], SECTION);
     if (!$row) {
         return false;
     }
     $_REQUEST['date'] = time();
     $_REQUEST['name'] = strip_tags($_REQUEST['name']);
     $_REQUEST['urlname'] = getUrlName($_REQUEST['name'], $_REQUEST['urlname'], SECTION, "type='page' AND idker={$row['idker']} AND id<>" . $row['id']);
     $_REQUEST['keywords'] = getkeywords($_REQUEST['content']);
     $_REQUEST['description'] = truncate($_REQUEST['content'], 350);
     $_REQUEST["template"] = preg_replace("/[^a-zA-Z0-9._-]+/i", "", $_REQUEST["template"]);
     $_REQUEST['active'] = isset($_REQUEST['active']) ? 'Y' : 'N';
     $_REQUEST['inmap'] = isset($_REQUEST['inmap']) ? 'Y' : 'N';
     $dataset = new A_DataSet(SECTION, true);
     $dataset->fields = array("date", "name", "urlname", "keywords", "description", "content", "tags", "template", "active", "inmap");
     if ($row = $dataset->Update()) {
         $name = getTreePath(SECTION, $row['level'] == 0 || $row['urlname'] != 'index' ? $row['id'] : $row['idker'], " - ");
         if ($_REQUEST['active'] == 'Y') {
             A::$OBSERVER->Event('searchIndexUpdate', SECTION, array('id' => $row['id'], 'name' => $name, 'content' => $_REQUEST['content'], 'tags' => $_REQUEST['tags']));
         } else {
             A::$OBSERVER->Event('searchIndexDelete', SECTION, array('id' => $row['id']));
         }
         if (!empty($_REQUEST["template"])) {
             copyfile("modules/pages/templates/default/pages_page.tpl", "templates/" . DOMAIN . "/" . $_REQUEST["template"]);
         }
         while ($row['idker']) {
             if ($row = A::$DB->getRowById($row['idker'], SECTION)) {
                 A::$DB->Update(SECTION, array('date' => $_REQUEST['date']), "id=" . $row['id']);
             }
         }
         return true;
     } else {
         return false;
     }
 }
示例#5
0
 function DelRSS()
 {
     $dataset = new A_DataSet(STRUCTURE);
     return $dataset->Delete();
 }
示例#6
0
 /**
  * Обработчик действия: Удаление записи.
  *
  * @param integer $id=0 Идентификатор записи.
  */
 function DelItem($id = 0)
 {
     if ($id > 0) {
         $_REQUEST['id'] = $id;
     }
     $dataset = new A_DataSet(SECTION . "_catalog", true);
     if ($row = $dataset->Delete()) {
         DelRegSectionItemImages(SECTION_ID, $row['id']);
         DelRegSectionItemFiles(SECTION_ID, $row['id']);
         A::$DB->execute("DELETE FROM " . DOMAIN . "_comments WHERE idsec=" . SECTION_ID . " AND iditem=" . $row['id']);
         A::$OBSERVER->Event('searchIndexDelete', SECTION, array('id' => $row['id']));
         if ($id == 0) {
             self::updateCategoryItems($row['idcat']);
         }
         return true;
     } else {
         return false;
     }
 }
示例#7
0
 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;
     }
 }
示例#8
0
 function Del($id = 0)
 {
     if ($id > 0) {
         $_REQUEST['id'] = $id;
     }
     if (!isset($_REQUEST['id'])) {
         return false;
     }
     $dataset = new A_DataSet(STRUCTURE);
     return $dataset->Delete();
 }