method to get a reference to a widget by it's name

This commit is contained in:
Ralf Becker 2005-11-05 16:09:10 +00:00
parent 49d548dd25
commit 20d1b19c3c

View File

@ -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";