/**
  * @see	Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // remove entries
     DynamicPageEditor::remove($this->pageID);
     $this->page->moduleManager->remove();
     // clear cache
     DynamicPageEditor::clearCache($this->pageID, $this->page->hostID);
     // page menu entry
     if ($this->page->menuItemID) {
         require_once WCF_DIR . 'lib/data/page/menu/PageMenuItemEditor.class.php';
         // create editor object
         $menuItem = new PageMenuItemEditor($this->page->menuItemID);
         // remove item
         $menuItem->remove();
         // clear cache
         PageMenuItemEditor::clearCache();
     }
     // send redirect headers
     if (!isset($_REQUEST['ajax'])) {
         HeaderUtil::redirect('index.php?page=DynamicPageList&hostID=' . $this->page->hostID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     }
     // call event
     $this->executed();
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permissions
     WCF::getUser()->checkPermission('admin.pageMenu.canEditPageMenuItem');
     // update
     $this->pageMenuItem->enable($this->enable);
     // delete cache
     PageMenuItemEditor::clearCache();
     $this->executed();
     // forward to list page
     header('Location: index.php?page=PageMenuItemList&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * saves the selected permissions
  */
 protected function saved()
 {
     $sql = "UPDATE \twcf" . WCF_N . "_page_menu_item\n\t\t\tSET\tpermissions = '" . escapeString(implode(',', $this->selectedPermissions)) . "'\n\t\t\tWHERE\tmenuItemID = " . $this->eventObj->pageMenuItem->menuItemID;
     WCF::getDB()->sendQuery($sql);
     // clear cache
     PageMenuItemEditor::clearCache();
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     AbstractForm::save();
     // update
     $this->pageMenuItem->update($this->name, $this->link, $this->iconS, $this->iconM, $this->showOrder, $this->position, $this->languageID);
     // delete Cache
     PageMenuItemEditor::clearCache();
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Action::execute();
  */
 public function execute()
 {
     parent::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.pageMenu.canEditPageMenuItem');
     // get menu item
     $menuItem = new PageMenuItemEditor($this->menuItemID);
     if (!$menuItem->menuItemID) {
         throw new IllegalLinkException();
     }
     // check menu item title
     if (StringUtil::encodeHTML($menuItem->menuItem) != WCF::getLanguage()->get(StringUtil::encodeHTML($menuItem->menuItem))) {
         // change language variable
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         $language = new LanguageEditor(WCF::getLanguage()->getLanguageID());
         $language->updateItems(array($menuItem->menuItem => $this->title), 0, PACKAGE_ID, array($menuItem->menuItem => 1));
     } else {
         $menuItem->update($this->title, $menuItem->link, $menuItem->iconS, $menuItem->iconM, $menuItem->showOrder, $menuItem->position, $menuItem->languageID);
     }
     // reset cache
     WCF::getCache()->clearResource('menu-' . PACKAGE_ID);
     $this->executed();
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permissions
     WCF::getUser()->checkPermission('admin.pageMenu.canEditPageMenuItem');
     // update positions
     foreach ($this->headerPositions as $menuItemID => $showOrder) {
         PageMenuItemEditor::updateShowOrder(intval($menuItemID), 'header', $showOrder);
     }
     foreach ($this->footerPositions as $menuItemID => $showOrder) {
         PageMenuItemEditor::updateShowOrder(intval($menuItemID), 'footer', $showOrder);
     }
     // delete cache
     PageMenuItemEditor::clearCache();
     $this->executed();
     // forward to list page
     header('Location: index.php?page=PageMenuItemList&successfullSorting=1&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see	Form::save()
  */
 public function save()
 {
     parent::save();
     $menuItemID = 0;
     // create dynamic page
     $item = DynamicPageEditor::create($this->title, $this->allowSpidersToIndexThisPage, $this->additionalHeadContent, $menuItemID, $this->isPublic, $this->isDefaultPage, $this->hostID);
     DynamicPageEditor::clearCache($item->pageID, $this->hostID);
     // create menu item
     if ($this->createMenuItem) {
         require_once WCF_DIR . 'lib/data/page/menu/PageMenuItemEditor.class.php';
         // build language var
         $lang = 'wcf.header.menu.host' . $this->hostID . '.page' . $item->pageID;
         $title = empty($this->menuItemTitle) ? $this->title : $this->menuItemTitle;
         // create menu item
         $menuItem = PageMenuItemEditor::create($lang, 'index.php?page=CMS&pageID=' . $item->pageID, $this->menuItemIconS, $this->menuItemIconM, $this->menuItemSortOrder, $this->menuItemPosition);
         $menuItemID = $menuItem->menuItemID;
         // clear cache
         PageMenuItemEditor::clearCache();
         // enable or disable entry
         $menuItem->enable($this->isPublic);
         // create language var
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         // save language variable
         $language = new LanguageEditor($this->host->languageID);
         $language->updateItems(array($lang => $title));
         // include host
         require_once WCF_DIR . 'lib/data/host/Host.class.php';
         // remove menu item ID cache
         Host::removeMenuItemIDCache();
     }
     // update menu item id
     $item->menuItemID = $menuItemID;
     $item->update();
     // write to property
     $this->newPage = $item;
     // send redirect headers
     HeaderUtil::redirect('index.php?form=DynamicPageEdit&pageID=' . $item->pageID . '&packageID=' . PACKAGE_ID . '&created=1' . SID_ARG_2ND_NOT_ENCODED);
     // call event
     $this->saved();
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     ACPForm::save();
     // read variables
     $this->page->title = $this->title;
     $this->page->allowSpidersToIndexThisPage = $this->allowSpidersToIndexThisPage;
     $this->page->additionalHeadContent = $this->additionalHeadContent;
     $this->page->isPublic = $this->isPublic;
     $this->page->isDefaultPage = $this->isDefaultPage;
     // update
     $this->page->update();
     // handle isDefaultPage checkbox
     if ($this->isDefaultPage) {
         $sql = "UPDATE\r\n\t\t\t\t\t\twcf" . WCF_N . "_page\r\n\t\t\t\t\tSET\r\n\t\t\t\t\t\tisDefaultPage = 0\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tpageID NOT IN (" . $this->page->pageID . ")";
         WCF::getDB()->sendQuery($sql);
     }
     DynamicPageEditor::clearCache($this->page->pageID, $this->page->hostID);
     if ($this->menuEntry !== null) {
         // create language variable name
         $lang = 'wcf.header.menu.host' . $this->page->hostID . '.page' . $this->pageID;
         // get menu entry title
         $title = empty($this->menuItemTitle) ? $this->title : $this->menuItemTitle;
         // update menu entry
         $this->menuEntry->update($lang, $this->menuEntry->menuItemLink, $this->menuItemIconS, $this->menuItemIconM, $this->menuItemSortOrder, $this->menuItemPosition);
         // enable or disable entry
         $this->menuEntry->enable($this->isPublic);
         // update language
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         $language = new LanguageEditor(WCF::getLanguage()->getLanguageID());
         $language->updateItems(array($lang => $title));
         // clear cache
         PageMenuItemEditor::clearCache();
     }
     if ($this->createMenuItem) {
         // build language var
         $lang = 'wcf.header.menu.host' . $this->page->hostID . '.page' . $item->pageID;
         $title = empty($this->menuItemTitle) ? $this->title : $this->menuItemTitle;
         // create menu item
         $menuItem = PageMenuItemEditor::create($lang, 'index.php?page=CMS&pageID=' . $this->pageID, $this->menuItemIconS, $this->menuItemIconM, $this->menuItemSortOrder, $this->menuItemPosition);
         $menuItemID = $menuItem->menuItemID;
         // clear cache
         PageMenuItemEditor::clearCache();
         // create language var
         require_once WCF_DIR . 'lib/system/language/LanguageEditor.class.php';
         // save language variable
         $language = new LanguageEditor(WCF::getLanguage()->getLanguageID());
         $language->updateItems(array($lang => $title));
         // include host
         require_once WCF_DIR . 'lib/data/host/Host.class.php';
         // remove menu item ID cache
         Host::removeMenuItemIDCache();
     }
     // show success message
     WCF::getTPL()->assign('success', true);
 }
 /**
  * @see Form::save()
  */
 public function save()
 {
     parent::save();
     $this->pageMenuItem = PageMenuItemEditor::create($this->name, $this->link, $this->iconS, $this->iconM, $this->showOrder, $this->position, WCF::getLanguage()->getLanguageID());
     // reset values
     $this->name = $this->link = $this->iconS = $this->iconM = '';
     $this->position = 'header';
     $this->showOrder = 0;
     // delete cache
     PageMenuItemEditor::clearCache();
     $this->saved();
     // show success message
     WCF::getTPL()->assign('success', true);
 }