本文整理汇总了PHP中Joomla\Utilities\ArrayHelper::getvalue方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayHelper::getvalue方法的具体用法?PHP ArrayHelper::getvalue怎么用?PHP ArrayHelper::getvalue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Joomla\Utilities\ArrayHelper
的用法示例。
在下文中一共展示了ArrayHelper::getvalue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Display the view
*
* @param string $tpl Template
*
* @return void
*/
public function display($tpl = null)
{
// Initialise variables.
JHtml::_('behavior.modal', 'a.modal');
$model = $this->getModel();
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->listform = $this->get('PackageListForm');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
throw new RuntimeException(implode("\n", $errors), 500);
}
$this->addToolbar();
$canvas = FArrayHelper::getValue($this->item->params, 'canvas', array());
$blocks = new stdClass();
$b = FArrayHelper::getValue($canvas, 'blocks', array());
$blocks->form = FArrayHelper::getValue($b, 'form', array());
$blocks->list = FArrayHelper::getValue($b, 'list', array());
$blocks->visualization = FArrayHelper::getValue($b, 'visualization', array());
$opts = ArrayHelper::getvalue($canvas, 'options', array());
$d = new stdClass();
$layout = FArrayHelper::getValue($canvas, 'layout', $d);
$document = JFactory::getDocument();
$opts = new stdClass();
$opts->blocks = $blocks;
$opts->layout = $layout;
$opts = json_encode($opts);
$this->js = "PackageCanvas = new AdminPackage({$opts});";
$srcs[] = 'administrator/components/com_fabrik/views/package/adminpackage.js';
FabrikHelperHTML::iniRequireJS();
FabrikHelperHTML::script($srcs, $this->js);
// Simple layout
$this->listOpts = $model->getListOpts();
$this->formOpts = $model->getFormOpts();
$this->selFormOpts = $model->getSelFormOpts();
$this->selListOpts = $model->getSelListOpts();
FabrikAdminHelper::setViewLayout($this);
parent::display($tpl);
}
示例2: getJSIcons
//.........这里部分代码省略.........
break;
case 'url':
$iconImg = str_replace(COM_FABRIK_LIVESITE, '', $iconImg);
break;
case 'img':
// Get the src
preg_match('/src=["|\'](.*?)["|\']/', $iconImg, $matches);
if (array_key_exists(1, $matches)) {
$iconImg = $matches[1];
}
$iconImg = str_replace(COM_FABRIK_LIVESITE, '', $iconImg);
break;
}
if (strstr($iconImg, 'http://') || strstr($iconImg, 'https://') || JFile::exists(JPATH_BASE . $iconImg)) {
$customImageFound = true;
}
}
if ($iconImg != '' && !(strstr($iconImg, 'http://') || strstr($iconImg, 'https://'))) {
list($width, $height) = $this->markerSize(JPATH_BASE . $iconImg);
} else {
// Standard google map icon size
$width = 20;
$height = 34;
}
} else {
// Standard google map icon size
list($width, $height) = $this->markerSize(JPATH_BASE . $iconImg);
}
$gClass = FArrayHelper::getValue($groupClass, 0, '');
if (!empty($gClass)) {
$gClass .= '_raw';
$gClass = isset($row->{$gClass}) ? $row->{$gClass} : '';
}
if (array_key_exists($v[0] . $v[1], $icons)) {
$existingIcon = $icons[$v[0] . $v[1]];
if ($existingIcon['groupkey'] == $groupKey) {
/* $$$ hugh - this inserts label between multiple record $html, but not at the top.
* If they want to insert label, they can do it themselves in the template.
* $icons[$v[0].$v[1]][2] = $icons[$v[0].$v[1]][2] . "<h6>$table->label</h6>" . $html;
* Don't insert linebreaks in empty bubble
*/
if ($html != '') {
$html = "<br />" . $html;
}
$icons[$v[0] . $v[1]][2] = $icons[$v[0] . $v[1]][2] . $html;
if ($customImageFound) {
$icons[$v[0] . $v[1]][3] = $iconImg;
}
} else {
$groupedIcons[] = array($v[0], $v[1], $html, $iconImg, $width, $height, 'groupkey' => $groupKey, 'listid' => $listId, 'title' => $title, 'groupClass' => 'type' . $gClass);
}
} else {
// Default icon - lets see if we need to use a letter icon instead
if (FArrayHelper::getValue($letters, $c, '') != '') {
$iconImg = $uri->getScheme() . '://www.google.com/mapfiles/marker' . JString::strtoupper($letters[$c]) . '.png';
}
$icons[$v[0] . $v[1]] = array($v[0], $v[1], $html, $iconImg, $width, $height, 'groupkey' => $groupKey, 'listid' => $listId, 'title' => $title, 'groupClass' => 'type' . $gClass);
}
if ($params->get('fb_gm_use_radius', '0') == '1') {
$radiusElement = FArrayHelper::getValue($radiusElements, $c, '');
$radiusUnits = FArrayHelper::getValue($radiusUnits, $c, 'k');
$radiusMeters = $radiusUnits == 'k' ? 1000 : 1609.34;
if (!empty($radiusElement)) {
$radius = (double) $row->{$radiusElement};
$radius *= $radiusMeters;
$icons[$v[0] . $v[1]]['radius'] = $radius;
} else {
$default = (double) ArrayHelper::getvalue($radiusDefaults, $c, 50);
$default *= $radiusMeters;
$icons[$v[0] . $v[1]]['radius'] = $default;
}
}
$icons[$v[0] . $v[1]]['c'] = $c;
$this->recordCount++;
$k++;
}
}
// Replace last icon?
$iconImg = FArrayHelper::getValue($aLastIcons, $c, '');
if ($iconImg != '' && !empty($icons)) {
list($width, $height) = $this->markerSize(JPATH_SITE . '/media/com_fabrik/images/' . $iconImg);
$icons[$v[0] . $v[1]][3] = '/media/com_fabrik/images/' . $iconImg;
$icons[$v[0] . $v[1]][4] = $width;
$icons[$v[0] . $v[1]][5] = $height;
}
$c++;
}
// Replace coord keys with numeric keys
$icons = array_values($icons);
$icons = array_merge($icons, $groupedIcons);
if ($maxMarkers != 0 && $maxMarkers < count($icons)) {
$icons = array_slice($icons, -$maxMarkers);
}
$limitMessageShown = !($k >= $recLimit);
if (!$limitMessageShown && $recLimit !== 0 && $limitMessage != '') {
$this->app->enqueueMessage($limitMessage);
}
FabrikHelperHTML::debug($icons, 'map');
return $icons;
}