本文整理汇总了PHP中AMP_lookup函数的典型用法代码示例。如果您正苦于以下问题:PHP AMP_lookup函数的具体用法?PHP AMP_lookup怎么用?PHP AMP_lookup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AMP_lookup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_toolbar_move
function render_toolbar_move(&$toolbar)
{
$folder_options = AMP_lookup('image_folders');
$folder_options = array('' => sprintf(AMP_TEXT_SELECT, AMP_TEXT_FOLDER), DIRECTORY_SEPARATOR => "Default Folder") + $folder_options;
$panel_contents = $this->_renderer->select('folder_name', null, $folder_options, array('class' => 'searchform_element')) . $this->_renderer->space(2) . "New Folder:" . $this->_renderer->input('new_folder_name', "", array('class' => 'searchform_element'));
return $toolbar->add_panel('move', $panel_contents);
}
示例2: amp_badge_related_form
function amp_badge_related_form($data)
{
$data = array_merge($data, $_GET);
foreach ($data as $key => $value) {
if (is_array($value) && count($value) == 1) {
$quick_val = array_values($value);
$data[$key] = $quick_val[0];
}
}
$modin = isset($data['modin']) && $data['modin'] ? $data['modin'] : false;
$related_index = isset($data['related_index']) && $data['related_index'] ? $data['related_index'] : false;
if (!$modin) {
return false;
}
if (!AMP_authenticate('admin')) {
$live_forms = AMP_lookup('formsPublic');
if (!isset($live_forms[$modin])) {
return 'Please publish the related form';
}
}
require_once 'AMP/UserData.php';
$udm =& new UserData(AMP_Registry::getDbcon(), $modin);
$udm->registerPlugin('Output', 'Text');
$udm->setData($data);
$renderer = AMP_get_renderer();
# $delete_button = $renderer->form(
$delete_button = $renderer->link('#', $renderer->image(AMP_SYSTEM_ICON_DELETE, array('class' => 'icon', 'style' => 'border: 0;')), array('alt' => AMP_TEXT_DELETE_ITEM, 'title' => AMP_TEXT_DELETE_ITEM, 'onClick' => "\$('form_related_item_{$related_index}').remove( ); \$('form_{$modin}_related_custom_fields_{$related_index}').remove(); return false;"));
$content = $delete_button . $renderer->tag('pre', $udm->doPlugin('Output', 'Text'));
$result = $renderer->div($content, array('class' => 'form_related_item', 'id' => 'form_related_item_' . $related_index));
return $result;
}
示例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: onDelete
function onDelete(&$source)
{
//delete all versions
foreach (AMP_lookup('image_classes') as $current_class) {
$fullpath = AMP_image_path($source->getName(), $current_class);
if (!file_exists($fullpath)) {
continue;
}
unlink($fullpath);
}
//remove gallery records
require_once 'Modules/Gallery/Image/Set.inc.php';
$gallerySet =& new GalleryImageSet(AMP_Registry::getDbcon());
$gallerySet->deleteData($gallerySet->getCriteriaImage($source->getName()));
$this->_list->removeSourceItemId($source->getName());
//clear image folder cache
$this->_update_image_cache_delete($source->getName());
/*
$cache = &_get_cache( );
if ( $cache ) {
trigger_error( 'attempting cache delete with key ' . $source->getCacheKeySearch( ));
$cache->delete( $source->getCacheKeySearch( ) );
}
*/
}
示例5: find_calendar_id
function find_calendar_id($options)
{
//basic
if (isset($options['calid']) && $options['calid']) {
return $options['calid'];
}
//dia lookup
if (isset($options['dia_event_key']) && $options['dia_event_key']) {
$dia_calid = $this->lookup_calid_thru_dia($options['dia_event_key']);
if ($dia_calid) {
return $dia_calid;
}
}
// Check for the existence of a userid.
if (!$this->udm->uid) {
return false;
}
$user_events = AMP_lookup('eventsByOwner', $this->udm->uid);
if (!$user_events || empty($user_events)) {
return false;
}
if (count($user_events) == 1) {
return key($user_events);
} elseif (isset($_REQUEST['calid']) && $_REQUEST['calid']) {
$request_calid = $_REQUEST['calid'];
if (isset($user_events[$request_calid])) {
return $request_calid;
}
}
return false;
}
示例6: 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);
}
示例7: adjustFields
function adjustFields($fields)
{
if (!($id = $this->getIdValue())) {
$id = null;
}
$nav_blocks = AMP_lookup('navBlocks');
foreach ($nav_blocks as $block_name => $token) {
$fields['order_tracker_' . $block_name] = array('type' => 'textarea', 'attr' => array('id' => 'order_tracker_amp_content_nav_location_values_' . $block_name));
}
//$fields['position_list']['default'] = $this->_getPositionList( $id );
if (isset($id)) {
$fields['layout_anchor_description']['default'] = $this->_describeLayoutAnchor($id);
return $fields;
}
$requested_selectors = array_combine_key($this->_selector_fields, $_GET);
if (!empty($requested_selectors)) {
foreach ($requested_selectors as $selector => $value) {
$fields[$selector]['type'] = 'select';
}
return $fields;
}
foreach ($fields as $key => $field_def) {
if (array_search($key, $this->_selector_fields) === FALSE) {
continue;
}
$fields[$key]['type'] = 'select';
}
return $fields;
}
示例8: 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)));
}
示例9: AMPContent_DisplayCriteria
function AMPContent_DisplayCriteria()
{
$this->_excluded_classes = AMP_lookup('excluded_classes_for_display');
if (AMP_CONTENT_CLASS_SECTIONFOOTER) {
$this->_excluded_classes[] = AMP_CONTENT_CLASS_SECTIONFOOTER;
}
}
示例10: isAllowed
function isAllowed($action, $model_id = false)
{
$allowed_layouts = AMP_lookup('navLayouts');
if ($model_id && !isset($allowed_layouts[$model_id])) {
return false;
}
return parent::isAllowed($action, $model_id);
}
示例11: _register_options_dynamic
function _register_options_dynamic()
{
$this->options['allowed_classes']['values'] = AMP_lookup('classes');
$this->options['allowed_sections']['values'] = AMP_lookup('sectionMap');
if (is_array($this->options['allowed_sections']['values'])) {
$this->options['allowed_sections']['values'] = array(AMP_CONTENT_MAP_ROOT_SECTION => '-- ' . AMP_SITE_NAME . ' --') + $this->options['allowed_sections']['values'];
}
}
示例12: setTool
function setTool($tool_id)
{
$this->add_link_var('tool_id', $tool_id);
$forms_list = AMP_lookup('formsByTool');
if (isset($forms_list[$tool_id])) {
$this->add_link_var('form_id', $forms_list[$tool_id]);
}
}
示例13: getTemplate
function getTemplate()
{
$id = $this->getData('id');
$template_set = AMP_lookup('templates');
if (!isset($template_set[$id])) {
return $id;
}
return $id . ': ' . $template_set[$id];
}
示例14: render_editor_name
function render_editor_name($source)
{
$editor_id = $source->getLastEditorId();
$user_names = AMP_lookup('users');
if (!($editor_id && isset($user_names[$editor_id]))) {
return false;
}
return $user_names[$editor_id];
}
示例15: render_position
function render_position($source)
{
$positions = AMP_lookup('navPositions');
$position_id = $source->getPosition();
if (!$position_id) {
return false;
}
$position_name = isset($positions[$position_id]) ? $positions[$position_id] : $position_id;
return $this->_renderer->newline() . $this->_renderer->span($position_name, array('class' => AMP_CONTENT_CSS_CLASS_SYSTEM_FINEPRINT, 'title' => 'Nav Position'));
}