From 225e17002545e9965f959918d4ac804a5004e9ad Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 28 Oct 2008 16:01:53 +0000 Subject: Views are now more granular. git-svn-id: https://code.elgg.org/elgg/trunk@2331 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/plugins.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'engine/lib/plugins.php') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index b78418243..3cc11f96c 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -185,8 +185,14 @@ if (file_exists($CONFIG->pluginspath . $mod)) { if (!@include($CONFIG->pluginspath . $mod . "/start.php")) throw new PluginException(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod)); - if (is_dir($CONFIG->pluginspath . $mod . "/views/default")) { - autoregister_views("",$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views/"); + if (is_dir($CONFIG->pluginspath . $mod . "/views")) { + if ($handle = opendir($CONFIG->pluginspath . $mod . "/views")) { + while ($viewtype = readdir($handle)) { + if (!in_array($viewtype,array('.','..','.svn','CVS')) && is_dir($CONFIG->pluginspath . $mod . "/views/" . $viewtype)) { + autoregister_views("",$CONFIG->pluginspath . $mod . "/views/" . $viewtype,$CONFIG->pluginspath . $mod . "/views/", $viewtype); + } + } + } } if (is_dir($CONFIG->pluginspath . $mod . "/languages")) { register_translations($CONFIG->pluginspath . $mod . "/languages/"); -- cgit v1.2.3