本文整理汇总了PHP中Host::removeMenuItemIDCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Host::removeMenuItemIDCache方法的具体用法?PHP Host::removeMenuItemIDCache怎么用?PHP Host::removeMenuItemIDCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host::removeMenuItemIDCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* @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();
}
示例2: save
/**
* @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);
}