public function template_attribute($id, $opts)
 {
     $attr_vars = PerchSystem::get_attr_vars();
     if (isset($attr_vars[$id])) {
         return $attr_vars[$id];
     }
     if ($id == 'pageTitle' || $id == 'pageNavText') {
         return $this->details[$id];
     }
     $Template = new PerchTemplate('pages/attributes/' . $opts['template'], 'pages');
     $tag = $Template->find_tag($id, false, true);
     if ($tag) {
         $Template->load($tag);
         return $Template->render($this);
     }
     if (isset($this->details[$id])) {
         return $this->details[$id];
     }
     return false;
 }
Exemplo n.º 2
0
function perch_pages_navigation_text($return = false)
{
    $attr_vars = PerchSystem::get_attr_vars();
    if (isset($attr_vars['pageNavText'])) {
        if ($return) {
            return $attr_vars['pageNavText'];
        }
        echo PerchUtil::html($attr_vars['pageNavText']);
        return;
    }
    $Page = PerchSystem::get_page_object();
    if (!$Page) {
        $Pages = new PerchContent_Pages();
        $Perch = Perch::fetch();
        $Page = $Pages->find_by_path($Perch->get_page());
        if ($Page instanceof PerchContent_Page) {
            PerchSystem::set_page_object($Page);
        }
    }
    $r = '';
    if (is_object($Page)) {
        $r = $Page->pageNavText();
    }
    if ($return) {
        return $r;
    }
    echo $r;
}