<?php

$Pages = new PerchContent_Pages();
$Regions = new PerchContent_Regions();
$Page = false;
$NavGroups = new PerchContent_NavGroups();
$PageTemplates = new PerchContent_PageTemplates();
if (PERCH_RUNWAY) {
    $PageRoutes = new PerchPageRoutes();
    $Collections = new PerchContent_Collections();
}
// Find the page
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $id = (int) $_GET['id'];
    $Page = $Pages->find($id);
}
// Check we have a page
if (!$Page || !is_object($Page)) {
    PerchUtil::redirect(PERCH_LOGINPATH . '/core/apps/content/');
}
// Check permissions
if (!$CurrentUser->has_priv('content.pages.edit')) {
    PerchUtil::redirect(PERCH_LOGINPATH . '/core/apps/content/');
}
$ParentPage = $Pages->find($Page->pageParentID());
$Form = new PerchForm('editpage');
$req = array();
$req['pagePath'] = "Required";
$Form->set_required($req);
if ($Form->posted() && $Form->validate()) {
    $postvars = array('pagePath', 'pageSubpagePath', 'pageHidden', 'pageAccessTags', 'pageAttributeTemplate');
 public function get_index($raw = false)
 {
     if ($raw === false) {
         $raw = $this->get_raw();
     }
     $id = $this->Tag->id();
     $out = array();
     if (is_array($raw)) {
         $Collections = new PerchContent_Collections();
         $out = $Collections->get_indexed_from_ids($this->Tag->collection(), $raw, $id);
     }
     return $out;
 }
示例#3
0
<?php

$Pages = new PerchContent_Pages();
$Regions = new PerchContent_Regions();
$Page = false;
$collections = false;
// Find the page
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $id = (int) $_GET['id'];
    if ($id == -1) {
        $Page = $Pages->get_mock_shared_page();
    } else {
        $Page = $Pages->find($id);
    }
}
// Check we have a page
if (!$Page || !is_object($Page)) {
    PerchUtil::redirect(PERCH_LOGINPATH . '/core/apps/content/');
}
if (PERCH_RUNWAY) {
    $Collections = new PerchContent_Collections();
    if ($Page->pageCollections()) {
        $collections = $Collections->get_by_id_string($Page->pageCollections());
    }
}
if ($Page->pagePath() == '*') {
    $regions = $Regions->get_shared();
} else {
    $regions = $Regions->get_for_page($Page->id(), $include_shared = false);
}