本文整理汇总了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;
}
示例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();
}
示例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;
}