]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #2640 - elgg_view_layout now uses a parameter array like all the other elgg_vie...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 11 Nov 2010 01:36:23 +0000 (01:36 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 11 Nov 2010 01:36:23 +0000 (01:36 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7288 36083f99-b078-4883-b0ff-0f9b5a30f544

81 files changed:
engine/lib/admin.php
engine/lib/tags.php
engine/lib/users.php
engine/lib/views.php
engine/tests/ui/submenu.php
index.php
mod/blog/start.php
mod/bookmarks/bookmarklet.php
mod/bookmarks/start.php
mod/diagnostics/index.php
mod/ecml/start.php
mod/file/edit.php
mod/file/friends.php
mod/file/index.php
mod/file/search.php
mod/file/upload.php
mod/file/world.php
mod/groups/activity.php
mod/groups/addtopic.php
mod/groups/all.php
mod/groups/edit.php
mod/groups/edittopic.php
mod/groups/forum.php
mod/groups/groupprofile.php
mod/groups/index.php
mod/groups/invitations.php
mod/groups/invite.php
mod/groups/membership.php
mod/groups/membershipreq.php
mod/groups/new.php
mod/groups/topicposts.php
mod/invitefriends/index.php
mod/members/index.php
mod/messages/index.php
mod/messages/read.php
mod/messages/send.php
mod/messages/sent.php
mod/notifications/groups.php
mod/notifications/index.php
mod/pages/edit.php
mod/pages/history.php
mod/pages/index.php
mod/pages/new.php
mod/pages/view.php
mod/pages/welcome.php
mod/pages/world.php
mod/profile/edit.php
mod/profile/editicon.php
mod/profile/index.php
mod/profile/start.php
mod/reportedcontent/add.php
mod/riverdashboard/index.php
mod/search/index.php
mod/search/views/default/search/layout.php
mod/sitepages/index.php
mod/sitepages/sitepages_functions.php
mod/tagcloud/tagcloud.php
mod/thewire/add.php
mod/thewire/everyone.php
mod/thewire/index.php
pages/account/forgotten_password.php
pages/account/register.php
pages/dashboard/index.php
pages/dashboard/latest.php
pages/entities/index.php
pages/friends/add.php
pages/friends/collections.php
pages/friends/edit.php
pages/friends/index.php
pages/friends/of.php
pages/settings/plugins.php
pages/settings/statistics.php
pages/settings/user.php
services/export/handler.php
views/default/canvas/default.php
views/default/canvas/layouts/administration.php
views/default/canvas/layouts/one_column.php
views/default/canvas/layouts/one_column_with_sidebar.php
views/default/js/initialise_elgg.php
views/default/messages/exceptions/exception.php
views/default/page_elements/sidebar.php

index 5a9e14498ab423a25c316548068b1491812a54d2..2e2003bc85059ab878f2e58c41a20f1379902a43 100644 (file)
@@ -211,7 +211,7 @@ function admin_settings_page_handler($page) {
                $content = "<div class=\"admin_notices\">$notices_html</div>$content";
        }
 
-       $body = elgg_view_layout('administration', $content);
+       $body = elgg_view_layout('administration', array('content' => $content));
        echo elgg_view_page($title, $body, 'page_shells/admin');
 }
 
index 68cfee940524eb900c670acfe9b850f40bf25bc8..d5010118a00adc95b0a72cb14dda7a315bb1bcd1 100644 (file)
@@ -439,7 +439,8 @@ function elgg_tagcloud_page_handler($page) {
                default:
                        $title = elgg_view_title(elgg_echo('tags:site_cloud'));
                        $tags = display_tagcloud(0, 100, 'tags');
-                       $body = elgg_view_layout('one_column_with_sidebar', $title . $tags);
+                       $content = $title . $tags;
+                       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
                        echo elgg_view_page(elgg_echo('tags:site_cloud'), $body);
                        break;
index b3c21a0b572f2cb5c0a277c9db05af9cb6da88d5..b116e108372d53b55fc64b7b007a7f317c41fe48 100644 (file)
@@ -984,7 +984,7 @@ function elgg_user_resetpassword_page_handler($page) {
        $title = elgg_echo('resetpassword');
        $content = elgg_view_title(elgg_echo('resetpassword')) . $form;
 
-       echo elgg_view_page($title, elgg_view_layout('one_column', $content));
+       echo elgg_view_page($title, elgg_view_layout('one_column', array('content' => $content)));
 }
 
 /**
@@ -1332,13 +1332,9 @@ function registration_page_handler($page_elements) {
  * @todo finish
  */
 function elgg_user_login_page_handler() {
-       $content = elgg_view_layout('one_column', elgg_view('account/login_box'));
-       $content = '
-       <div id="elgg_content" class="clearfix">
-       ' .     elgg_view('account/login_box') . '
-       </div>
-       ';
-       echo elgg_view_page('test', $content);
+       $login_box = elgg_view('account/login_box');
+       $content = elgg_view_layout('one_column', array('content' => $login_box));
+       echo elgg_view_page(elgg_echo('login'), $content);
 }
 
 /**
index 459f84b691767ab2d32d0eddc75e9d9719348af3..24b25ffd069c1605017ee51e2b868936b07dc43a 100644 (file)
@@ -916,38 +916,43 @@ function elgg_view_entity_annotations(ElggEntity $entity, $full = true) {
 /**
  * Displays a layout with optional parameters.
  *
- * Layouts control the static elements in Elgg's appearance.
+ * Layouts provide consistent organization of pages and other blocks of content.
  * There are a few default layouts in core:
- *  - administration A special layout for the admin area.
- *  - one_column A single column page with a header and footer.
- *  - one_column_with_sidebar A single column page with a header, footer, and sidebar.
- *  - widgets A widget canvas.
- *
- * Arguments to this function are passed to the layouts as $area1, $area2,
- * ... $areaN.  See the individual layouts for what options are supported.
- *
- * Layouts are stored in canvas/layouts/$layout_name.
- *
- * @tip When calling this function, be sure to name the variable argument
- * names as something meaningful.  Avoid the habit of using $areaN as the
- * argument names.
- *
- * @param string $layout The name of the views in canvas/layouts/.
+ *  - administration          A special layout for the admin area.
+ *  - one_column              A single content column.
+ *  - one_column_with_sidebar A content column with sidebar.
+ *  - widgets                 A widget canvas.
+ *
+ * The layout views take the form canvas/layouts/$layout_name
+ * See the individual layouts for what options are supported. The two most
+ * common layouts have these parameters:
+ * one_column
+ *     content => string
+ * one_column_with_sidebar
+ *     content => string
+ *     sidebar => string (optional)
+ *
+ * @param string $layout The name of the view in canvas/layouts/.
+ * @param array  $vars   Associative array of parameters for the layout view
  *
  * @return string The layout
- * @todo Make this consistent with the rest of the view functions by passing
- * an array instead of "$areaN".
  */
-function elgg_view_layout($layout) {
-       $arg = 1;
-       $param_array = array();
-       while ($arg < func_num_args()) {
-               $param_array['area' . $arg] = func_get_arg($arg);
-               $arg++;
+function elgg_view_layout($layout_name, $vars = array()) {
+
+       if (is_string($vars)) {
+               elgg_deprecated_notice("The use of unlimited optional string arguments in elgg_view_layout() was deprecated in favor of an options array", 1.8);
+               $arg = 1;
+               $param_array = array();
+               while ($arg < func_num_args()) {
+                       $param_array['area' . $arg] = func_get_arg($arg);
+                       $arg++;
+               }
+       } else {
+               $param_array = $vars;
        }
 
-       if (elgg_view_exists("canvas/layouts/{$layout}")) {
-               return elgg_view("canvas/layouts/{$layout}", $param_array);
+       if (elgg_view_exists("canvas/layouts/{$layout_name}")) {
+               return elgg_view("canvas/layouts/{$layout_name}", $param_array);
        } else {
                return elgg_view("canvas/default", $param_array);
        }
index 3069e740563292073e0a219f5b0d1d190cc385c4..d5d18819485a25f3f414697d30a8e7e03fee5717 100644 (file)
@@ -93,5 +93,5 @@ elgg_add_submenu_item(array('text' => 'All test', 'href' => "$url?all"), 'all');
 
 //elgg_set_context('not_main');
 
-$body = elgg_view_layout('one_column_with_sidebar', 'Look right.');
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => 'Look right.'));
 echo elgg_view_page('Submenu Test', $body);
index 18220a7cbcd2b134cbc3910ed6011c45dff1baa7..57cf290df3709400c216e68bbaae6dcf5edf9db9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -52,6 +52,7 @@ if (!elgg_trigger_plugin_hook('index', 'system', null, FALSE)) {
        // if drop-down login in header option not selected
        $login_box = elgg_view('account/login_box');
 
-       $content = elgg_view_layout('one_column_with_sidebar', $title . $activity, $login_box);
-       echo elgg_view_page(null, $content);
+       $content = $title . $activity / $login_box;
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
+       echo elgg_view_page(null, $body);
 }
index 92ddf65c84825a8b7f2855896013c3e13ae351c0..365a21cfa7f27052e31e6cb0c8fe4199e3b76eae 100644 (file)
@@ -155,7 +155,11 @@ function blog_page_handler($page) {
 
        $content = elgg_view('navigation/breadcrumbs') . $content_info['content'];
 
-       $body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
+       $params = array(
+               'content' => $content,
+               'sidebar' => $sidebar,
+       );
+       $body = elgg_view_layout('one_column_with_sidebar', $params);
 
        echo elgg_view_page($title, $body);
 }
index 8e30f52dd70fbd2c5702c8a3265ae8f4d7b9351e..7a2f1a16f617ac3f9b1ca0b75d140a084e42c802 100644 (file)
@@ -28,8 +28,9 @@ $area2 .= elgg_view('bookmarks/bookmarklet', array('pg_owner' => $page_owner));
 // if logged in, get the bookmarklet
 $area3 = elgg_view("bookmarks/bookmarklet");
                
-// Format page
-$body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3);
+// Format
+$content = $area1 . $area2 . $area3;
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
                
 // Draw it
 echo elgg_view_page(elgg_echo('bookmarks:bookmarklet'),$body);
\ No newline at end of file
index b0a2369d3dc32b778ff2f3899eb64e72da02b9e9..95922cd225fbbed8e4580ddd411fe076bf293f6a 100644 (file)
@@ -95,7 +95,11 @@ function bookmarks_page_handler($page) {
                $sidebar = elgg_view('bookmarks/sidebar', array('object_type' => 'bookmarks'));
                $content = elgg_echo("bookmarks:unknown_user");
 
-               $body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
+               $params = array(
+                       'content' => $content,
+                       'sidebar' => $sidebar,
+               );
+               $body = elgg_view_layout('one_column_with_sidebar', $params);
                echo elgg_view_page(elgg_echo("bookmarks:user", array(elgg_get_page_owner()->name)), $body);
 
                return FALSE;
@@ -239,7 +243,11 @@ function bookmarks_page_handler($page) {
        }
 
        $content = $header . $content;
-       $body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
+       $params = array(
+               'content' => $content,
+               'sidebar' => $sidebar,
+       );
+       $body = elgg_view_layout('one_column_with_sidebar', $params);
        echo elgg_view_page(elgg_echo("bookmarks:user", array(elgg_get_page_owner()->name)), $body);
 
        return TRUE;
index 657915e662c82a6643c088a104dc3c91b0aba622..c7a5cd4b19cbae0238d6e88d236e834a71a65e05 100644 (file)
@@ -11,14 +11,14 @@ admin_gatekeeper();
 elgg_set_context('admin');
 
 // system diagnostics
-$body = elgg_view_title(elgg_echo('diagnostics'));
-$body .= "<div class='admin_settings diagnostics'>";
-$body .= elgg_view('page_elements/content', array('body' =>
+$content = elgg_view_title(elgg_echo('diagnostics'));
+$content .= "<div class='admin_settings diagnostics'>";
+$content .= elgg_view('page_elements/content', array('body' =>
        "<h3>".elgg_echo('diagnostics:report')."</h3>".elgg_echo('diagnostics:description') . elgg_view('diagnostics/forms/download'))
 );
 
 // unit tests
-$body .= "<h3>".elgg_echo('diagnostics:unittester')."</h3>";
+$content .= "<h3>".elgg_echo('diagnostics:unittester')."</h3>";
 $test_body = "<p>" . elgg_echo('diagnostics:unittester:description') . "</p>";
 $test_body .= "<p>" . elgg_echo('diagnostics:unittester:warning') . "</p>";
 
@@ -32,9 +32,10 @@ if (isset($CONFIG->debug)) {
        $test_body .= elgg_echo('diagnostics:unittester:debug');
 }
 
-$body .= elgg_view('page_elements/content', array(
+$content .= elgg_view('page_elements/content', array(
        'body' => $test_body)
 );
-$body .= "</div>";
-// create page
-echo elgg_view_page(elgg_echo('diagnostics'), elgg_view_layout("one_column_with_sidebar", $body));
+$content .= "</div>";
+
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $content));
+echo elgg_view_page(elgg_echo('diagnostics'), $body);
index 82bea88ae46a65d633cc2ee547e05f4aba0418e3..0d60dd1a57c07da26308dcec16dac41f6039832b 100644 (file)
@@ -87,7 +87,7 @@ function ecml_init() {
 function ecml_help_page_handler($page) {
        if (!isset($page[0]) || empty($page[0])) {
                $content = elgg_view('ecml/help');
-               $body = elgg_view_layout('one_column_with_sidebar', $content);
+               $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
                echo elgg_view_page(elgg_echo('ecml:help'), $body);
        } else {
                // asking for detailed help about a keyword
@@ -98,7 +98,7 @@ function ecml_help_page_handler($page) {
                        echo $content;
                        exit;
                } else {
-                       $body = elgg_view_layout('one_column_with_sidebar', $content);
+                       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
                        echo elgg_view_page(elgg_echo('ecml:help'), $body);
                }
        }
@@ -183,7 +183,7 @@ function ecml_admin_page_handler($page) {
        admin_gatekeeper();
        elgg_set_context('admin');
        $content = elgg_view('ecml/admin/ecml_admin');
-       $body = elgg_view_layout('one_column_with_sidebar', $content);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
        echo elgg_view_page(elgg_echo('ecml:admin'), $body);
 }
 
index 5c2afc12070f5c64dc1d72a2e043ca88aed96061..961332420c86d2813144a74042edb40090e0c03d 100644 (file)
@@ -34,5 +34,5 @@ $title = elgg_echo('file:edit');
 $area1 = elgg_view_title($title);
 $area1 .= elgg_view("file/upload", array('entity' => $file));
 
-$body = elgg_view_layout('one_column_with_sidebar', $area1);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
 echo elgg_view_page($title, $body);
index 8951054806d76b168b9f85f924a48c0aed9180d8..32eeeffd806ed1006336aa5a369426b9f8ee8959 100644 (file)
        $area3 = elgg_view('annotation/latest_comments', array('comments' => $comments));
 
        $content = "<div class='files'>".$area1.$area2."</div>";
-       $body = elgg_view_layout('one_column_with_sidebar', $content, $area3);
+       $params = array(
+               'content' => $content,
+               'sidebar' => $area3
+       );
+       $body = elgg_view_layout('one_column_with_sidebar', $params);
 
        echo elgg_view_page($title, $body);
 ?>
\ No newline at end of file
index 21d573b2b588812354609adf5d1807a23a76fd51..65144b7bbdc4abcfd482842f4c5e55373f2cc139 100644 (file)
        $area3 = elgg_view('annotation/latest_comments', array('comments' => $comments));
 
        $content = "<div class='files'>".$area1.$area2."</div>";
-       $body = elgg_view_layout('one_column_with_sidebar', $content, $area3);
+
+       $params = array(
+               'content' => $content,
+               'sidebar' => $area3
+       );
+       $body = elgg_view_layout('one_column_with_sidebar', $params);
 
        echo elgg_view_page($title, $body);
 ?>
\ No newline at end of file
index b0120d932b529abe4c3a4a198d2691df905d67bc..8dd4669a928e75b3a7a0caba862e728d0965cec0 100644 (file)
@@ -92,7 +92,7 @@
 
                $content = "<div class='files'>".$area1.$area2."</div>";
 
-               $body = elgg_view_layout('one_column_with_sidebar', $content);
+               $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
                echo elgg_view_page($title, $body);
 
index 975b8e66a0872ebc32aebf2011dac2b183cbde19..2040c7240275c5fdd2a39c7c70b8d9cf887a8c54 100644 (file)
@@ -17,7 +17,7 @@
        $container_guid = elgg_get_page_owner_guid();
        $area1 = elgg_view_title($title = elgg_echo('file:upload'));
        $area1 .= elgg_view("file/upload", array('container_guid' => $container_guid));
-       $body = elgg_view_layout('one_column_with_sidebar', $area1);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
        
        echo elgg_view_page(elgg_echo("file:upload"), $body);
        
index a3d78ef7bac9e7cee6607a8e2a8b81aa57153de0..bd6c2b859e0ee21b0c73f479eac2d519bae0b4e5 100644 (file)
        $area3 = elgg_view('annotation/latest_comments', array('comments' => $comments));
        
        $content = "<div class='files'>".$area1.$area2."</div>";
-               
-       $body = elgg_view_layout('one_column_with_sidebar', $content, $area3);
+       $params = array(
+               'content' => $content,
+               'sidebar' => $area3
+       );
+       $body = elgg_view_layout('one_column_with_sidebar', $params);
 
        echo elgg_view_page($title, $body);
index 487af7e8d0269c98ce00d16dbee80455c9ab2d94..57678be6d448ef09b890e55fb7cfe58857299a29 100644 (file)
@@ -51,7 +51,7 @@ $area1 .= elgg_view_title(elgg_echo('groups:activity'));
 $area1 .= elgg_view("group_activity/extend");\r
 $area1 .= "<div class='group_listings hide_comments'>".$river_items."</div>";\r
 $title = elgg_echo("groups:activity", array(elgg_get_page_owner()->name));\r
-$body = elgg_view_layout('one_column_with_sidebar', $area1);\r
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));\r
 \r
 // Finally draw the page\r
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 85bef8ae53543897a775985712807b09f5c30cd1..008f34d9e1cd1f2bf52f9d7984d6fa583db26a8b 100644 (file)
@@ -14,7 +14,8 @@ if (!(elgg_get_page_owner() instanceof ElggGroup)) forward();
                
 // sort the display
 $area2 = elgg_view("forms/forums/addtopic");
-$body = elgg_view_layout('one_column_with_sidebar', $area1.$area2);
+$content = $area1 . $area2;
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
                
 // Display page
 echo elgg_view_page(elgg_echo('groups:addtopic'),$body);
\ No newline at end of file
index 1e7b93b657d70675cd22dafbef64e67b7b363c3c..cf1a483b1049ac703c61ace2609674458fdfc8e4 100644 (file)
@@ -59,7 +59,9 @@
                $area1 .= elgg_view('page_elements/content_header', array('context' => "everyone", 'type' => 'groups', 'new_link' => "pg/groups/new"));
        }
        $area1 .= elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)) . $objects;
-       $body = elgg_view_layout('one_column_with_sidebar', $area1, $area2);
+
+       $content = $area1 . $area2;
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
        // Finally draw the page
        echo elgg_view_page($title, $body);
\ No newline at end of file
index ddaec0060502efaeaa45fb1512af18dbc2fe9075..59064b7d8fa0bf627bf5a862adcdd15800807b11 100644 (file)
@@ -23,7 +23,7 @@
                $body .= elgg_echo('groups:noaccess');
        }
        
-       $body = elgg_view_layout('one_column_with_sidebar', $body);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
        
        echo elgg_view_page($title, $body);
 ?>
\ No newline at end of file
index 03d220af06326fd93f154052a3080efa82528f17..73730904fef190aa9d0410a1d6bc18218d4b91a9 100644 (file)
@@ -19,7 +19,7 @@ $topic = get_entity((int) get_input('topic'));
                
 // sort the display
 $area2 = elgg_view("forms/forums/edittopic", array('entity' => $topic));
-$body = elgg_view_layout('one_column_with_sidebar', $area2);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $area2));
                
 // Display page
 echo elgg_view_page(elgg_echo('groups:edittopic'),$body);
\ No newline at end of file
index 376098f80ca8150bc7c590fc2e060bff23901774..55f7dd95eacbe1a297c0ef33db7f63cc3ad534e4 100644 (file)
@@ -37,7 +37,7 @@ $area1 = elgg_view('navigation/breadcrumbs');
 $area1 .= elgg_view("forum/topics", array('topics' => $topics, 'group_guid' => $group_guid));
 elgg_set_context('groups');
 
-$body = elgg_view_layout('one_column_with_sidebar', $area1);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
 
 $title = elgg_echo('item:object:groupforumtopic');
 
index bb577fde2483acde51f66ecd49fcad812dda46c8..e7daddb43ed220566f0ff3562dcfe24eda347c53 100644 (file)
                } else {
                        $area2 .= elgg_view('groups/closedmembership', array('entity' => $group, 'user' => get_loggedin_user(), 'full' => true));
                }
-               
-               $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3);
+
+               $content = $area1 . $area2;
+               $params = array(
+                       'content' => $content,
+                       'sidebar' => $area3
+               );
+               $body = elgg_view_layout('one_column_with_sidebar', $params);
        } else {
                $title = elgg_echo('groups:notfound');
                
                $area2 = elgg_view_title($title);
                $area2 .= "<p class='margin_top'>".elgg_echo('groups:notfound:details')."</p>";
                
-               $body = elgg_view_layout('one_column_with_sidebar', $area2);
+               $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area2));
        }
                
        // Finally draw the page
index 457d2eb5519efb92f47dd778c8f0311524fb7e7b..a8c81b27e623cbdbdba3f314e355ae9757b8bfa8 100644 (file)
@@ -20,7 +20,7 @@
        elgg_pop_context();
        
        $area1 .= $objects;
-       $body = elgg_view_layout('one_column_with_sidebar', $area1);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
        
        // Finally draw the page
        echo elgg_view_page($title, $body);
index 837534f9992d71ffb46c3c3d39ac366dacaa079e..6a187a8fa9f48eea34e98bb043917b13ceda052f 100644 (file)
@@ -26,6 +26,6 @@ if ($user) {
        $area2 .= elgg_echo("groups:noaccess");
 }
 
-$body = elgg_view_layout('one_column_with_sidebar', $area2);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
 
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 48dfea58b55ad85c3c5fcc7481300564a81f5672..acc54b15d95983c8846868667d2e0b6629759c10 100644 (file)
@@ -24,7 +24,7 @@
                $area2 .= elgg_echo("groups:noaccess");
        }
        
-       $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1 . $area2));
        
        echo elgg_view_page($title, $body);
 ?>
\ No newline at end of file
index dd5fd675b1d9558288adb27d4e1cf57d4dd00fe4..8eea0b6bb67fd2302f08b6951f253fb0677d299b 100644 (file)
@@ -27,7 +27,7 @@
        elgg_pop_context();
        
        $area2 .= $objects;
-       $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1. $area2));
        
        // Finally draw the page
        echo elgg_view_page($title, $body);
index e37825e74549a5ffcc33f5b382acf0f359b36eda..4ce2a6b7d232536e7cbaed98e1a79d4da9ebcb4b 100644 (file)
@@ -26,7 +26,7 @@
                $area2 .= elgg_echo("groups:noaccess");
        }
        
-       $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1 . $area2));
        
        echo elgg_view_page($title, $body);
 ?>
\ No newline at end of file
index 4f8179e58ed980c7e69fd8e28b0ac0fca8124ea1..84d1539af28240ff2d026272d0ef3ac24bf74376 100644 (file)
@@ -14,7 +14,7 @@
        $area2 = elgg_view_title($title);
        $area2 .= elgg_view("forms/groups/edit");
        
-       $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2);
+       $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1 . $area2));
        
        echo elgg_view_page($title, $body);
 ?>
\ No newline at end of file
index 0673156f1e85c052f4205696eadc59e0e89719fa..fe9b85cec9136232a3fb42882a65a7bc0c9a8e3e 100644 (file)
@@ -25,7 +25,7 @@
          
     // Display them
            $area2 = elgg_view("forum/viewposts", array('entity' => $topic));
-           $body = elgg_view_layout("one_column_with_sidebar", $area2);
+           $body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));
                
        // Display page
                echo elgg_view_page($topic->title,$body);
index 4b7637c97e82d7e45a0c2139f3bfce9e1bf4b103..7b4c3456299b4ba5bc71419ec585f16f9617e0ab 100644 (file)
@@ -14,6 +14,6 @@ elgg_set_context('friends');
 set_page_owner(get_loggedin_userid());
 
 $body = elgg_view('invitefriends/form');
-$body = elgg_view_layout('one_column_with_sidebar', $body);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
 
 echo elgg_view_page(elgg_echo('friends:invite'), $body);
index 5a461d5e85603820292e2040f84817d827e383da..a4f21da1352a0e91cee9b7dcd5681235e7249713 100644 (file)
@@ -74,7 +74,11 @@ switch($filter){
 $area2 .= elgg_view('page_elements/content', array('body' => elgg_view("members/members_navigation", array("count" => $members, "filter" => $filter)) . "<div class='members_list'>".$filter_content."</div>", 'subclass' => 'members'));
 
 //select the correct canvas area
-$body = elgg_view_layout("one_column_with_sidebar", $area2, $area1);
+$params = array(
+       'content' => $area2,
+       'sidebar' => $area1
+);
+$body = elgg_view_layout("one_column_with_sidebar", $params);
 
 // Display page
 echo elgg_view_page(elgg_echo('members:members', array($page_owner->name)), $body);
\ No newline at end of file
index 16049f918b256c81459e91c438a36ba4a1508928..5b79a54ae9774c8c690a23172cd15f36f4d7e732 100644 (file)
@@ -42,7 +42,7 @@ $area2 .= elgg_view("messages/forms/view",array('entity' => $messages, 'page_vie
 //$area3 = elgg_view("messages/menu_options", array('context' => 'inbox'));
 
 // format
-$body = elgg_view_layout("one_column_with_sidebar", $area2);
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));
 
 
 // Draw page
index 740011c3edb3e124a1b1879354c3a298194406c4..4e404de5cbf231e395661d56a595a2a6588003a7 100644 (file)
@@ -48,7 +48,11 @@ $content = elgg_view("messages/messages",array(
 
 $sidebar = elgg_view("messages/menu_options");
 
-$body = elgg_view_layout("one_column_with_sidebar", $content, $sidebar);
+$params = array(
+       'content' => $content,
+       'sidebar' => $sidebar
+);
+$body = elgg_view_layout("one_column_with_sidebar", $params);
 
 // Display page
 echo elgg_view_page(elgg_echo('messages:message'), $body);
\ No newline at end of file
index 359c38ae1b6b51d3349e2b0bb083219b00be0b5f..3e1baa496669bbf3e7deee0357aec9bef15be3e1 100644 (file)
@@ -32,7 +32,11 @@ $area2 .= elgg_view("messages/forms/send",array('friends' => $friends));
 $area3 = elgg_view("messages/menu_options");
 
 // Format
-$body = elgg_view_layout("one_column_with_sidebar", $area2, $area3);
+$params = array(
+       'content' => $area2,
+       'sidebar' => $area3
+);
+$body = elgg_view_layout("one_column_with_sidebar", $params);
 
 // Draw page
 echo elgg_view_page(elgg_echo('messages:send', array($page_owner->name)), $body);
\ No newline at end of file
index bb0746c807347204d83a963e1f01628cf3eb86d9..89771d6b7761b42122ed086560add3858e36ccf9 100644 (file)
@@ -34,7 +34,7 @@ $area2 .= "<div class='content_header_options'><a class='action_button' href='".
 $area2 .= elgg_view("messages/forms/view",array('entity' => $messages, 'page_view' => "sent", 'limit' => $limit, 'offset' => $offset));
 
 // Format
-$body = elgg_view_layout("one_column_with_sidebar", $area2);
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));
 
 // Draw page
 echo elgg_view_page(elgg_echo('messages:sentMessages', array($page_owner->name)), $body);
index 9b176955ad4c9ced7b86be50bfae045a0931796e..10e3200325b6cb6dde2fdd31fc8f368e2abbd0e9 100644 (file)
@@ -30,7 +30,7 @@ $body = elgg_view('input/form',array(
 ));
 
 // Insert it into the correct canvas layout
-$body = elgg_view_layout('one_column_with_sidebar', $body);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
 
 
 echo elgg_view_page(elgg_echo('notifications:subscriptions:changesettings:groups'), $body);
index 209de9cd2d7ef90839b74addeb8de78fa3c1d73b..e0565959d77ff716fafa390bb142a2ba3c65d406 100644 (file)
@@ -28,7 +28,7 @@ if ($people_ents = elgg_get_entities_from_relationship(array('relationship' => '
 $body = elgg_view('notifications/subscriptions/form', array('people' => $people));
 
 // Insert it into the correct canvas layout
-$body = elgg_view_layout('one_column_with_sidebar', $body);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
 
 
 echo elgg_view_page(elgg_echo('notifications:subscriptions:changesettings'), $body);
index d404e04339028c5e43f67ff25085776503fdd655..dc290ea7df7267e2bf84da371661c7414de48702 100644 (file)
@@ -31,6 +31,6 @@ if ($pages && ($pages->canEdit())) {
        $body .= elgg_echo("pages:noaccess");
 }
 
-$body = elgg_view_layout('one_column_with_sidebar', $body);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
 
 echo elgg_view_page($title, $body);
\ No newline at end of file
index d39bf7ae090c2e386430e389c779bafe5e5445b7..d40dfaeb86fc7830d5dfae65eaf12fa3dc85f011 100644 (file)
@@ -35,6 +35,10 @@ $content.= list_annotations($page_guid, 'page', $limit, false);
 pages_set_navigation_parent($pages);
 $sidebar = elgg_view('pages/sidebar/tree');
 
-$body = elgg_view_layout('one_column_with_sidebar', $content, $sidebar);
+$params = array(
+       'content' => $content,
+       'sidebar' => $sidebar
+);
+$body = elgg_view_layout('one_column_with_sidebar', $params);
 
 echo elgg_view_page($title, $body);
index 31f76f6257a228cef1ac8f504ddc111bd7d640da..1d84587d5a56ed67eefe3ba74de0a4266a636a95 100644 (file)
@@ -44,7 +44,7 @@ $welcome_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'p
 $body = elgg_view_title($title);
 $body .= elgg_view("pages/welcome", array('entity' => $welcome_message));
 $body .= $objects;
-$body = elgg_view_layout('one_column_with_sidebar', $body);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
 
 // Finally draw the page
 echo elgg_view_page($title, $body);
index af1443d0a105b336c8e171223731fbb95197a0e8..2175572b20502103b6801a0b28d8cf6493ed46a3 100644 (file)
@@ -34,6 +34,10 @@ $title = elgg_echo("pages:new");
 $area2 .= elgg_view_title($title);
 $area2 .= elgg_view("forms/pages/edit");
 
-$body = elgg_view_layout('one_column_with_sidebar', $area2, $area1);
+$params = array(
+       'content' => $area2,
+       'sidebar' => $area1
+);
+$body = elgg_view_layout('one_column_with_sidebar', $params);
 
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 83b8d69c14911efad4a12cf60223aced01301d47..6996c44e0d25048cc68a9747ae33b16832a67543 100644 (file)
@@ -54,7 +54,10 @@ $body .= elgg_view_comments($pages);
 pages_set_navigation_parent($pages);
 $sidebar = elgg_view('pages/sidebar/tree');
 
-$body = elgg_view_layout('one_column_with_sidebar', $body, $sidebar);
+$params = array(
+       'content' => $body,
+       'sidebar' => $sidebar
+);
+$body = elgg_view_layout('one_column_with_sidebar', $params);
 
-// Finally draw the page
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 7a2a43abddc6ccff872cd2f55869407c36678f8c..7db649253e2490c51f200912709ae3944995b7de 100644 (file)
@@ -30,6 +30,10 @@ $title = elgg_echo("pages:welcome");
 $area2 .= elgg_view_title($title);
 $area2 .= elgg_view("forms/pages/editwelcome", array('entity' => $welcome_message, 'owner' => $page_owner));
 
-$body = elgg_view_layout('one_column_with_sidebar', $area2, $area1);
+$params = array(
+       'content' => $area2,
+       'sidebar' => $area1
+);
+$body = elgg_view_layout('one_column_with_sidebar', $params);
 
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 35a17b1e62ca2db1c3391e150d35fced1058a580..d258ba1572e2da0b014e538eec4033a042cc84bb 100644 (file)
@@ -38,7 +38,7 @@ elgg_pop_context();
 
 $body = elgg_view_title($title);
 $body .= $objects;
-$body = elgg_view_layout('one_column_with_sidebar', $body);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
 
 // Finally draw the page
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 12ce8564ae74044c2fe16f7d95b855061c554012..bef1cc094be0b5daf18cc5de715906f497b591d9 100644 (file)
@@ -33,8 +33,6 @@ $area1 .= elgg_view("profile/edit",array('entity' => $user));
        
 elgg_set_context('profile_edit');
 
-// get the required canvas area
-$body = elgg_view_layout("one_column_with_sidebar", $area1);
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area1));
        
-// Draw the page
-echo elgg_view_page(elgg_echo("profile:edit"),$body);
+echo elgg_view_page(elgg_echo("profile:edit"), $body);
index 4c19937b2771b9e7bad3816599999f3ba730eb90..85b06cc17c2286720ba2f8536e2571fbb9a7eead 100644 (file)
@@ -33,7 +33,7 @@ $area1 .= elgg_view("profile/edit_icon", array('user' => $user));
 elgg_set_context('profile_edit');
 
 // Get the form and correct canvas area
-$body = elgg_view_layout("one_column_with_sidebar", $area1);
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area1));
        
 // Draw the page
 echo elgg_view_page(elgg_echo("profile:editicon"), $body);
index bf47d670c6b307de34ab44ac6b1f796706a84d48..7c9c0a3cc3f5b56ce3d984767268f158780a0215 100644 (file)
@@ -45,5 +45,5 @@ if ($user = get_user_by_username($username)) {
        $body = elgg_echo("profile:notfound");
        $title = elgg_echo("profile");
 }
-$body = elgg_view_layout("one_column", $body);
+$body = elgg_view_layout("one_column", array('content' => $body));
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 6e9a43a681569bb229957cc3f04ce89552b6414f..1ba2e6dc5f3ea6833801485affcf1f48d49348b1 100644 (file)
@@ -145,7 +145,7 @@ function profile_page_handler($page) {
                        }
 
                        $content = profile_get_user_edit_content($user, $page);
-                       $content = elgg_view_layout($layout, $content);
+                       $content = elgg_view_layout($layout, array('content' => $content));
                        break;
 
                default:
@@ -156,7 +156,7 @@ function profile_page_handler($page) {
                                $section = 'activity';
                        }
                        $content = profile_get_user_profile_html($user, $section);
-                       $content = elgg_view_layout($layout, $content);
+                       $content = elgg_view_layout($layout, array('content' => $content));
                        break;
        }
 
index 833ff38d1249a8e36ed74696a6f0163810b1c00e..1194627f1ec158a397ab53525d425f9265e09edf 100644 (file)
@@ -22,8 +22,10 @@ $area2 .= elgg_view_title(elgg_echo('reportedcontent:this'), false);
 $area2 .= elgg_view('reportedcontent/form');
 $area3 .= elgg_echo('reportedcontent:warning');
 
-// Format page
-$body = elgg_view_layout('one_column_with_sidebar', $area2, $area3);
+$params = array(
+       'content' => $area2,
+       'sidebar' => $area3
+);
+$body = elgg_view_layout('one_column_with_sidebar', $params);
 
-// Draw it
-echo elgg_view_page(elgg_echo('reportedcontent:this'),$body);
\ No newline at end of file
+echo elgg_view_page(elgg_echo('reportedcontent:this'), $body);
\ No newline at end of file
index b11dade19bde59763ac657997ea63276b47bafc9..8d650e1f5b770768f6d10cf3148fb19bf57c7dc3 100644 (file)
@@ -58,7 +58,12 @@ elgg_set_context('riverdashboard');
 
 if (empty($callback)) {
        $body .= elgg_view('riverdashboard/container', array('body' => $nav . $extend . $river . elgg_view('riverdashboard/js')));
-       echo elgg_view_page($title_wording,elgg_view_layout('one_column_with_sidebar', $title . $body, $sidebar));
+       $params = array(
+               'content' => $title . $body,
+               'sidebar' => $sidebar
+       );
+       $body = elgg_view_layout('one_column_with_sidebar', $params);
+       echo elgg_view_page($title_wording, $body);
 } else {
        header("Content-type: text/html; charset=UTF-8");
        echo $nav . $river . elgg_view('riverdashboard/js');
index 03540164071de1f827f63ffc576b462ec9ba09f3..7f7be98606620f6d29f8376961d55949ddaf9e75 100644 (file)
@@ -139,7 +139,7 @@ if (!$query) {
        $body  = elgg_view_title(elgg_echo('search:search_error'));
        $body .= elgg_view('page_elements/content', array('body' => elgg_echo('search:no_query')));
 
-       $layout = elgg_view_layout('one_column_with_sidebar', $body);
+       $layout = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
        echo elgg_view_page($title, $layout);
 
        return;
index 732415f0ed4ce000dacfecbbafe6e492cac048fe..82f191e8c3cbacecb8521cab2ac521dc799d9a0c 100644 (file)
@@ -6,4 +6,4 @@
    * @subpackage Core
    */
 
-echo elgg_view_layout('one_column_with_sidebar', $vars['body']);
\ No newline at end of file
+echo elgg_view_layout('one_column_with_sidebar', array('content' => $vars['body']));
\ No newline at end of file
index f1f6585da432ea88afca09faae5c248c288474ff..053f8299681a4eacf38eaa169cac5742efbf0da6 100644 (file)
@@ -36,6 +36,10 @@ $members = elgg_get_entities_from_metadata(array(
 //include sidebar free text\r
 $sidebar = elgg_view('sitepages/sidebar');\r
 $sidebar .= elgg_view('sitepages/members', array('members' => $members));\r
-               \r
-$content = elgg_view_layout('frontpage', $content, $sidebar);\r
+\r
+$params = array(\r
+       'content' => $content,\r
+       'sidebar' => $sidebar\r
+);\r
+$content = elgg_view_layout('frontpage', $params);\r
 echo elgg_view_page(null, $content);\r
index 38c7930742ef7f6faa8e0778bc1e0b5cbe786a1a..f1dfdd0476069bdf8da6441bbcc65d569e08c4c0 100644 (file)
@@ -97,7 +97,7 @@ function sitepages_get_page_content($page_type) {
                $body .= elgg_view('page_elements/content', array('body' => elgg_echo('sitepages:notset')));
        }
 
-       $content = elgg_view_layout('one_column_with_sidebar', $body);
+       $content = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
        return $content;
 }
 
index de384b25bcccc20847f808e841c9a79a24e5426a..f5554ccba0f94e40be4833177e36811d2b05d836 100644 (file)
@@ -9,8 +9,10 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
 $title = elgg_view_title(elgg_echo('tagcloud:site:title'));
 $tags = display_tagcloud(0, 100, 'tags');
 
-//select the correct canvas area
-$body = elgg_view_layout("one_column_with_sidebar", $title . $tags, $sidebar);
+$params = array(
+       'content' => $title . $tags,
+       'sidebar' => $sidebar
+);
+$body = elgg_view_layout("one_column_with_sidebar", $params);
 
-// Display page
 echo elgg_view_page(elgg_echo('tagcloud:site:title', array($page_owner->name)), $body);
\ No newline at end of file
index 3b71cc1d6110fa111d5cd77755862ad237a4df23..12d3f8d8dbc3dfd5b00eedef432cbf14071b596a 100644 (file)
@@ -17,7 +17,7 @@
            $area2 = elgg_view_title(elgg_echo('thewire:add'));
            $area2 .= elgg_view("thewire/forms/add");
            
-           $body = elgg_view_layout("one_column_with_sidebar", $area2);
+           $body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));
                
        // Display page
                echo elgg_view_page(elgg_echo('thewire:addpost'),$body);
index 74293d26f54d37dc6237c281d626daf92a8829e8..dc6b47e71cfe1a20f6ce5635020c3d918112e2c1 100644 (file)
@@ -18,7 +18,7 @@
                $offset = (int)get_input('offset', 0);
                $area2 .= elgg_list_entities(array('types' => 'object', 'subtypes' => 'thewire', 'offset' => $offset));
 
-           $body = elgg_view_layout("one_column_with_sidebar", $area2);
+           $body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));
                
        // Display page
                echo elgg_view_page(elgg_echo('thewire:everyone'),$body);
index a1de242c58db43d393be7c6f93b909b13fe48cdc..36dc5ddab0c20aa73e077088326fd089672abab0 100644 (file)
@@ -30,7 +30,7 @@
                $area2 .= list_user_objects($page_owner->getGUID(),'thewire');
 
        //select the correct canvas area
-               $body = elgg_view_layout("one_column_with_sidebar", $area2);
+               $body = elgg_view_layout("one_column_with_sidebar", array('content' => $area2));
 
        // Display page
                echo elgg_view_page(elgg_echo('thewire:user', array($page_owner->name)), $body);
index 3fb629ef604ee2bca4106f0d89923af04e8a7f9c..1906a889ea412ebef3f5ab0e7de9f3be058d9e99 100644 (file)
@@ -11,7 +11,7 @@ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
 if (!isloggedin()) {
        $area1 = elgg_view_title(elgg_echo("user:password:lost"));
        $area2 = elgg_view("account/forms/forgotten_password");
-       $content = elgg_view_layout("one_column_with_sidebar", $area1 . $area2);
+       $content = elgg_view_layout("one_column_with_sidebar", array('content' => $area1 . $area2));
        echo elgg_view_page(elgg_echo('user:password:lost'), $content);
 } else {
        forward();
index 2638ef5610e15252c0ece7041f02f97586a6f3b2..f18061dfcf1660fa4ac8b7be29c80656e922e622 100644 (file)
@@ -32,15 +32,14 @@ if (!$CONFIG->allow_registration) {
 $friend_guid = (int) get_input('friend_guid', 0);
 $invitecode = get_input('invitecode');
 
-// If we're not logged in, display the registration page
-if (!isloggedin()) {
-       $area1 = elgg_view_title(elgg_echo("register"));
-       $area2 = elgg_view("account/forms/register",
-               array('friend_guid' => $friend_guid, 'invitecode' => $invitecode));
-
-       echo elgg_view_page(elgg_echo("register"), elgg_view_layout("one_column_with_sidebar", $area1 . $area2));
-
-       // Otherwise, forward to the index page
-} else {
+// only logged out people need to register
+if (isloggedin()) {
        forward();
 }
+
+$area1 = elgg_view_title(elgg_echo("register"));
+$area2 = elgg_view("account/forms/register",
+               array('friend_guid' => $friend_guid, 'invitecode' => $invitecode));
+
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $area1 . $area2));
+echo elgg_view_page(elgg_echo("register"), $body);
index 4cd77aa5590dc0ed2f5d2560099c4a38967885f1..ef3d987b1c2a553fc35c870652066c489d7ac6e0 100644 (file)
@@ -17,7 +17,12 @@ $title = elgg_echo('dashboard');
 // wrap intro message in a div
 $intro_message = elgg_view('dashboard/blurb');
 
-// Try and get the user from the username and set the page body accordingly
-$body = elgg_view_layout('widgets', "", "", $intro_message);
+$params = array(
+       'box' => $intro_message,
+       'num_columns' => 3,
+);
+$widgets = elgg_view_layout('widgets', $params);
+
+$body = elgg_view_layout('one_column', array('content' => $widgets));
 
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 3e8ddeefb5ebbe873ade78b7432277f0b48b40e0..973a3f8be213135ee3bd215d40a14fd6901b34dd 100644 (file)
@@ -23,5 +23,5 @@ if (is_plugin_enabled('riverdashboard')) {
 } else {
        $content = "Riverdashboard not loaded";
 }
-$content = elgg_view_layout('one_column_with_sidebar', $title . $content);
+$content = elgg_view_layout('one_column_with_sidebar', array('content' => $title . $content));
 echo elgg_view_page(elgg_echo('content:latest'), $content);
index 91cbfad0a9393293653a6ad1dddc4d9345a5d9d3..a2cb224551d0181c954408229593bc06c9351979 100644 (file)
@@ -38,7 +38,7 @@ if ($entity = get_entity($guid)) {
        }
        $area1 = elgg_view_entity($entity, true);
        if ($shell) {
-               $body = elgg_view_layout('one_column_with_sidebar', $area1);
+               $body = elgg_view_layout('one_column_with_sidebar', array('content' => $area1));
        } else {
                $body = $area1;
        }
index 5eb6608a671bcede44ec300cf7597914178310f7..23881b7c53d2ac13f398cd050a8ef75ee33c97de 100644 (file)
@@ -18,6 +18,6 @@ $content .= elgg_view('friends/forms/edit', array(
        )
 );
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page(elgg_echo('friends:collections:add'), $body);
index a37ba3a43b2d7c683b339b893c2931643ec37142..80e472f6654341c17a4e675209cd39971b253595 100644 (file)
@@ -15,6 +15,6 @@ $content = elgg_view_title($title);
 
 $content .= elgg_view_access_collections(get_loggedin_userid());
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page($title, $body);
index a560094720d81ed868c3063e4f2d2cbd3b155ea2..94527a24330f323de65ac3306c64d20e277f4cb1 100644 (file)
@@ -25,6 +25,6 @@ $collection_members = get_members_of_access_collection($collection_id);
 $content .= elgg_view('friends/forms/edit', array('collection' => $collection,
        'collection_members' => $collection_members));
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page($title, $body);
\ No newline at end of file
index 473e456c4a141103fdf734e2057a8ceea32c5416..61169cc853af396f61afcfc8940fda61983fd34d 100644 (file)
@@ -21,6 +21,6 @@ $content .= "<div class='members_list'>"
        . list_entities_from_relationship('friend', $owner->getGUID(), FALSE, 'user', '', 0, 10, FALSE)
        . "</div>";
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page($title, $body);
index 9e49ccfd4d56f7f967773e6358a9a853d351800a..b5d5829adb18a52ace66c8a1a59ac742329a4b4f 100644 (file)
@@ -21,6 +21,6 @@ $content .= "<div class='members_list'>"
        . list_entities_from_relationship('friend', $owner->getGUID(), TRUE, 'user', '', 0, 10, FALSE)
        . "</div>";
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page($title, $body);
index 671d0ff2c76bcef0f2a02b185ac78222fe31db46..657519d3806e12d10d3b0f3b0fe0796772618ed3 100644 (file)
@@ -18,6 +18,6 @@ $content = elgg_view_title(elgg_echo("usersettings:plugins"));
 $content .= elgg_view("usersettings/plugins",
        array('installed_plugins' => get_installed_plugins()));
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page(elgg_echo("usersettings:plugins"), $body);
index 248dc8e5054afced0278dee995d9e7631fe8842e..741003308849c3ea6ea95bb3f91df83005125109 100644 (file)
@@ -17,6 +17,6 @@ if ((!elgg_get_page_owner()) || (!elgg_get_page_owner()->canEdit())) {
 $content = elgg_view_title(elgg_echo("usersettings:statistics"));
 $content .= elgg_view("usersettings/statistics");
 
-$body = elgg_view_layout('one_column_with_sidebar', $content);
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
 
 echo elgg_view_page(elgg_echo("usersettings:statistics"), $body);
index 6fd578ac968d0571f0655131f9889da963c34fdc..2a530548c1386a881e1e25278918909b0f241ae1 100644 (file)
@@ -17,6 +17,6 @@ if ((!elgg_get_page_owner()) || (!elgg_get_page_owner()->canEdit())) {
 $content = elgg_view_title(elgg_echo('usersettings:user'));
 $content .= elgg_view("usersettings/form");
 
-$body = elgg_view_layout("one_column_with_sidebar", $content);
+$body = elgg_view_layout("one_column_with_sidebar", array('content' => $content));
 
 echo elgg_view_page(elgg_echo("usersettings:user"), $body);
index 81d4222e52ff2b88659453deddcd417c564ee65f..9f9f9a86a26bf279321e17ba139a8d56349007ee 100644 (file)
@@ -112,4 +112,6 @@ if (($guid != "") && ($type == "") && ($id_or_name == "")) {
        throw new InvalidParameterException(elgg_echo('InvalidParameterException:MissingParameter'));
 }
 
-echo elgg_view_page($title, elgg_view_layout('one_column_with_sidebar', elgg_view_title($title) . $body));
\ No newline at end of file
+$content = elgg_view_title($title) . $body;
+$body = elgg_view_layout('one_column_with_sidebar', array('content' => $content));
+echo elgg_view_page($title, $body);
\ No newline at end of file
index cfcee9484636367bea5ecd9771949f1d576cc1c5..60dc90b0d2f96a8c6a54d7e1574f920b43125b17 100644 (file)
@@ -4,9 +4,15 @@
  *
  * @package Elgg
  * @subpackage Core
+ *
+ * @uses $vars['content'] Content string
  */
 
+// @todo deprecated so remove in Elgg 2.0
 if (isset($vars['area1'])) {
        echo $vars['area1'];
 }
 
+if (isset($vars['content'])) {
+       echo $vars['content'];
+}
index 9b0144adec1277e80f707902322bfaa0209df6b4..0e18eb7e852e15e5148a7762afb4a2a4acb20a89 100644 (file)
@@ -4,6 +4,9 @@
  *
  * @package Elgg
  * @subpackage Core
+ *
+ * @uses $vars['content'] Content string
+ * @uses $vars['sidebar'] Optional sidebar content
  */
 ?>
 <style type="text/css">
@@ -885,8 +888,10 @@ ul.admin_plugins {
 <div id="elgg_content" class="clearfix admin_area">
        
        <div id="elgg_page_contents" class="clearfix">
-               <?php 
-                       if (isset($vars['area1'])) echo $vars['area1'];
+               <?php
+                       if (isset($vars['content'])) {
+                               echo $vars['content'];
+                       }
                ?>
        </div>
        <div id="elgg_sidebar" class="clearfix">
index 67366efc60670003dd1f95031313662e3991b703..e4a7845f5fd2bb98e23b4ee5340cac6b72d49f1a 100644 (file)
@@ -4,10 +4,13 @@
  *
  * @package Elgg
  * @subpackage Core
+ *
+ * @uses $vars['content'] Content string
  */
 ?>
 <div id="elgg_content" class="clearfix">
        <div id="elgg_page_contents" class="clearfix one_column">
+               <?php echo $vars['content']; ?>
                <?php echo $vars['area1']; ?>
        </div>
 </div>
\ No newline at end of file
index dff45a452f28c153bca6c66b7c3a7b61ac422eb9..046c49997126c637c714dbc1436d568cf5f6765d 100644 (file)
@@ -1,9 +1,12 @@
 <?php
 /**
- * Elgg 1 column with sidebar canvas layout
+ * Elgg 1 column with sidebar layout
  *
  * @package Elgg
  * @subpackage Core
+ *
+ * @uses $vars['content'] The content string for the main column
+ * @uses $vars['sidebar'] Optional content that is displayed in the sidebar
  */
 ?>
 <div id="elgg_content" class="clearfix sidebar">
        </div>
        
        <div id="elgg_page_contents" class="clearfix">
-               <?php 
+               <?php
+                       // @todo deprecated so remove in Elgg 2.0
                        if (isset($vars['area1'])) {
                                echo $vars['area1'];
                        }
+                       if (isset($vars['content'])) {
+                               echo $vars['content'];
+                       }
                ?>
        </div>
 </div>
index 0c6fb7e884e8b1da73320c8de29d0f409f52dacb..4e6da8203342ba34622e95253dde93def05da959 100644 (file)
@@ -55,262 +55,3 @@ $(function() {
        elgg.trigger_event('init', 'system');
 });
 
-$(document).ready(function () {
-
-       // COLLAPSABLE WIDGETS (on Dashboard? & Profile pages)
-       // toggle widget box contents
-       $('a.toggle_box_contents').bind('click', toggleContent);
-
-       // WIDGET GALLERY EDIT PANEL
-       // Sortable widgets
-       var els = ['#leftcolumn_widgets', '#middlecolumn_widgets', '#rightcolumn_widgets', '#widget_picker_gallery' ];
-       var $els = $(els.toString());
-
-       $els.sortable({
-               items: '.draggable_widget',
-               handle: '.drag_handle',
-               forcePlaceholderSize: true,
-               placeholder: 'ui-state-highlight',
-               cursor: 'move',
-               revert: true,
-               opacity: 0.9,
-               appendTo: 'body',
-               connectWith: els,
-               start:function(e,ui) {
-
-               },
-               stop: function(e,ui) {
-                       // refresh list before updating hidden fields with new widget order
-                       $(this).sortable( "refresh" );
-
-                       var widgetNamesLeft = outputWidgetList('#leftcolumn_widgets');
-                       var widgetNamesMiddle = outputWidgetList('#middlecolumn_widgets');
-                       var widgetNamesRight = outputWidgetList('#rightcolumn_widgets');
-
-                       document.getElementById('debugField1').value = widgetNamesLeft;
-                       document.getElementById('debugField2').value = widgetNamesMiddle;
-                       document.getElementById('debugField3').value = widgetNamesRight;
-               }
-       });
-
-       // bind more info buttons - called when new widgets are created
-       widget_moreinfo();
-
-       // set-up hover class for dragged widgets
-       $("#rightcolumn_widgets").droppable({
-               accept: ".draggable_widget",
-               hoverClass: 'droppable-hover'
-       });
-       $("#middlecolumn_widgets").droppable({
-               accept: ".draggable_widget",
-               hoverClass: 'droppable-hover'
-       });
-       $("#leftcolumn_widgets").droppable({
-               accept: ".draggable_widget",
-               hoverClass: 'droppable-hover'
-       });
-
-       // user likes
-       $(".likes_list_button").click(function(event) { 
-               if ($(this).next(".likes_list").css('display') == 'none') {     // show list
-                       // hide any other currently viewable likes lists
-                       $('.likes_list').fadeOut();
-                       
-                       var topPosition = - $(this).next(".likes_list").height();
-                       topPosition10 = topPosition + 10 + "px";
-                       topPosition = topPosition - 5 + "px";
-                       $('.likes_list').css('top',topPosition10);
-                       $('.likes_list').css('left', -$('.likes_list').width()+110);
-                       $(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500);
-                       
-                       // set up cancel for a click outside the likes list
-                       $(document).click(function(event) {             
-                                       var target = $(event.target);
-                                       if (target.parents(".likes_list_holder").length == 0) {                         
-                                               $(".likes_list").fadeOut();
-                                       }
-                       });
-                       
-               } else { // hide list
-                       var topPosition = - $(this).next(".likes_list").height() + 5;
-                       $(this).next(".likes_list").animate({opacity: "toggle", top: topPosition}, 500);
-               }
-       });
-       
-       elgg_system_message();
-
-}); /* end document ready function */
-
-
-
-// display & hide elgg system messages
-function elgg_system_message() {
-       $("#elgg_system_message").animate({opacity: 0.9}, 1000);
-       $("#elgg_system_message").animate({opacity: 0.9}, 5000);
-       $("#elgg_system_message").fadeOut('slow');
-
-       $("#elgg_system_message").click(function () {
-               $("#elgg_system_message").stop();
-               $("#elgg_system_message").fadeOut('slow');
-       return false;
-       });
-}
-
-// reusable slide in/out toggle function
-function elgg_slide_toggle(activateLink, parentElement, toggleElement) {
-       $(activateLink).closest(parentElement).find(toggleElement).animate({"height": "toggle"}, { duration: 400 });
-       return false;
-}
-
-// List active widgets for each page column
-function outputWidgetList(forElement) {
-       return( $("input[name='handler'], input[name='guid']", forElement ).makeDelimitedList("value") );
-}
-
-// Make delimited list
-jQuery.fn.makeDelimitedList = function(elementAttribute) {
-
-       var delimitedListArray = new Array();
-       var listDelimiter = "::";
-
-       // Loop over each element in the stack and add the elementAttribute to the array
-       this.each(function(e) {
-                       var listElement = $(this);
-                       // Add the attribute value to our values array
-                       delimitedListArray[delimitedListArray.length] = listElement.attr(elementAttribute);
-               }
-       );
-
-       // Return value list by joining the array
-       return(delimitedListArray.join(listDelimiter));
-}
-
-
-// Read each widgets collapsed/expanded state from cookie and apply
-function widget_state(forWidget) {
-
-       var thisWidgetState = $.cookie(forWidget);
-
-       if (thisWidgetState == 'collapsed') {
-               forWidget = "#" + forWidget;
-               $(forWidget).find("div.collapsable_box_content").hide();
-               $(forWidget).find("a.toggle_box_contents").html('+');
-               $(forWidget).find("a.toggle_box_edit_panel").fadeOut('medium');
-       };
-}
-
-
-// Toggle widgets contents and save to a cookie
-var toggleContent = function(e) {
-var targetContent = $('div.collapsable_box_content', this.parentNode.parentNode);
-       if (targetContent.css('display') == 'none') {
-               targetContent.slideDown(400);
-               $(this).html('-');
-               $(this.parentNode).children(".toggle_box_edit_panel").fadeIn('medium');
-
-               // set cookie for widget panel open-state
-               var thisWidgetName = $(this.parentNode.parentNode.parentNode).attr('id');
-               $.cookie(thisWidgetName, 'expanded', { expires: 365 });
-
-       } else {
-               targetContent.slideUp(400);
-               $(this).html('+');
-               $(this.parentNode).children(".toggle_box_edit_panel").fadeOut('medium');
-               // make sure edit pane is closed
-               $(this.parentNode.parentNode).children(".collapsable_box_editpanel").hide();
-
-               // set cookie for widget panel closed-state
-               var thisWidgetName = $(this.parentNode.parentNode.parentNode).attr('id');
-               $.cookie(thisWidgetName, 'collapsed', { expires: 365 });
-       }
-       return false;
-};
-
-// More info tooltip in widget gallery edit panel
-function widget_moreinfo() {
-
-       $("img.more_info").hover(function(e) {
-       var widgetdescription = $("input[name='description']", this.parentNode.parentNode.parentNode ).attr('value');
-       $("body").append("<p id='widget_moreinfo'><b>"+ widgetdescription +" </b></p>");
-
-               if (e.pageX < 900) {
-                       $("#widget_moreinfo")
-                               .css("top",(e.pageY + 10) + "px")
-                               .css("left",(e.pageX + 10) + "px")
-                               .fadeIn("medium");
-               }
-               else {
-                       $("#widget_moreinfo")
-                               .css("top",(e.pageY + 10) + "px")
-                               .css("left",(e.pageX - 210) + "px")
-                               .fadeIn("medium");
-               }
-       },
-       function() {
-               $("#widget_moreinfo").remove();
-       });
-
-       $("img.more_info").mousemove(function(e) {
-               // action on mousemove
-       });
-};
-
-// ELGG DROP DOWN MENU
-$.fn.elgg_dropdownmenu = function(options) {
-
-options = $.extend({speed: 350}, options || {});
-
-this.each(function() {
-
-       var root = this, zIndex = 5000;
-
-       function getSubnav(ele) {
-       if (ele.nodeName.toLowerCase() == 'li') {
-               var subnav = $('> ul', ele);
-               return subnav.length ? subnav[0] : null;
-       } else {
-
-               return ele;
-       }
-       }
-
-       function getActuator(ele) {
-       if (ele.nodeName.toLowerCase() == 'ul') {
-               return $(ele).parents('li')[0];
-       } else {
-               return ele;
-       }
-       }
-
-       function hide() {
-       var subnav = getSubnav(this);
-       if (!subnav) return;
-       $.data(subnav, 'cancelHide', false);
-       setTimeout(function() {
-               if (!$.data(subnav, 'cancelHide')) {
-               $(subnav).slideUp(100);
-               }
-       }, 250);
-       }
-
-       function show() {
-       var subnav = getSubnav(this);
-       if (!subnav) return;
-       $.data(subnav, 'cancelHide', true);
-       $(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
-       if (this.nodeName.toLowerCase() == 'ul') {
-               var li = getActuator(this);
-               $(li).addClass('hover');
-               $('> a', li).addClass('hover');
-       }
-       }
-
-       $('ul, li', this).hover(show, hide);
-       $('li', this).hover(
-       function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
-       function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); }
-       );
-
-});
-
-};
index 6e66445a3d61cf8f78d9e06ac0c95a0becb7e487..ecbd791e51733d4f59d463930cd31995b4869516 100644 (file)
@@ -34,4 +34,5 @@ END;
 
 $title = $class;
 
-echo elgg_view_layout("one_column", elgg_view_title($title) . $body);
\ No newline at end of file
+$content = elgg_view_title($title) . $body;
+echo elgg_view_layout("one_column", array('content' => $content));
\ No newline at end of file
index 2706a23c5342a4e91248275fb54d593156e85f38..8a5574da60c708eb2b661fe4e624a70b632cbf1d 100644 (file)
@@ -1,18 +1,26 @@
 <?php
 /**
  * Elgg sidebar contents
- * 
+ *
+ * @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar
  **/
 
 echo elgg_view('page_elements/owner_block');
 
 echo elgg_view('navigation/sidebar_menu');
 
+// optional 'sidebar' parameter
+if (isset($vars['sidebar'])) {
+       echo $vars['sidebar'];
+}
+
+// @todo deprecated so remove in Elgg 2.0
 // optional second parameter of elgg_view_layout
 if (isset($vars['area2'])) {
        echo $vars['area2'];
 }
 
+// @todo deprecated so remove in Elgg 2.0
 // optional third parameter of elgg_view_layout
 if (isset($vars['area3'])) {
        echo $vars['area3'];