/**
  * Clear the navigation service cache every time a message is edited
  *
  * @param string $title name of the page changed.
  * @param string $text new contents of the page
  * @return bool return true
  */
 public static function onMessageCacheReplace($title, $text)
 {
     if (NavigationModel::isWikiNavMessage(Title::newFromText($title, NS_MEDIAWIKI))) {
         $model = new NavigationModel();
         $model->clearMemc($title);
         wfDebug(__METHOD__ . ": '{$title}' cache cleared\n");
     }
     return true;
 }
 /**
  * Clear the local navigation cache every time the MediaWiki message is edited
  *
  * @param string $title name of the page changed.
  * @param string $text new contents of the page
  * @return bool return true
  */
 public static function onMessageCacheReplace($title, $text)
 {
     if (NavigationModel::isWikiNavMessage(Title::newFromText($title, NS_MEDIAWIKI))) {
         $model = new NavigationModel();
         // clear the cache of the "old" local nav logic
         // it's still used when NavigationModel::parse() is called
         $model->clearMemc($title);
         // clear the cache of the new local nav logic
         $model->clearNavigationTreeCache();
     }
     return true;
 }
 /**
  * Check if we should show mobile and desktop preview icon
  * Excluded pages:
  * - Main page
  * - Code page (CSS, JS and Lua)
  * - MediaWiki:Wiki-navigation
  *
  * @param Title $title
  * @return bool
  */
 public function showMobilePreview(Title $title)
 {
     $blacklistedPage = self::isCodePage($title) || $title->isMainPage() || NavigationModel::isWikiNavMessage($title);
     return !$blacklistedPage;
 }