当前位置: 首页>>代码示例>>PHP>>正文


PHP Host::removeMenuItemIDCache方法代码示例

本文整理汇总了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();
 }
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-CMS,代码行数:43,代码来源:DynamicPageAddForm.class.php

示例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);
 }
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-CMS,代码行数:58,代码来源:DynamicPageEditForm.class.php


注:本文中的Host::removeMenuItemIDCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。