function _preview_url($section) { $base_url = $section->getURL_default(); if (AMP_CONTENT_HUMANIZE_URLS) { $base_url = '/' . AMP_route_for('section', $section->id); } return AMP_url_add_vars(AmpUtility::current_host() . $base_url, array('preview=1', 'cache=0')); }
function _preview_url() { if (AMP_CONTENT_HUMANIZE_URLS) { return AMP_route_for('section', $this->_section->id); } else { return AMP_URL_AddVars(AMP_SITE_URL . $this->_section->getURL_default(), array('preview=1', 'cache=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()); }
function render_preview($source) { return $this->_renderer->link(AMP_route_for('section', $source->id, array('preview' => true)), $this->_renderer->image(AMP_SYSTEM_ICON_PREVIEW, array('class' => 'icon')), array('target' => '_blank', 'title' => AMP_TEXT_PREVIEW_ITEM)); }
function getURL_default() { return AMP_route_for('section', $this->id); }
function _renderPreviewLink($article) { return $this->_renderer->link(AmpUtility::current_host() . AMP_route_for('article', $article->id, array('preview' => true)), $this->_renderer->image(AMP_SYSTEM_ICON_PREVIEW, array('width' => '16', 'height' => '16', 'border' => '0', 'align' => 'right')), array('target' => 'blank', 'title' => AMP_TEXT_PREVIEW_ITEM)); }
function _afterRead() { if (AMP_CONTENT_HUMANIZE_URLS) { $current_route = AMP_route_for('article', $this->id); if ($current_route && $current_route != $this->getURL_without_pretty_urls()) { $this->mergeData(array('route_slug' => $current_route)); } } }
function protected_content_root() { $protected = AMP_lookup('protected_sections'); $parents = AMP_lookup('section_parents'); foreach ($protected as $section_id) { $parent_id = $parents[$section_id]; if (!isset($protected[$parent_id])) { $pc_root_id = $section_id; break; } } return AMP_route_for('section', $pc_root_id); }
function _HTML_previewLink($id) { if (!isset($this->previewlink)) { return false; } return '<a href="' . AmpUtility::current_host() . AMP_route_for('article', $id, array('preview' => 1)) . '" target="_blank" title="' . AMP_TEXT_PREVIEW_ITEM . '">' . '<img src="' . AMP_SYSTEM_ICON_PREVIEW . '" width="16" height="16" border=0></a>'; }