/**
  * @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);
 }