]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2195. 3rd and 4th params of page_draw() are now $page_shell and $vars.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 14 Jul 2010 14:59:20 +0000 (14:59 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 14 Jul 2010 14:59:20 +0000 (14:59 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6704 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/admin.php
engine/lib/elgglib.php
engine/lib/views.php

index ad7896cb7080929c051777c77f44f48c043d9858..8426adf8b1c94cf10812d76ef1666afdf751d47e 100644 (file)
@@ -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');
 }
 
 /**
index a4e83e40b954357fb6feb2013b244415751b40df..f74fbec094267b8d47c256e5139f596496f0b44a 100644 (file)
@@ -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;
 }
 
 /**
index c1c07024a99e857792889853fa1945557c46b737..32a45bc14af47ce954692525e05b37c33ce1c9a1 100644 (file)
@@ -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) {