aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-05 15:42:56 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-05 15:42:56 +0000
commit33d366eb02ad272ec2167e1ea8d44ececa46fd9b (patch)
treeaf6fb7089788029c77cc8d0491a194a1fb39617c /engine/lib
parent685ade6f02f607200e0b92d6f09abc4a5814e386 (diff)
downloadelgg-33d366eb02ad272ec2167e1ea8d44ececa46fd9b.tar.gz
elgg-33d366eb02ad272ec2167e1ea8d44ececa46fd9b.tar.bz2
Extends elgg_view_tree to support other view types.
git-svn-id: https://code.elgg.org/elgg/trunk@2405 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/elgglib.php10
1 files 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();