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()); }
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); }
* Check if specified article is a section header and redirect to that section */ if (AMP_CONTENT_REDIRECT_SECTIONHEADERS_TO_SECTIONS && $currentArticle->getClass() == AMP_CONTENT_CLASS_SECTIONHEADER) { if ($currentSection->hasData()) { //drop article id, keep preview or other url vars $new_params = $_GET; unset($new_params['id']); ampredirect(AMP_url_update($currentSection->getURL(), $new_params)); } } } /** * Check Section List pages for a redirect in the SectionHeader */ if ($currentPage->isList(AMP_CONTENT_LISTTYPE_SECTION) && ($currentSection =& $currentPage->getSection())) { if (!AmpUtility::display_okay($currentSection)) { AMP_make_404(); } if ($target = $currentSection->getHeaderRedirect()) { ampredirect($target); } } /** * Check if a section was specified for class lists */ if ($currentPage->isList(AMP_CONTENT_LISTTYPE_CLASS) && isset($_GET['type']) && ($currentSection =& $currentPage->getSection()) && ($currentClass =& $currentPage->getClass())) { $currentClass->addContentsCriteriaSection($currentSection->id); } /** * Get Listing Display */