From 33d366eb02ad272ec2167e1ea8d44ececa46fd9b Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 5 Nov 2008 15:42:56 +0000 Subject: Extends elgg_view_tree to support other view types. git-svn-id: https://code.elgg.org/elgg/trunk@2405 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index a05227aa6..5f5c97107 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -330,16 +330,18 @@ /** * When given a partial view root (eg 'js' or 'page_elements'), returns an array of views underneath it * - * @param string $view_root The root view + * @param string $view_root The root view + * @param string $viewtype Optionally specify a view type other than the current one. * @return array A list of view names underneath that root view */ - function elgg_view_tree($view_root) { + function elgg_view_tree($view_root, $viewtype = "") { global $CONFIG; static $treecache; - // Get viewtype - $viewtype = elgg_get_viewtype(); + // Get viewtype + if (!$viewtype) + $viewtype = elgg_get_viewtype(); // Has the treecache been initialised? if (!isset($treecache)) $treecache = array(); -- cgit v1.2.3