예제 #1
0
 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'));
 }
예제 #2
0
파일: Info.php 프로젝트: radicaldesigns/amp
 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'));
     }
 }
예제 #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());
 }
예제 #4
0
파일: List.php 프로젝트: radicalsuz/amp
 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));
 }
예제 #5
0
 function getURL_default()
 {
     return AMP_route_for('section', $this->id);
 }
예제 #6
0
 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));
 }
예제 #7
0
 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));
         }
     }
 }
예제 #8
0
 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);
 }
예제 #9
0
 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>';
 }