Пример #1
0
 /**
  * Adds the sitemap relevance field
  */
 private function AddSitemapRelevanceField()
 {
     $name = 'SitemapRelevance';
     $value = $this->page->Exists() ? 10 * $this->page->GetSitemapRelevance() : 7;
     $field = new Select($name, $value);
     for ($val = 0; $val <= 10; ++$val) {
         $decSep = Trans('Core.DecimalSeparator');
         $thousSep = Trans('Core.ThousandsSeparator');
         $text = number_format($val / 10, 1, $decSep, $thousSep);
         $field->AddOption($val, $text);
     }
     $this->AddField($field);
 }
Пример #2
0
 private function PageAllowed(Page $page)
 {
     if ($page->GetType() != (string) PageType::Normal() || $page->GetSitemapRelevance() == 0) {
         return false;
     }
     return $this->guard->Allow(Action::Read(), $page);
 }