本文整理汇总了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);
}
示例2: _formFooter
function _formFooter()
{
$renderer =& AMP_get_renderer();
$current_section_edit_link = false;
$current_class_edit_link = false;
$base_footer = ' <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();
}
示例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'));
}
示例4: __construct
function __construct($source)
{
$this->_source =& $source;
$this->_renderer =& AMP_get_renderer();
$this->_init_attributes();
$this->_init_display_methods();
}
示例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)));
}
示例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;
}
示例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;
}
示例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();
}
示例9: __construct
function __construct($id = null)
{
$this->_header = AMP_get_header();
$this->_renderer = AMP_get_renderer();
if (!empty($id)) {
$this->identify($id);
}
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
示例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');
}
示例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(' ', $tokens);
return $fields;
}