本文整理匯總了PHP中FabrikHelperHTML::image方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::image方法的具體用法?PHP FabrikHelperHTML::image怎麽用?PHP FabrikHelperHTML::image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FabrikHelperHTML
的用法示例。
在下文中一共展示了FabrikHelperHTML::image方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elementJavascript
/**
* Returns javascript which creates an instance of the class defined in formJavascriptClass()
*
* @param int $repeatCounter repeat group counter
*
* @return string
*/
public function elementJavascript($repeatCounter)
{
if (!$this->isEditable()) {
return;
}
FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/colourpicker/images/', 'image', 'form', false);
$params = $this->getParams();
$element = $this->getElement();
$id = $this->getHTMLId($repeatCounter);
$data = $this->_form->_data;
$value = $this->getValue($data, $repeatCounter);
$vars = explode(",", $value);
$vars = array_pad($vars, 3, 0);
$opts = $this->getElementJSOptions($repeatCounter);
$c = new stdClass();
// 14/06/2011 changed over to color param object from ind colour settings
$c->red = (int) $vars[0];
$c->green = (int) $vars[1];
$c->blue = (int) $vars[2];
$opts->colour = $c;
$swatch = $params->get('colourpicker-swatch', 'default.js');
$swatchFile = JPATH_SITE . '/plugins/fabrik_element/colourpicker/swatches/' . $swatch;
$opts->swatch = json_decode(JFile::read($swatchFile));
$opts->closeImage = FabrikHelperHTML::image("close.gif", 'form', @$this->tmpl, array(), true);
$opts->handleImage = FabrikHelperHTML::image("handle.gif", 'form', @$this->tmpl, array(), true);
$opts->trackImage = FabrikHelperHTML::image("track.gif", 'form', @$this->tmpl, array(), true);
$opts = json_encode($opts);
return "new ColourPicker('{$id}', {$opts})";
}
示例2: tagify
/**
* Tagify a string
*
* @param string $data Tagify
*
* @return string Tagified string
*/
protected function tagify($data)
{
$name = $this->getFullName(true, false);
$params = $this->getParams();
$listModel = $this->getlistModel();
$filters = $listModel->getFilterArray();
$fkeys = JArrayHelper::getValue($filters, 'key', array());
$data = explode(",", strip_tags($data));
$tags = array();
$url = $params->get('textarea_tagifyurl');
if ($url == '') {
$url = $_SERVER['REQUEST_URI'];
$bits = explode('?', $url);
$root = JArrayHelper::getValue($bits, 0, '', 'string');
$bits = JArrayHelper::getValue($bits, 1, '', 'string');
$bits = explode("&", $bits);
$fullName = $this->getFullName(true, false);
for ($b = count($bits) - 1; $b >= 0; $b--) {
$parts = explode("=", $bits[$b]);
if (count($parts) > 1) {
$key = FabrikString::ltrimword(FabrikString::safeColNameToArrayKey($parts[0]), '&');
if ($key == $fullName) {
unset($bits[$b]);
}
if ($key == $fullName . '[value]') {
unset($bits[$b]);
}
if ($key == $fullName . '[condition]') {
unset($bits[$b]);
}
}
}
}
$url = $root . '?' . implode('&', $bits);
// $$$ rob 24/02/2011 remove duplicates from tags
$data = array_unique($data);
$img = FabrikWorker::j3() ? 'bookmark.png' : 'tag.png';
$icon = FabrikHelperHTML::image($img, 'form', @$this->tmpl, array('alt' => 'tag'));
foreach ($data as $d) {
$d = trim($d);
if ($d != '') {
if (trim($params->get('textarea_tagifyurl')) == '') {
$qs = strstr($url, '?');
if (substr($url, -1) === '?') {
$thisurl = $url . $name . '[value]=' . $d;
} else {
$thisurl = strstr($url, '?') ? $url . '&' . $name . '[value]=' . urlencode($d) : $url . '?' . $name . '[value]=' . urlencode($d);
}
$thisurl .= '&' . $name . '[condition]=CONTAINS';
$thisurl .= '&resetfilters=1';
} else {
$thisurl = str_replace('{tag}', urlencode($d), $url);
}
$tags[] = '<a href="' . $thisurl . '" class="fabrikTag">' . $icon . $d . '</a>';
}
}
return implode(' ', $tags);
}
示例3: button_result
public function button_result()
{
if ($this->canUse()) {
$name = $this->_getButtonName();
$label = $this->buttonLabel();
$img = FabrikHelperHTML::image($this->_buttonPrefix.'.png', 'list', '', $label);
return "<a href=\"#\" class=\"$name listplugin\"/>".$img."<span>".$label.'</span></a>';
}
return '';
}
示例4: topButton_result
/**
* create the HTML for rendering a button in the top button list
* @return string <a> link
*/
public function topButton_result()
{
if ($this->canUse()) {
$name = $this->_getButtonName();
$label = $this->buttonLabel();
$imageName = $this->getParams()->get('list_' . $this->buttonPrefix . '_image_name', $this->buttonPrefix . '.png');
$img = FabrikHelperHTML::image($imageName, 'list', '', $label);
return '<a href="#" class="' . $name . ' listplugin" title="' . $label . '">' . $img . '<span>' . $label . '</span></a>';
}
}
示例5: render
/**
* Draws the html form element
*
* @param array $data to preopulate element with
* @param int $repeatCounter repeat group counter
*
* @return string elements html
*/
public function render($data, $repeatCounter = 0)
{
FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css');
$name = $this->getHTMLName($repeatCounter);
$id = $this->getHTMLId($repeatCounter);
$params = $this->getParams();
$width = (int) $params->get('slider_width', 250);
$element = $this->getElement();
$val = $this->getValue($data, $repeatCounter);
if (!$this->isEditable()) {
return $val;
}
$labels = array_filter(explode(',', $params->get('slider-labels')));
$str = array();
$str[] = '<div id="' . $id . '" class="fabrikSubElementContainer">';
FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/slider/images/', 'image', 'form', false);
$outsrc = FabrikHelperHTML::image('clear_rating_out.png', 'form', $this->tmpl, array(), true);
if ($params->get('slider-shownone')) {
$str[] = '<div class="clearslider_cont"><img src="' . $outsrc . '" style="cursor:pointer;padding:3px;" alt="' . JText::_('PLG_ELEMENT_SLIDER_CLEAR') . '" class="clearslider" /></div>';
}
$str[] = '<div class="slider_cont" style="width:' . $width . 'px;">';
if (count($labels) > 0) {
$spanwidth = floor(($width - 2 * count($labels)) / count($labels));
$str[] = '<ul class="slider-labels" style="width:' . $width . 'px;">';
for ($i = 0; $i < count($labels); $i++) {
if ($i == ceil(floor($labels) / 2)) {
$align = 'center';
}
switch ($i) {
case 0:
$align = 'left';
break;
case 1:
default:
$align = 'center';
break;
case count($labels) - 1:
$align = 'right';
break;
}
$str[] = '<li style="width:' . $spanwidth . 'px;text-align:' . $align . ';">' . $labels[$i] . '</li>';
}
$str[] = '</ul>';
}
$str[] = '<div class="fabrikslider-line" style="width:' . $width . 'px">';
$str[] = '<div class="knob"></div>';
$str[] = '</div>';
$str[] = '<input type="hidden" class="fabrikinput" name="' . $name . '" value="' . $val . '" />';
$str[] = '<div class="slider_output">' . $val . '</div>';
$str[] = '</div>';
$str[] = '</div>';
return implode("\n", $str);
}
示例6: button_result
public function button_result()
{
if ($this->canUse()) {
$p = $this->onGetFilterKey_result();
FabrikHelperHTML::addPath('plugins/fabrik_list/' . $p . '/images/', 'image', 'list');
$name = $this->_getButtonName();
$label = $this->buttonLabel();
$imageName = $this->getParams()->get('list_' . $this->buttonPrefix . '_image_name', $this->buttonPrefix . '.png');
$img = FabrikHelperHTML::image($imageName, 'list', '', $label);
return '<a href="#" class="' . $name . ' listplugin" title="' . $label . '">' . $img . '<span>' . $label . '</span></a>';
}
return '';
}
示例7: render
/**
* draws the form element
* @param array data to preopulate element with
* @param int repeat group counter
* @return string returns element html
*/
function render($data, $repeatCounter = 0)
{
FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE.'media/com_fabrik/css/slider.css');
$name = $this->getHTMLName($repeatCounter);
$id = $this->getHTMLId($repeatCounter);
$params =& $this->getParams();
$width = $params->get('slider_width', 250);
$element = $this->getElement();
$val = $this->getValue($data, $repeatCounter);
if (!$this->_editable) {
return $val;
}
$imagepath = COM_FABRIK_LIVESITE.'/plugins/fabrik_element/slider/images/';
$labels = array_filter(explode(',', $params->get('slider-labels')));
$str = "<div class=\"fabrikSubElementContainer\" id=\"$id\">";
FabrikHelperHTML::addPath(JPATH_SITE.'/plugins/fabrik_element/slider/images/', 'image', 'form', false);
$outsrc = FabrikHelperHTML::image('clear_rating_out.png', 'form', $this->tmpl, '', true);
if ($params->get('slider-shownone')) {
$str .= "<div class=\"clearslider_cont\"><img src=\"$outsrc\" style=\"cursor:pointer;padding:3px;\" alt=\"clear\" class=\"clearslider\" /></div>";
}
$str .="<div class=\"slider_cont\" style=\"width:{$width}px;\">\n";
if (count($labels) > 0) {
$spanwidth = floor(($width - (2 * count($labels))) /count($labels));
$str .= "<ul class=\"slider-labels\" style=\"width:{$width}px;\">\n";
for ($i=0; $i < count($labels); $i++) {
if ($i == ceil(floor($labels)/2)) {
$align = 'center';
}
switch($i) {
case 0:
$align = 'left';
break;
case 1:
default:
$align = 'center';
break;
case count($labels) -1:
$align = 'right';
break;
}
$str .= "<li style=\"width:{$spanwidth}px;text-align:$align;\">".$labels[$i]."</li>\n";
}
$str .= "</ul>\n";
}
$str .= "<div class=\"fabrikslider-line\" style=\"width:{$width}px\">\n<div class=\"knob\"></div>\n</div>\n";
$str .= "<input type=\"hidden\" class=\"fabrikinput\" name=\"$name\" value=\"$val\"/>\n";
$str .= "<div class=\"slider_output\">$val</div>\n";
$str .= "</div>";
return $str;
}
示例8: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a JError object.
*/
public function display($tpl = 'default')
{
$app = JFactory::getApplication();
$input = $app->input;
$j3 = FabrikWorker::j3();
$srcs = FabrikHelperHTML::framework();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model = $this->getModel();
$id = $input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0)));
$model->setId($id);
$row = $model->getVisualization();
if (!$model->canView()) {
echo FText::_('JERROR_ALERTNOAUTHOR');
return false;
}
$js = $model->render();
$this->containerId = $this->get('ContainerId');
$this->row = $row;
$this->showFilters = $input->getInt('showfilters', 1) === 1 ? 1 : 0;
$this->filters = $model->getFilters();
$this->advancedSearch = $model->getAdvancedSearchLink();
$this->filterFormURL = $model->getFilterFormURL();
$params = $model->getParams();
$this->params = $params;
$this->width = $params->get('timeline_width', '700');
$this->height = $params->get('timeline_height', '300');
$tpl = $j3 ? 'bootstrap' : 'default';
$tpl = $params->get('timeline_layout', $tpl);
$tmplpath = '/plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl;
$this->_setPath('template', JPATH_ROOT . $tmplpath);
JHTML::stylesheet('media/com_fabrik/css/list.css');
FabrikHelperHTML::stylesheetFromPath($tmplpath . '/template.css');
$srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js';
$srcs['Timeline'] = 'plugins/fabrik_visualization/timeline/timeline.js';
$srcs['AdvancedSearch'] = 'media/com_fabrik/js/advanced-search.js';
$js .= $model->getFilterJs();
FabrikHelperHTML::iniRequireJs($model->getShim());
FabrikHelperHTML::script($srcs, $js);
JText::script('COM_FABRIK_ADVANCED_SEARCH');
JText::script('COM_FABRIK_LOADING');
$opts = array('alt' => 'calendar', 'class' => 'calendarbutton', 'id' => 'timelineDatePicker_cal_img');
$img = FabrikHelperHTML::image('calendar.png', 'form', @$this->tmpl, $opts);
$this->datePicker = '<input type="text" name="timelineDatePicker" id="timelineDatePicker" value="" />' . $img;
// Check and add a general fabrik custom css file overrides template css and generic table css
FabrikHelperHTML::stylesheetFromPath('media/com_fabrik/css/custom.css');
// Check and add a specific biz template css file overrides template css generic table css and generic custom css
FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl . '/custom.css');
return parent::display();
}
示例9: tagify
/**
* tagify a string
* @param string to tagify
* @return string tagified string
*/
protected function tagify($data)
{
$name = $this->getFullName(false, true, false);
$params = $this->getParams();
$listModel = $this->getlistModel();
$filters = $listModel->getFilterArray();
$fkeys = JArrayHelper::getValue($filters, 'key', array());
$data = explode(",", strip_tags($data));
$tags = array();
$url = $params->get('textarea_tagifyurl');
if ($url == '') {
$url = $_SERVER['REQUEST_URI'];
$bits = explode('?', $url);
$bits = JArrayHelper::getValue($bits, 1, '', 'string');
$bits = explode("&", $bits);
foreach ($bits as $bit) {
$parts = explode("=", $bit);
if (count($parts) > 1) {
$key = FabrikString::ltrimword(FabrikString::safeColNameToArrayKey($parts[0]), '&');
if ($key == $this->getFullName(false, true, false)) {
$url = str_replace($key . '=' . $parts[1], '', $url);
}
}
}
}
// $$$ rbo 24/02/2011 remove duplicates from tags
$data = array_unique($data);
$icon = FabrikHelperHTML::image('tag.png', 'form', @$this->tmpl, array('alt' => 'tag'));
foreach ($data as $d) {
$d = trim($d);
if ($d != '') {
if (trim($params->get('textarea_tagifyurl')) == '') {
$qs = strstr($url, '?');
if (substr($url, -1) === '?') {
$thisurl = "{$url}{$name}={$d}";
} else {
$thisurl = strstr($url, '?') ? "{$url}&{$name}=" . urlencode($d) : "{$url}?{$name}=" . urlencode($d);
}
} else {
$thisurl = str_replace('{tag}', urlencode($d), $url);
}
$tags[] = '<a href="' . $thisurl . '" class="fabrikTag">' . $icon . $d . '</a>';
}
}
return implode(" ", $tags);
}
示例10: tagify
/**
* Tagify a string
*
* @param string $data Tagify
*
* @return string Tagified string
*/
protected function tagify($data)
{
$name = $this->getFullName(true, false);
$params = $this->getParams();
$data = explode(',', strip_tags($data));
$url = $params->get('textarea_tagifyurl');
$listId = $this->getListModel()->getId();
if ($url == '') {
if ($this->app->isAdmin()) {
$url = 'index.php?option=com_fabrik&task=list.view&listid=' . $listId;
} else {
$url = 'index.php?option=com_' . $this->package . '&view=list&listid=' . $listId;
}
}
// $$$ rob 24/02/2011 remove duplicates from tags
// $$$ hugh - strip spaces first, account for "foo,bar, baz, foo"
$data = array_map('trim', $data);
$data = array_unique($data);
$img = FabrikWorker::j3() ? 'bookmark.png' : 'tag.png';
$icon = FabrikHelperHTML::image($img, 'form', @$this->tmpl, array('alt' => 'tag'));
$tmplData = new stdClass();
$tmplData->tags = array();
foreach ($data as $d) {
$d = trim($d);
if ($d != '') {
if (trim($params->get('textarea_tagifyurl')) == '') {
if (substr($url, -1) === '?') {
$thisurl = $url . $name . '[value]=' . $d;
} else {
$thisurl = strstr($url, '?') ? $url . '&' . $name . '[value]=' . urlencode($d) : $url . '?' . $name . '[value]=' . urlencode($d);
}
$thisurl .= '&' . $name . '[condition]=CONTAINS';
$thisurl .= '&resetfilters=1';
} else {
$thisurl = str_replace('{tag}', urlencode($d), $url);
}
$o = new stdClass();
$o->url = $thisurl;
$o->icon = $icon;
$o->label = $d;
$tmplData->tags[] = $o;
}
}
$layout = $this->getLayout('tags');
return $layout->render($tmplData);
}
示例11: display
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise a JError object.
*/
public function display($tpl = 'default')
{
$srcs = FabrikHelperHTML::framework();
$usersConfig = JComponentHelper::getParams('com_fabrik');
$model = $this->getModel();
// Needed to load the language file!
$pluginManager = FabrikWorker::getPluginManager();
$plugin = $pluginManager->getPlugIn('timeline', 'visualization');
$id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
$model->setId($id);
$row = $model->getVisualization();
$js = $model->render();
$this->assign('containerId', $this->get('ContainerId'));
$this->assignRef('row', $row);
$this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0);
$this->assignRef('filters', $this->get('Filters'));
$this->advancedSearch = $this->get('AdvancedSearchLink');
$this->assign('filterFormURL', $this->get('FilterFormURL'));
$params = $model->getParams();
$this->assignRef('params', $params);
$this->width = $params->get('timeline_width', '700');
$this->height = $params->get('timeline_height', '300');
$tpl = $params->get('timeline_layout', $tpl);
$tmplpath = '/plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl;
$this->_setPath('template', JPATH_ROOT . $tmplpath);
JHTML::stylesheet('media/com_fabrik/css/list.css');
FabrikHelperHTML::stylesheetFromPath($tmplpath . '/template.css');
$srcs[] = 'media/com_fabrik/js/listfilter.js';
$srcs[] = 'plugins/fabrik_visualization/timeline/timeline.js';
$srcs[] = 'media/com_fabrik/js/advanced-search.js';
$srcs[] = 'media/com_fabrik/js/encoder.js';
$js .= $model->getFilterJs();
FabrikHelperHTML::script($srcs, $js);
JText::script('COM_FABRIK_ADVANCED_SEARCH');
JText::script('COM_FABRIK_LOADING');
$opts = array('alt' => 'calendar', 'class' => 'calendarbutton', 'id' => 'timelineDatePicker_cal_img');
$img = FabrikHelperHTML::image('calendar.png', 'form', @$this->tmpl, $opts);
$this->datePicker = '<input type="text" name="timelineDatePicker" id="timelineDatePicker" value="" />' . $img;
// Check and add a general fabrik custom css file overrides template css and generic table css
FabrikHelperHTML::stylesheetFromPath('media/com_fabrik/css/custom.css');
// Check and add a specific biz template css file overrides template css generic table css and generic custom css
FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl . '/custom.css');
return parent::display();
}
示例12: render
/**
* Draws the html form element
*
* @param array $data To pre-populate element with
* @param int $repeatCounter Repeat group counter
*
* @return string elements html
*/
public function render($data, $repeatCounter = 0)
{
FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css');
$params = $this->getParams();
$width = (int) $params->get('slider_width', 250);
$val = $this->getValue($data, $repeatCounter);
if (!$this->isEditable()) {
return $val;
}
$labels = explode(',', $params->get('slider-labels'));
FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/slider/images/', 'image', 'form', false);
$layout = $this->getLayout('form');
$layoutData = new stdClass();
$layoutData->id = $this->getHTMLId($repeatCounter);
$layoutData->name = $this->getHTMLName($repeatCounter);
$layoutData->value = $val;
$layoutData->width = $width;
$layoutData->j3 = FabrikWorker::j3();
$layoutData->showNone = $params->get('slider-shownone');
$layoutData->outSrc = FabrikHelperHTML::image('clear_rating_out.png', 'form', $this->tmpl, array(), true);
$layoutData->labels = $labels;
$layoutData->spanWidth = floor(($width - 2 * count($labels)) / count($labels));
$layoutData->align = array();
for ($i = 0; $i < count($labels); $i++) {
switch ($i) {
case 0:
$align = 'left';
break;
case count($labels) - 1:
$align = 'right';
break;
case 1:
default:
$align = 'center';
break;
}
$layoutData->align[] = $align;
}
return $layout->render($layoutData);
}
示例13: getReadOnlyOutput
/**
* format the read only output for the page
* @param string $value
* @param string label
* @return string value
*/
protected function getReadOnlyOutput($value, $label)
{
FabrikHelperHTML::addPath(JPATH_SITE . DS . 'plugins/fabrik_element/yesno/images/', 'image', 'form', false);
$img = $value == '1' ? "1.png" : "0.png";
return FabrikHelperHTML::image($img, 'form', @$this->tmpl, array('alt' => $label));
}
示例14: array
<div class="colourpicker_output img-rounded" style="width:15px;height:15px;float:left;margin-right:10px;"></div>
<?php
echo FText::_('PLG_FABRIK_COLOURPICKER_COLOUR');
?>
<?php
if ($d->j3) {
?>
<a class="pull-right" href="#">
<?php
echo FabrikHelperHTML::icon('icon-cancel icon-remove-sign');
?>
</a>
<?php
} else {
echo FabrikHelperHTML::image("close.gif", 'form', @$this->tmpl, array());
}
if ($d->showPicker) {
?>
</div>
<div class="itemContentPadder">
<div class="row-fluid">
<div class="span7">
<ul class="nav nav-tabs">
<li class="active"><a href="#<?php
echo $d->id;
?>
-picker" data-toggle="tab"><?php
echo FText::_('PLG_FABRIK_COLOURPICKER_PICKER');
?>
</a></li>
示例15: getAdvancedSearchLink
/**
* Create advanced search links
*
* @since 3.0.7
*
* @return string
*/
public function getAdvancedSearchLink()
{
$app = JFactory::getApplication();
$package = $app->getUserState('com_fabrik.package', 'fabrik');
$links = array();
$listModels = $this->getlistModels();
$js = array();
$i = 0;
foreach ($listModels as $listModel) {
$params = $listModel->getParams();
if ($params->get('advanced-filter', '0')) {
$table = $listModel->getTable();
$tmpl = $listModel->getTmpl();
$url = COM_FABRIK_LIVESITE . 'index.php?option=com_' . $package . '&view=list&layout=_advancedsearch&tmpl=component&listid=' . $table->id . '&nextview=' . $app->input->get('view', 'list') . '&scope&=' . $app->scope;
$url .= '&tkn=' . JSession::getFormToken();
$links[$table->label] = $url;
}
}
$title = '<span>' . FText::_('COM_FABRIK_ADVANCED_SEARCH') . '</span>';
$opts = array('alt' => FText::_('COM_FABRIK_ADVANCED_SEARCH'), 'class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => $title);
$img = FabrikHelperHTML::image('find.png', 'list', '', $opts);
if (count($links) === 1) {
return '<a href="' . array_pop($links) . '" class="advanced-search-link">' . $img . '</a>';
} else {
$str = $img . '<ul>';
foreach ($links as $label => $url) {
$str .= '<li><a href="' . $url . '" class="advanced-search-link">' . $label . '</a></li>';
}
$str = '</ul>';
}
}