aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/elgglib.php9
-rw-r--r--engine/lib/plugins.php2
-rw-r--r--mod/test/index.php2
3 files changed, 9 insertions, 4 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 973de2680..cb1651f40 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -56,6 +56,7 @@
global $CONFIG, $strings;
static $usercache;
+
if (!is_array($usercache)) {
$usercache = array();
}
@@ -112,6 +113,7 @@
}
if (file_exists($location . "{$viewtype}/{$view}.php") && !@include($location . "{$viewtype}/{$view}.php")) {
$success = false;
+
if ($viewtype != "default") {
if (@include($location . "default/{$view}.php")) {
$success = true;
@@ -121,6 +123,7 @@
echo " [This view ({$view}) does not exist] ";
}
} else if ($CONFIG->debug == true) {
+ echo $location . "{$viewtype}/{$view}.php";
echo " [This view ({$view}) does not exist] ";
}
@@ -192,10 +195,12 @@
while ($view = readdir($handle)) {
if (!in_array($view,array('.','..','.svn','CVS')) && !is_dir($folder . "/" . $view)) {
if (substr_count($view,".php") > 0) {
- set_view_location($view_base . "/" . str_replace(".php","",$view), $base_location_path);
+ if (!empty($view_base)) { $view_base_new = $view_base . "/"; } else { $view_base_new = ""; }
+ set_view_location($view_base_new . str_replace(".php","",$view), $base_location_path);
}
} else if (!in_array($view,array('.','..','.svn','CVS')) && is_dir($folder . "/" . $view)) {
- autoregister_views($view_base . "/" . $view, $folder . "/" . $view, $base_location_path);
+ if (!empty($view_base)) { $view_base_new = $view_base . "/"; } else { $view_base_new = ""; }
+ autoregister_views($view_base_new . $view, $folder . "/" . $view, $base_location_path);
}
}
}
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php
index 92294faea..447be32af 100644
--- a/engine/lib/plugins.php
+++ b/engine/lib/plugins.php
@@ -29,7 +29,7 @@
if (!@include($CONFIG->pluginspath . $mod . "/start.php"))
throw new PluginException("{$mod} is a misconfigured plugin.");
if (is_dir($CONFIG->pluginspath . $mod . "/views/default")) {
- autoregister_views($mod,$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views");
+ autoregister_views("",$CONFIG->pluginspath . $mod . "/views/default",$CONFIG->pluginspath . $mod . "/views/");
}
}
}
diff --git a/mod/test/index.php b/mod/test/index.php
index a8a9d347f..5b749e2e7 100644
--- a/mod/test/index.php
+++ b/mod/test/index.php
@@ -5,7 +5,7 @@
global $CONFIG;
//var_export($CONFIG);
- $body = elgg_view("test/testplugin/pageshell");
+ $body = elgg_view("testplugin/pageshell");
page_draw("Test plugin",$body);
?> \ No newline at end of file