예제 #1
0
 /**
  * Gets the first and root page of the site
  * @return Page
  */
 public function TopMost()
 {
     $sql = Access::SqlBuilder();
     $tbl = Page::Schema()->Table();
     $where = $sql->Equals($tbl->Field('Site'), $sql->Value($this->site->GetID()))->And_($sql->IsNull($tbl->Field('Parent')))->And_($sql->IsNull($tbl->Field('Previous')));
     return Page::Schema()->First($where);
 }
예제 #2
0
 protected function OpenUrl()
 {
     $args = array('pageOnly' => '1');
     if (count($this->disabledPageIDs) > 0) {
         $args['disabled'] = $this->disabledPageIDs;
     }
     if ($this->site) {
         $args['site'] = $this->site->GetID();
     }
     return BackendRouter::AjaxUrl(new AjaxSelectPage(), $args);
 }
예제 #3
0
 /**
  * The link for the back button
  * @return string Returns the url to the page tree
  */
 protected function BackLink()
 {
     $params = array('site' => $this->site->GetID());
     if ($this->page->Exists()) {
         $params['selected'] = $this->page->GetID();
     } else {
         if ($this->previous) {
             $params['selected'] = $this->previous->GetID();
         } else {
             if ($this->parent) {
                 $params['selected'] = $this->parent->GetID();
             }
         }
     }
     return BackendRouter::ModuleUrl(new PageTree(), $params);
 }
예제 #4
0
 /**
  * Finds the 404 page for a site
  * @param Site $site The site whise 404 page is searched for
  * @return Page The 404 page
  */
 static function Page404(Site $site)
 {
     $sql = Access::SqlBuilder();
     $tblPage = Page::Schema()->Table();
     $where = $sql->Equals($tblPage->Field('Type'), $sql->Value((string) PageType::NotFound()))->And_($sql->Equals($tblPage->Field('Site'), $sql->Value($site->GetID())));
     return Page::Schema()->First($where);
 }
예제 #5
0
 /**
  * Returns the page tree url of a site
  * @param Site $site The site
  * @return string The url of the page tree
  */
 protected function PageTreeUrl(Site $site)
 {
     $args = array('site' => $site->GetID());
     return BackendRouter::ModuleUrl(new PageTree(), $args);
 }
예제 #6
0
 protected function CreateFormUrl()
 {
     $module = new PageForm();
     $args = array('site' => $this->site->GetID());
     return BackendRouter::ModuleUrl($module, $args);
 }
예제 #7
0
 /**
  * The name of the cache file of the 
  * @param Site $site The site
  * @return string Returns the full file path of the sitemap cache file
  */
 static function SitemapCacheFile(Site $site)
 {
     $cacheFolder = Path::Combine(PHINE_PATH, 'Cache/Sitemap');
     $filename = Path::AddExtension($site->GetID(), 'xml');
     return Path::Combine($cacheFolder, $filename);
 }