Exemple #1
0
 /**
  * Returns the item reference description.
  * @param \RainLab\Pages\Classes\SitemapItem $item Specifies the sitemap item
  * @return string 
  */
 protected function getReferenceDescription($item)
 {
     if ($this->typeListCache === false) {
         $this->typeListCache = $item->getTypeOptions();
     }
     if (!isset($this->typeInfoCache[$item->type])) {
         $this->typeInfoCache[$item->type] = SitemapItem::getTypeInfo($item->type);
     }
     if (isset($this->typeInfoCache[$item->type])) {
         $result = $this->typeListCache[$item->type];
         if ($item->type !== 'url') {
             if (isset($this->typeInfoCache[$item->type]['references'])) {
                 $result .= ': ' . $this->findReferenceName($item->reference, $this->typeInfoCache[$item->type]['references']);
             }
         } else {
             $result .= ': ' . $item->url;
         }
     } else {
         $result = trans('rainlab.sitemap::lang.item.unknown_type');
     }
     return $result;
 }
 public function onGetItemTypeInfo()
 {
     $type = Request::input('type');
     return ['sitemapItemTypeInfo' => SitemapItem::getTypeInfo($type)];
 }
Exemple #3
0
 public function afterFetch()
 {
     $this->items = DefinitionItem::initFromArray($this->data);
 }