Exemplo n.º 1
0
 /**
  * Saves the page selection
  */
 protected function OnSuccess()
 {
     $allParams = array();
     foreach ($this->oblParams as $param) {
         $allParams[$param] = $this->Value($param);
     }
     $optParams = $this->serializer->LinesToArray($this->Value('OptionalParameters'));
     foreach ($optParams as $name => $value) {
         if (!isset($allParams[$name])) {
             $allParams[$name] = $value;
         }
     }
     $this->SetJSFieldValue('#' . $this->prefix . 'Params', $this->serializer->ArrayToLines($allParams));
     $this->SetJSFieldValue('#' . $this->prefix . 'Page', $this->page->GetID());
     $this->SetJSFieldValue('#' . $this->prefix . 'Fragment', $this->Value('Fragment'));
     $this->SetJSHtml('#' . $this->prefix . 'Url', FrontendRouter::PageUrl($this->page, $allParams, $this->Value('Fragment')));
     $this->CloseModal();
 }
Exemplo n.º 2
0
 /**
  * Adds a single page to the sitemap
  * @param Page $page The page
  */
 private function AddPage(Page $page)
 {
     if (!$this->PageAllowed($page)) {
         return;
     }
     $params = FrontendRouter::GatherParams($page->GetUrl());
     if (count($params) == 0) {
         $changeFreq = ChangeFrequency::ByValue($page->GetSitemapChangeFrequency());
         $priority = $page->GetSitemapRelevance();
         $lastLog = LogEvaluator::LastPageModLog($page, $this->resolver);
         $lastMod = $lastLog ? $lastLog->GetChanged() : null;
         $this->sitemap->AddUrl(FrontendRouter::PageUrl($page), $changeFreq, $priority, $lastMod);
     }
 }
Exemplo n.º 3
0
 private function ReplacePageUrl(Page $page, Token $token, $startPos, &$endPos)
 {
     $params = $token->PropertyParams;
     if ($page->Equals(PageRenderer::Page())) {
         //merge current GET parameters on current page
         $params = array_merge(Request::GetArray(), $params);
     }
     $url = FrontendRouter::PageUrl($page, $params);
     $this->InsertValue($url, $token, $startPos, $endPos);
 }