diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index 225afdab53..0d3a7be3c0 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -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 "
path_searched='$extra', widget-path($widget[type]:$widget[name])='$path'
\n";