Exemple #1
0
 /**
  * Returns parsed Factbox content from either the OutputPage property
  * or from the Cache
  *
  * @since 1.9
  *
  * @param OutputPage $outputPage
  *
  * @return string
  */
 public function retrieveContent(OutputPage $outputPage)
 {
     $text = '';
     $title = $outputPage->getTitle();
     if ($title instanceof Title && ($title->isSpecialPage() || !$title->exists())) {
         return $text;
     }
     if (isset($outputPage->mSMWFactboxText)) {
         $text = $outputPage->mSMWFactboxText;
     } elseif ($title instanceof Title) {
         $key = $this->cacheFactory->getFactboxCacheKey($title->getArticleID());
         $content = $this->retrieveFromCache($key);
         $text = isset($content['text']) ? $content['text'] : '';
     }
     return $text;
 }