示例#1
0
 /**
  * Access to pages cached with cacheVirtualPages and cacheVirtualPage and
  * implicitly cached by earlier slot insertions for a virtual page
  * @param string $slug
  * @return aPage
  */
 public static function getCachedPage($slug)
 {
     if (aTools::isPageCached($slug)) {
         return aTools::$globalCache[$slug];
     } else {
         return null;
     }
 }
示例#2
0
 public function getTitle()
 {
     // See if the index action has already cached the associated page
     // (This is a big speedup)
     $slug = $this->getVirtualPageSlug();
     if (aTools::isPageCached($slug)) {
         $titleSlot = aTools::getCachedPage($slug)->getSlot('title');
     } else {
         $titleSlot = $this->Page->getSlot('title');
     }
     if ($titleSlot) {
         $result = $titleSlot->value;
     } else {
         $result = $this['slug'];
     }
     $title = trim($result);
     if (!strlen($result)) {
         // Don't break the UI, return something reasonable
         $slug = $this->slug;
         $title = substr(strrchr($slug, "/"), 1);
     }
     return $title;
 }