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;
}
/**
}
/**
- * 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, "");
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) {