當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AMP_get_renderer函數代碼示例

本文整理匯總了PHP中AMP_get_renderer函數的典型用法代碼示例。如果您正苦於以下問題:PHP AMP_get_renderer函數的具體用法?PHP AMP_get_renderer怎麽用?PHP AMP_get_renderer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AMP_get_renderer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: nav_articles_by_date

function nav_articles_by_date()
{
    $page =& AMPContent_Page::instance();
    if ($class = $page->getClassId()) {
        $date_values = AMP_lookup('classArticlesByDate', $class);
    } else {
        $date_values = AMP_lookup('articlesByDate');
    }
    if (!$date_values) {
        return false;
    }
    $output = array();
    $renderer = AMP_get_renderer();
    foreach ($date_values as $pretty_date => $qty) {
        $real_date = strtotime($pretty_date);
        $url['year'] = date('Y', $real_date);
        $url['month'] = date('m', $real_date);
        $url['offset'] = false;
        $url['qty'] = false;
        $new_url = AMP_url_update($_SERVER['REQUEST_URI'], $url);
        $output[] = $renderer->link($new_url, $pretty_date, array('class' => AMP_CONTENT_CSS_CLASS_NAV_LINK));
        if (count($output) == AMP_CONTENT_NAV_ARCHIVE_LIMIT) {
            break;
        }
    }
    return join($renderer->newline(), $output);
}
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:27,代碼來源:nav.articlesbydate.php

示例2: _formFooter

 function _formFooter()
 {
     $renderer =& AMP_get_renderer();
     $current_section_edit_link = false;
     $current_class_edit_link = false;
     $base_footer = '&nbsp;&nbsp;<a href="' . AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('nosearch=1')) . '" class="standout">' . sprintf(AMP_TEXT_VIEW_ALL, AMP_pluralize(ucfirst(AMP_TEXT_ARTICLE))) . '</a>';
     //sectional edit link
     $current_section = isset($_REQUEST['section']) && $_REQUEST['section'] ? $_REQUEST['section'] : false;
     if (!$current_section) {
         $current_section = isset($_REQUEST['type']) && $_REQUEST['type'] ? $_REQUEST['type'] : false;
     }
     if ($current_section) {
         $section_names = AMPContent_Lookup::instance('sections');
         $section_name = isset($section_names[$current_section]) ? $section_names[$current_section] : false;
         $current_section_edit_link = $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_SECTION, array('id=' . $current_section)), $renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => 0)) . $renderer->space() . AMP_TEXT_EDIT . $renderer->space() . AMP_TEXT_SECTION . $renderer->space() . AMP_trimText($section_name, 20, false));
     }
     //class edit link
     $current_class = isset($_REQUEST['class']) && $_REQUEST['class'] ? $_REQUEST['class'] : false;
     if ($current_class) {
         $class_names = AMPContent_Lookup::instance('classes');
         $class_name = isset($class_names[$current_class]) ? $class_names[$current_class] : false;
         $current_class_edit_link = $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_CLASS, array('id=' . $current_class)), $renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => 0)) . $renderer->space() . AMP_TEXT_EDIT . $renderer->space() . AMP_TEXT_CLASS . $renderer->space() . AMP_trimText($class_name, 20, false));
     }
     return $base_footer . $current_section_edit_link . $current_class_edit_link . $renderer->newline();
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:25,代碼來源:Form.inc.php

示例3: amp_badge_tag_cloud

function amp_badge_tag_cloud($options = array())
{
    $qty_set = isset($options['qty_set']) && $options['qty_set'] ? $options['qty_set'] : false;
    if (!$qty_set && !isset($options['section'])) {
        $qty_set = AMP_lookup('tag_totals_articles_by_section_live', AMP_current_section_id());
    }
    if (!$qty_set && !$options['section']) {
        $qty_set = AMP_lookup('tag_totals_articles_live');
    }
    if (!$qty_set && $options['section']) {
        $qty_set = AMP_lookup('tag_totals_articles_by_section_live', $options['section']);
    }
    if (!$qty_set) {
        return false;
    }
    $display_url = isset($options['display_url']) && $options['display_url'] ? $options['display_url'] : false;
    $source_item = new AMP_Content_Tag(AMP_Registry::getDbcon());
    $source = $source_item->find(array('displayable' => 1));
    if (!$source) {
        return false;
    }
    $display = new AMP_Display_Cloud($source, $qty_set);
    if ($display_url) {
        $display->set_url_method($display_url);
    }
    $renderer = AMP_get_renderer();
    return $renderer->div($display->execute(), array('class' => 'tagcloud_badge'));
}
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:28,代碼來源:Tagcloud.php

示例4: __construct

 function __construct($source)
 {
     $this->_source =& $source;
     $this->_renderer =& AMP_get_renderer();
     $this->_init_attributes();
     $this->_init_display_methods();
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:7,代碼來源:Detail.php

示例5: render_nav_block

 function render_nav_block($content, $position)
 {
     $nav_blocks = AMP_lookup('navBlocks');
     $nav_key = array_search(strtolower($position), $nav_blocks);
     $renderer = AMP_get_renderer();
     return $renderer->div($content, array('class' => AMP_CONTENT_CSS_CLASS_NAV_BLOCK, 'id' => sprintf(AMP_CONTENT_CSS_ID_NAV_BLOCK, $nav_key)));
 }
開發者ID:radicalsuz,項目名稱:amp,代碼行數:7,代碼來源:Manager.inc.php

示例6: make_fields

 function make_fields($values, $prefix = '')
 {
     $renderer = AMP_get_renderer();
     $fields = array();
     foreach ($values as $label => $value) {
         $current_label = $prefix ? $prefix . '_' . $label : $label;
         $current_label = str_replace(' ', '_', $current_label);
         if (is_array($value)) {
             $fields[$current_label] = $this->field_header;
             $fields[$current_label]['label'] = AMP_pluralize(ucwords(str_replace('_', ' ', $current_label)));
             $sub_fields = $this->make_fields($value, $current_label);
             $fields = $fields + $sub_fields;
             continue;
         }
         $base_field = $this->field_standard;
         if (is_numeric($value) and !is_bool($value)) {
             $base_field = $this->field_numeric;
         }
         if (is_bool($value)) {
             $base_field = $this->field_boolean;
         }
         if (isset($this->_config_text[$label])) {
             $fields[$current_label . '__comment'] = array('type' => 'static', 'default' => $renderer->div($this->_config_text[$label], array('class' => 'config_comment')));
         }
         $fields[$current_label] = $base_field;
         $fields[$current_label]['label'] = ucwords(str_replace('_', ' ', $label)) . $renderer->newline() . $renderer->span('amp_' . $current_label, array('class' => 'photocaption'));
         $fields[$current_label]['default'] = $value;
     }
     return $fields;
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:30,代碼來源:Form.php

示例7: commit_megaupload

 function commit_megaupload()
 {
     $renderer = AMP_get_renderer();
     $buffer = new AMP_Content_Buffer();
     $buffer->add($renderer->newline(2) . $renderer->link("javascript:showPopup( '" . AMP_url_add_vars("file_uploader.php", array('doctype=img')) . "' );", AMP_TEXT_UPLOAD . $renderer->space() . AMP_TEXT_FILE) . $renderer->newline(2));
     $this->_display->add($buffer);
     return true;
 }
開發者ID:radicalsuz,項目名稱:amp,代碼行數:8,代碼來源:Controller.php

示例8: renderTrash

 function renderTrash(&$toolbar)
 {
     $renderer =& AMP_get_renderer();
     $tool_name = $toolbar->submitGroup . '[trash]';
     $label = AMP_TEXT_TRASH;
     $attr['onclick'] = 'return confirmSubmit( "' . AMP_TEXT_LIST_CONFIRM_DELETE_SECTIONS . AMP_TEXT_LIST_CONFIRM_DELETE . '");';
     return $renderer->submit($tool_name, $label, $attr) . $renderer->space();
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:8,代碼來源:List.inc.php

示例9: __construct

 function __construct($id = null)
 {
     $this->_header = AMP_get_header();
     $this->_renderer = AMP_get_renderer();
     if (!empty($id)) {
         $this->identify($id);
     }
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:8,代碼來源:Wysiwyg.php

示例10: _signupLink

 function _signupLink(&$source, $fieldname = null)
 {
     $form_id = $source->getFormId();
     if (!$form_id) {
         return false;
     }
     $renderer =& AMP_get_renderer();
     return $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_FORM_DATA, array('modin' => 'modin=' . $form_id)), AMP_TEXT_PETITION_SIGNERS);
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:9,代碼來源:List.inc.php

示例11: init

 function init(&$nav)
 {
     $this->nav =& $nav;
     $this->position = $this->nav->position;
     $this->order = $this->nav->order;
     $this->_template =& $nav->template;
     $this->setCssClass($nav->getCssClass());
     $this->_renderer = AMP_get_renderer();
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:9,代碼來源:Display.inc.php

示例12: __construct

 function __construct($source = false, $criteria = array(), $limit = null)
 {
     $this->_init_pager($limit);
     $this->_init_source($source, $criteria);
     $this->_init_translations();
     $this->_init_identity();
     $this->_init_tools();
     $this->_renderer = AMP_get_renderer();
     $this->_after_init();
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:10,代碼來源:List.php

示例13: renderCopy

 function renderCopy(&$toolbar)
 {
     $renderer = AMP_get_renderer();
     $class_options = AMP_base_select_options(AMP_lookup('classes'), 'Select Class');
     $publicpage_options = AMP_base_select_options(AMP_lookup('introtexts'), 'Select Public Page');
     $section_options_content = AMP_base_select_options(AMP_lookup('sectionMap'), 'Select Section ( ' . AMP_TEXT_CONTENT_PAGES . ' )');
     $section_options_list = AMP_base_select_options(AMP_lookup('sectionMap'), 'Select Section ( ' . AMP_TEXT_LIST_PAGES . ' )');
     $copy_selects = array(AMP_TEXT_LIST_NAV_LAYOUT_TARGET_COPY, $renderer->newline(), AMP_buildSelect('section_id_content', $section_options_content, null, $renderer->makeAttributes(array('class' => 'searchform_element'))), AMP_buildSelect('section_id_list', $section_options_list, null, $renderer->makeAttributes(array('class' => 'searchform_element'))), $renderer->newline(), AMP_buildSelect('class_id', $class_options, null, $renderer->makeAttributes(array('class' => 'searchform_element'))), AMP_buildSelect('publicpage_id', $publicpage_options, null, $renderer->makeAttributes(array('class' => 'searchform_element'))), $renderer->newline());
     return $toolbar->addTab('copy', $copy_selects);
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:10,代碼來源:List.inc.php

示例14: _makeOwnerLink

 function _makeOwnerLink($data, $fieldname)
 {
     if (!(isset($data['uid']) && $data['uid'])) {
         return;
     }
     $renderer = AMP_get_renderer();
     $owner_field = $this->_owner_link_def;
     $owner_field['default'] = $renderer->link(AMP_url_add_vars(AMP_SYSTEM_URL_FORM_ENTRY, array('id=' . $data['uid'])), $owner_field['default']);
     $this->addField($owner_field, 'owner_link');
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:10,代碼來源:Form.inc.php

示例15: adjustFields

 function adjustFields($fields)
 {
     $blocks = filterConstants('AMP_CONTENT_NAV_BLOCK');
     $tokens = array(AMP_CONTENT_TEMPLATE_TOKEN_BODY);
     $renderer = AMP_get_renderer();
     foreach ($blocks as $block_name => $db_token) {
         $tokens[] = sprintf(AMP_CONTENT_TEMPLATE_TOKEN_STANDARD, strtolower($block_name));
     }
     $fields['template_header2']['default'] = AMP_TEXT_TEMPLATE_ADD_TOKENS . $renderer->newline() . join('&nbsp; ', $tokens);
     return $fields;
 }
開發者ID:radicaldesigns,項目名稱:amp,代碼行數:11,代碼來源:Form.inc.php


注:本文中的AMP_get_renderer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。