mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
method to get a reference to a widget by it's name
This commit is contained in:
parent
49d548dd25
commit
20d1b19c3c
@ -725,6 +725,19 @@
|
||||
return $this->widget_tree_walk('get_widget_by_path_helper',$path);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a reference to a widget in the widget's children tree spezified it's name
|
||||
*
|
||||
* It returns the first match!
|
||||
*
|
||||
* @param string $name name of the widget
|
||||
* @return array referenz to the widget spezified or null, if it's not found
|
||||
*/
|
||||
function &get_widget_by_name($name)
|
||||
{
|
||||
return $this->widget_tree_walk('get_widget_by_name_helper',$name);
|
||||
}
|
||||
|
||||
/**
|
||||
* generated a file-name from an eTemplates, name, template(-set) and lang
|
||||
*
|
||||
@ -930,6 +943,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
function &get_widget_by_name_helper(&$widget,$extra)
|
||||
{
|
||||
if ($widget['name'] == $extra) return $widget;
|
||||
}
|
||||
|
||||
function &get_widget_by_path_helper(&$widget,$extra,$path)
|
||||
{
|
||||
//echo "<p>path_searched='$extra', widget-path($widget[type]:$widget[name])='$path'</p>\n";
|
||||
|
Loading…
Reference in New Issue
Block a user