mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-23 22:01:47 +01:00
create static method etemplate_widget_menupopup::fix_encoded_options(), so apps can call that for cases it is not called automatically (eg. autorepeated rows)
This commit is contained in:
parent
e589930fd8
commit
26c66d12d7
@ -157,17 +157,7 @@ class etemplate_widget_menupopup extends etemplate_widget
|
|||||||
$options = (self::$request->sel_options[$form_name] ? $form_name : $this->id);
|
$options = (self::$request->sel_options[$form_name] ? $form_name : $this->id);
|
||||||
if(is_array(self::$request->sel_options[$options]))
|
if(is_array(self::$request->sel_options[$options]))
|
||||||
{
|
{
|
||||||
foreach(self::$request->sel_options[$options] as &$label)
|
self::fix_encoded_options(self::$request->sel_options[$options]);
|
||||||
{
|
|
||||||
if(!is_array($label))
|
|
||||||
{
|
|
||||||
$label = html_entity_decode($label, ENT_NOQUOTES,'utf-8');
|
|
||||||
}
|
|
||||||
elseif($label['label'])
|
|
||||||
{
|
|
||||||
$label['label'] = html_entity_decode($label['label'], ENT_NOQUOTES,'utf-8');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Turn on search, if there's a lot of rows
|
// Turn on search, if there's a lot of rows
|
||||||
if(count(self::$request->sel_options[$options]) >= self::SEARCH_ROW_LIMIT)
|
if(count(self::$request->sel_options[$options]) >= self::SEARCH_ROW_LIMIT)
|
||||||
@ -177,6 +167,27 @@ class etemplate_widget_menupopup extends etemplate_widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fix already html-encoded options, eg. "&nbps"
|
||||||
|
*
|
||||||
|
* @param array $options
|
||||||
|
*/
|
||||||
|
public static function fix_encoded_options(array &$options)
|
||||||
|
{
|
||||||
|
foreach($options as &$label)
|
||||||
|
{
|
||||||
|
// optgroup or values for keys "label" and "title"
|
||||||
|
if(is_array($label))
|
||||||
|
{
|
||||||
|
self::fix_encoded_options($label);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$label = html_entity_decode($label, ENT_NOQUOTES, 'utf-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get options from $sel_options array for a given selectbox name
|
* Get options from $sel_options array for a given selectbox name
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user