aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/admin.php2
-rw-r--r--engine/lib/elgglib.php10
-rw-r--r--engine/lib/views.php28
3 files changed, 20 insertions, 20 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index ad7896cb7..8426adf8b 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -208,7 +208,7 @@ function admin_settings_page_handler($page) {
}
$body = elgg_view_layout('administration', $content);
- page_draw($title, $body, "", 'page_shells/admin');
+ page_draw($title, $body, 'page_shells/admin');
}
/**
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index a4e83e40b..f74fbec09 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -2181,16 +2181,16 @@ function elgg_init() {
register_shutdown_function('__elgg_shutdown_hook');
}
+/**
+ * Walled garden system:index plugin hook.
+ */
function elgg_walled_garden_index() {
$login = elgg_view('account/forms/login_walled_garden');
- echo elgg_view('page_shells/walled_garden', array(
- 'body' => $login,
- 'sysmessages' => system_messages(NULL, ''),
- ));
+ page_draw('', $login, 'page_shells/walled_garden');
+
// @hack Index must exit to keep plugins from continuing to extend
exit;
- return TRUE;
}
/**
diff --git a/engine/lib/views.php b/engine/lib/views.php
index c1c07024a..32a45bc14 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1013,16 +1013,18 @@ function autoregister_views($view_base, $folder, $base_location_path, $viewtype)
}
/**
- * Returns a representation of a full 'page' (which might be an HTML page, RSS file, etc, depending on the current view)
+ * Outputs a representation of a full 'page' (which might be an HTML page, RSS file, etc, depending on the current view)
*
- * @param unknown_type $title
- * @param unknown_type $body
- * @return unknown
+ * @param string $title
+ * @param string $body
+ * @param string $page_shell Optional page shell to use.
+ * @param array $vars Optional vars array to pass to the page shell. Automatically adds title, body, and sysmessages
+ * @return NULL
*/
-function page_draw($title, $body, $sidebar = "", $page_shell = 'page_shells/default') {
-
+function page_draw($title, $body, $page_shell = 'page_shells/default', $vars = array()) {
// get messages - try for errors first
- $sysmessages = system_messages(null, "errors");
+ $sysmessages = system_messages(NULL, "errors");
+
if (count($sysmessages["errors"]) == 0) {
// no errors so grab rest of messages
$sysmessages = system_messages(null, "");
@@ -1031,14 +1033,12 @@ function page_draw($title, $body, $sidebar = "", $page_shell = 'page_shells/defa
system_messages(null, "");
}
+ $vars['title'] = $title;
+ $vars['body'] = $body;
+ $vars['sysmessages'] = $sysmessages;
+
// Draw the page
- $output = elgg_view($page_shell, array(
- 'title' => $title,
- 'body' => $body,
- 'sidebar' => $sidebar,
- 'sysmessages' => $sysmessages,
- )
- );
+ $output = elgg_view($page_shell, $vars);
$split_output = str_split($output, 1024);
foreach($split_output as $chunk) {