当前位置: 首页>>代码示例>>PHP>>正文


PHP AMPSystem_Lookup::locate方法代码示例

本文整理汇总了PHP中AMPSystem_Lookup::locate方法的典型用法代码示例。如果您正苦于以下问题:PHP AMPSystem_Lookup::locate方法的具体用法?PHP AMPSystem_Lookup::locate怎么用?PHP AMPSystem_Lookup::locate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AMPSystem_Lookup的用法示例。


在下文中一共展示了AMPSystem_Lookup::locate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 function execute($options = array())
 {
     $options = array_merge($this->getOptions(), $options);
     require_once 'AMP/UserData/Lookups.inc.php';
     $index_title = AMP_pluralize($this->udm->name) . " By " . $options['index_name'];
     $index_set =& FormLookup_Variant::instance($options['index_field'], $this->udm->instance);
     #$index['state']['sql'].="SELECT count(userdata.id) as qty, userdata.State as item_key, states.statename as item_name from userdata, states WHERE userdata.State=states.state and modin=".$_REQUEST['modin']." GROUP BY userdata.State ";
     $translated_values = isset($this->_region_lookups[$options['index_field']]) ? AMPSystem_Lookup::locate($this->_region_lookups[$options['index_field']]) : AMPSystem_Lookup::locate(array('instance' => AMP_pluralize($options['index_field'])));
     require_once 'AMP/Content/Display/HTML.inc.php';
     $renderer = new AMPDisplay_HTML();
     $output = $renderer->bold($index_title) . $renderer->newline();
     foreach ($index_set as $index_value => $index_count) {
         $display_value = $translated_values && isset($translated_values[$index_value]) ? $translated_values[$index_value] : $index_value;
         $display_value .= ' (' . $index_count . ')';
         $link_value = AMP_URL_AddVars($_SERVER['PHP_SELF'], array($options['index_field'] => strtolower($options['index_field']) . '=' . $index_value, 'modin' => 'modin=' . $this->udm->instance));
         $output .= $renderer->link($link_value, $display_value) . $renderer->newline();
         #$output .= '<a href="'.$_SERVER['PHP_SELF'].'?'.$options['index_field'].'='.$index_value.'&modin='.$_REQUEST['modin'].'">'.$index_item['item_name'].'</a> ('.$index_item['qty'].')<BR>';
     }
     return $output;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:20,代码来源:Index.inc.php

示例2: AMP_evalLookup

 function AMP_evalLookup($lookup_def)
 {
     if (is_object($lookup_def)) {
         return $lookup_def->dataset;
     }
     if (!is_array($lookup_def)) {
         return AMP_lookup($lookup_def);
     }
     if (isset($lookup_def['name']) && isset($lookup_def['var'])) {
         return AMP_lookup($lookup_def['name'], $lookup_def['var']);
     }
     if (isset($lookup_def['instance'])) {
         return AMPSystem_Lookup::locate($lookup_def);
     }
     return array();
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:16,代码来源:utility.functions.inc.php

示例3: _mapLists

 function _mapLists()
 {
     foreach ($this->menuset as $menu_id => $menu_def) {
         if (!isset($menu_def['list'])) {
             continue;
         }
         if (!isset($menu_def['list']['lookup'])) {
             continue;
         }
         if (!is_array($menu_def['list']['lookup'])) {
             $itemset =& AMPSystem_Lookup::instance($menu_def['list']['lookup']);
         } else {
             $itemset =& AMPSystem_Lookup::locate($menu_def['list']['lookup']);
         }
         if (!$itemset) {
             continue;
         }
         $sep = isset($menu_def['list']['separator']) ? $menu_def['list']['separator'] : false;
         foreach ($itemset as $id => $name) {
             $this->_addListItem($id, $name, $menu_id, $menu_def['list']['href'], $sep);
             $sep = false;
         }
     }
     return true;
 }
开发者ID:radicaldesigns,项目名称:amp,代码行数:25,代码来源:Map.inc.php


注:本文中的AMPSystem_Lookup::locate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。