mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
allow the link-query method of an app to set further attributes of the option used to display the entry, eg. a title (tooltip) of a certain entry: instead of id => title pairs, you return eg id => array(label=>title,title=>tooltip) like for html::select or the select widget
This commit is contained in:
parent
9eaa3efb75
commit
ea2c699f5c
@ -632,9 +632,17 @@
|
||||
else
|
||||
{
|
||||
$script = "var select = document.getElementById('$id_res');\nselect.options.length=0;\n";
|
||||
foreach($found as $id => $title)
|
||||
foreach($found as $id => $option)
|
||||
{
|
||||
$script .= "select.options[select.options.length] = new Option('".addslashes($title)."','$id');\n";
|
||||
if (!is_array($option)) $option = array('label' => $option);
|
||||
$script .= "opt = select.options[select.options.length] = new Option('".addslashes($option['label'])."','$id');\n";
|
||||
if (count($option) > 1)
|
||||
{
|
||||
foreach($option as $name => $value)
|
||||
{
|
||||
if ($name != 'label') $script .= "opt.$name = '".addslashes($value)."';\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$script .= "select.options[select.options.length] = new Option('".addslashes(lang('New search').' ...')."','');\n";
|
||||
foreach(explode(',',$id_show) as $id)
|
||||
|
Loading…
Reference in New Issue
Block a user