Esempio n. 1
0
 function show()
 {
     $this->_before('show');
     $section = $this->current_object =& new Section(AMP_dbcon(), $this->params['id']);
     if (!($section && $section->hasData() && ($section->isDisplayable() || AMP_Authenticate('admin')))) {
         return AMP_make_404();
     }
     $display =& $section->getDisplay();
     $this->_render_section_header($display);
     $this->render($display);
 }
Esempio n. 2
0
 function commit_detail()
 {
     $source =& $this->_load('source');
     if (!$source->read($this->_model_id) || !$source->isLive()) {
         AMP_make_404();
         return false;
     }
     $detail_display =& $this->_load('detail', $source);
     $this->_display->add($detail_display);
     $this->_publicpage_request = $this->_publicpage_detail;
     $this->_set_location();
     return true;
 }
Esempio n. 3
0
 function show()
 {
     $this->_before('show');
     $article = $this->current_object = new Article(AMP_dbcon(), $this->params['id']);
     //section headers redirect to sections
     if ($article && $article->hasData() && $article->getData('class') == AMP_CONTENT_CLASS_SECTIONHEADER) {
         return ampredirect(AMP_route_for('section', $article->getParent()));
     }
     if (!($article && AmpUtility::display_okay($article))) {
         return AMP_make_404();
     }
     $this->render($article->getDisplay());
 }
Esempio n. 4
0
 function show()
 {
     $this->_before('show');
     $section = $this->current_object = new Section(AMP_dbcon(), $this->params['id']);
     if (!($section && AmpUtility::display_okay($section))) {
         return AMP_make_404();
     }
     if ($target = $section->getHeaderRedirect()) {
         ampredirect($target);
     }
     $display =& $section->getDisplay();
     $this->_render_section_header($display);
     $this->render($display);
 }
Esempio n. 5
0
        if (isset($display->api_version) && $display->api_version == 2) {
            if (!isset($display->pager) || $display->pager->is_first_page()) {
                if (method_exists($display, 'render_intro')) {
                    require_once 'AMP/Content/Buffer.php';
                    $intro = new AMP_Content_Buffer();
                    $intro->add($display->render_intro());
                } else {
                    $intro = $currentPage->getListDisplayIntro();
                }
                if ($intro) {
                    $currentPage->contentManager->add($intro, AMP_CONTENT_DISPLAY_KEY_INTRO);
                }
            }
        }
    } else {
        AMP_make_404();
    }
}
/**
 * Get Article Display 
 */
if ($currentArticle =& $currentPage->getArticle()) {
    if (isset($_GET['vid']) && $_GET['vid']) {
        $currentArticle->readVersion(intval($_GET['vid']));
    }
    $display = $currentArticle->getDisplay();
}
/**
 * Add the display to the Content Manager 
 * 
 */
Esempio n. 6
0
 /**
  * set the Article for use on the current page 
  * 
  * @param   integer   $article_id   The database id of the Article to use 
  * @access  public
  * @since   3.5.3
  * @return  void
  */
 function setArticle($article_id)
 {
     require_once 'AMP/Content/Article.inc.php';
     $article = new Article($this->dbcon, $article_id);
     if (!$article->hasData()) {
         AMP_make_404();
         return false;
     }
     //ampredirect( AMP_CONTENT_URL_SEARCH );
     if ($target = $article->getRedirect()) {
         ampredirect($target);
     }
     $this->section_id = $article->getParent();
     $this->_globalizeArticleVars($article);
     $this->_globalizePageVars();
     $this->article =& $article;
 }