diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-11 01:36:23 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-11 01:36:23 +0000 |
commit | 3bfa294985001c2c6ebb58fbf87b2f795e055ca5 (patch) | |
tree | 0c1bef5f9afa3f08da345df333dc1a63ed3ffb21 | |
parent | 8c756908c5d72a53b1a4dda0901c8fb3d0191408 (diff) | |
download | elgg-3bfa294985001c2c6ebb58fbf87b2f795e055ca5.tar.gz elgg-3bfa294985001c2c6ebb58fbf87b2f795e055ca5.tar.bz2 |
Fixes #2640 - elgg_view_layout now uses a parameter array like all the other elgg_view* functions
git-svn-id: http://code.elgg.org/elgg/trunk@7288 36083f99-b078-4883-b0ff-0f9b5a30f544
81 files changed, 259 insertions, 407 deletions
diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 5a9e14498..2e2003bc8 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -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'); } diff --git a/engine/lib/tags.php b/engine/lib/tags.php index 68cfee940..d5010118a 100644 --- a/engine/lib/tags.php +++ b/engine/lib/tags.php @@ -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; diff --git a/engine/lib/users.php b/engine/lib/users.php index b3c21a0b5..b116e1083 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -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); } /** diff --git a/engine/lib/views.php b/engine/lib/views.php index 459f84b69..24b25ffd0 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -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); } diff --git a/engine/tests/ui/submenu.php b/engine/tests/ui/submenu.php index 3069e7405..d5d188194 100644 --- a/engine/tests/ui/submenu.php +++ b/engine/tests/ui/submenu.php @@ -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); @@ -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); } diff --git a/mod/blog/start.php b/mod/blog/start.php index 92ddf65c8..365a21cfa 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -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); } diff --git a/mod/bookmarks/bookmarklet.php b/mod/bookmarks/bookmarklet.php index 8e30f52dd..7a2f1a16f 100644 --- a/mod/bookmarks/bookmarklet.php +++ b/mod/bookmarks/bookmarklet.php @@ -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 diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index b0a2369d3..95922cd22 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -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; diff --git a/mod/diagnostics/index.php b/mod/diagnostics/index.php index 657915e66..c7a5cd4b1 100644 --- a/mod/diagnostics/index.php +++ b/mod/diagnostics/index.php @@ -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); diff --git a/mod/ecml/start.php b/mod/ecml/start.php index 82bea88ae..0d60dd1a5 100644 --- a/mod/ecml/start.php +++ b/mod/ecml/start.php @@ -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); } diff --git a/mod/file/edit.php b/mod/file/edit.php index 5c2afc120..961332420 100644 --- a/mod/file/edit.php +++ b/mod/file/edit.php @@ -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); diff --git a/mod/file/friends.php b/mod/file/friends.php index 895105480..32eeeffd8 100644 --- a/mod/file/friends.php +++ b/mod/file/friends.php @@ -34,7 +34,11 @@ $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 diff --git a/mod/file/index.php b/mod/file/index.php index 21d573b2b..65144b7bb 100644 --- a/mod/file/index.php +++ b/mod/file/index.php @@ -40,7 +40,12 @@ $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 diff --git a/mod/file/search.php b/mod/file/search.php index b0120d932..8dd4669a9 100644 --- a/mod/file/search.php +++ b/mod/file/search.php @@ -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); diff --git a/mod/file/upload.php b/mod/file/upload.php index 975b8e66a..2040c7240 100644 --- a/mod/file/upload.php +++ b/mod/file/upload.php @@ -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); diff --git a/mod/file/world.php b/mod/file/world.php index a3d78ef7b..bd6c2b859 100644 --- a/mod/file/world.php +++ b/mod/file/world.php @@ -31,7 +31,10 @@ $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); diff --git a/mod/groups/activity.php b/mod/groups/activity.php index 487af7e8d..57678be6d 100644 --- a/mod/groups/activity.php +++ b/mod/groups/activity.php @@ -51,7 +51,7 @@ $area1 .= elgg_view_title(elgg_echo('groups:activity')); $area1 .= elgg_view("group_activity/extend");
$area1 .= "<div class='group_listings hide_comments'>".$river_items."</div>";
$title = elgg_echo("groups:activity", array(elgg_get_page_owner()->name));
-$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);
\ No newline at end of file diff --git a/mod/groups/addtopic.php b/mod/groups/addtopic.php index 85bef8ae5..008f34d9e 100644 --- a/mod/groups/addtopic.php +++ b/mod/groups/addtopic.php @@ -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 diff --git a/mod/groups/all.php b/mod/groups/all.php index 1e7b93b65..cf1a483b1 100644 --- a/mod/groups/all.php +++ b/mod/groups/all.php @@ -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 diff --git a/mod/groups/edit.php b/mod/groups/edit.php index ddaec0060..59064b7d8 100644 --- a/mod/groups/edit.php +++ b/mod/groups/edit.php @@ -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 diff --git a/mod/groups/edittopic.php b/mod/groups/edittopic.php index 03d220af0..73730904f 100644 --- a/mod/groups/edittopic.php +++ b/mod/groups/edittopic.php @@ -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 diff --git a/mod/groups/forum.php b/mod/groups/forum.php index 376098f80..55f7dd95e 100644 --- a/mod/groups/forum.php +++ b/mod/groups/forum.php @@ -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'); diff --git a/mod/groups/groupprofile.php b/mod/groups/groupprofile.php index bb577fde2..e7daddb43 100644 --- a/mod/groups/groupprofile.php +++ b/mod/groups/groupprofile.php @@ -35,15 +35,20 @@ } 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 diff --git a/mod/groups/index.php b/mod/groups/index.php index 457d2eb55..a8c81b27e 100644 --- a/mod/groups/index.php +++ b/mod/groups/index.php @@ -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); diff --git a/mod/groups/invitations.php b/mod/groups/invitations.php index 837534f99..6a187a8fa 100644 --- a/mod/groups/invitations.php +++ b/mod/groups/invitations.php @@ -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 diff --git a/mod/groups/invite.php b/mod/groups/invite.php index 48dfea58b..acc54b15d 100644 --- a/mod/groups/invite.php +++ b/mod/groups/invite.php @@ -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 diff --git a/mod/groups/membership.php b/mod/groups/membership.php index dd5fd675b..8eea0b6bb 100644 --- a/mod/groups/membership.php +++ b/mod/groups/membership.php @@ -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); diff --git a/mod/groups/membershipreq.php b/mod/groups/membershipreq.php index e37825e74..4ce2a6b7d 100644 --- a/mod/groups/membershipreq.php +++ b/mod/groups/membershipreq.php @@ -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 diff --git a/mod/groups/new.php b/mod/groups/new.php index 4f8179e58..84d1539af 100644 --- a/mod/groups/new.php +++ b/mod/groups/new.php @@ -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 diff --git a/mod/groups/topicposts.php b/mod/groups/topicposts.php index 0673156f1..fe9b85cec 100644 --- a/mod/groups/topicposts.php +++ b/mod/groups/topicposts.php @@ -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); diff --git a/mod/invitefriends/index.php b/mod/invitefriends/index.php index 4b7637c97..7b4c34562 100644 --- a/mod/invitefriends/index.php +++ b/mod/invitefriends/index.php @@ -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); diff --git a/mod/members/index.php b/mod/members/index.php index 5a461d5e8..a4f21da13 100644 --- a/mod/members/index.php +++ b/mod/members/index.php @@ -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 diff --git a/mod/messages/index.php b/mod/messages/index.php index 16049f918..5b79a54ae 100644 --- a/mod/messages/index.php +++ b/mod/messages/index.php @@ -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 diff --git a/mod/messages/read.php b/mod/messages/read.php index 740011c3e..4e404de5c 100644 --- a/mod/messages/read.php +++ b/mod/messages/read.php @@ -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 diff --git a/mod/messages/send.php b/mod/messages/send.php index 359c38ae1..3e1baa496 100644 --- a/mod/messages/send.php +++ b/mod/messages/send.php @@ -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 diff --git a/mod/messages/sent.php b/mod/messages/sent.php index bb0746c80..89771d6b7 100644 --- a/mod/messages/sent.php +++ b/mod/messages/sent.php @@ -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); diff --git a/mod/notifications/groups.php b/mod/notifications/groups.php index 9b176955a..10e320032 100644 --- a/mod/notifications/groups.php +++ b/mod/notifications/groups.php @@ -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); diff --git a/mod/notifications/index.php b/mod/notifications/index.php index 209de9cd2..e0565959d 100644 --- a/mod/notifications/index.php +++ b/mod/notifications/index.php @@ -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); diff --git a/mod/pages/edit.php b/mod/pages/edit.php index d404e0433..dc290ea7d 100644 --- a/mod/pages/edit.php +++ b/mod/pages/edit.php @@ -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 diff --git a/mod/pages/history.php b/mod/pages/history.php index d39bf7ae0..d40dfaeb8 100644 --- a/mod/pages/history.php +++ b/mod/pages/history.php @@ -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); diff --git a/mod/pages/index.php b/mod/pages/index.php index 31f76f625..1d84587d5 100644 --- a/mod/pages/index.php +++ b/mod/pages/index.php @@ -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); diff --git a/mod/pages/new.php b/mod/pages/new.php index af1443d0a..2175572b2 100644 --- a/mod/pages/new.php +++ b/mod/pages/new.php @@ -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 diff --git a/mod/pages/view.php b/mod/pages/view.php index 83b8d69c1..6996c44e0 100644 --- a/mod/pages/view.php +++ b/mod/pages/view.php @@ -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 diff --git a/mod/pages/welcome.php b/mod/pages/welcome.php index 7a2a43abd..7db649253 100644 --- a/mod/pages/welcome.php +++ b/mod/pages/welcome.php @@ -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 diff --git a/mod/pages/world.php b/mod/pages/world.php index 35a17b1e6..d258ba157 100644 --- a/mod/pages/world.php +++ b/mod/pages/world.php @@ -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 diff --git a/mod/profile/edit.php b/mod/profile/edit.php index 12ce8564a..bef1cc094 100644 --- a/mod/profile/edit.php +++ b/mod/profile/edit.php @@ -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); diff --git a/mod/profile/editicon.php b/mod/profile/editicon.php index 4c19937b2..85b06cc17 100644 --- a/mod/profile/editicon.php +++ b/mod/profile/editicon.php @@ -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); diff --git a/mod/profile/index.php b/mod/profile/index.php index bf47d670c..7c9c0a3cc 100644 --- a/mod/profile/index.php +++ b/mod/profile/index.php @@ -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 diff --git a/mod/profile/start.php b/mod/profile/start.php index 6e9a43a68..1ba2e6dc5 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -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; } diff --git a/mod/reportedcontent/add.php b/mod/reportedcontent/add.php index 833ff38d1..1194627f1 100644 --- a/mod/reportedcontent/add.php +++ b/mod/reportedcontent/add.php @@ -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 diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php index b11dade19..8d650e1f5 100644 --- a/mod/riverdashboard/index.php +++ b/mod/riverdashboard/index.php @@ -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'); diff --git a/mod/search/index.php b/mod/search/index.php index 035401640..7f7be9860 100644 --- a/mod/search/index.php +++ b/mod/search/index.php @@ -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; diff --git a/mod/search/views/default/search/layout.php b/mod/search/views/default/search/layout.php index 732415f0e..82f191e8c 100644 --- a/mod/search/views/default/search/layout.php +++ b/mod/search/views/default/search/layout.php @@ -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 diff --git a/mod/sitepages/index.php b/mod/sitepages/index.php index f1f6585da..053f82996 100644 --- a/mod/sitepages/index.php +++ b/mod/sitepages/index.php @@ -36,6 +36,10 @@ $members = elgg_get_entities_from_metadata(array( //include sidebar free text
$sidebar = elgg_view('sitepages/sidebar');
$sidebar .= elgg_view('sitepages/members', array('members' => $members));
-
-$content = elgg_view_layout('frontpage', $content, $sidebar);
+
+$params = array(
+ 'content' => $content,
+ 'sidebar' => $sidebar
+);
+$content = elgg_view_layout('frontpage', $params);
echo elgg_view_page(null, $content);
diff --git a/mod/sitepages/sitepages_functions.php b/mod/sitepages/sitepages_functions.php index 38c793074..f1dfdd047 100644 --- a/mod/sitepages/sitepages_functions.php +++ b/mod/sitepages/sitepages_functions.php @@ -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; } diff --git a/mod/tagcloud/tagcloud.php b/mod/tagcloud/tagcloud.php index de384b25b..f5554ccba 100644 --- a/mod/tagcloud/tagcloud.php +++ b/mod/tagcloud/tagcloud.php @@ -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 diff --git a/mod/thewire/add.php b/mod/thewire/add.php index 3b71cc1d6..12d3f8d8d 100644 --- a/mod/thewire/add.php +++ b/mod/thewire/add.php @@ -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); diff --git a/mod/thewire/everyone.php b/mod/thewire/everyone.php index 74293d26f..dc6b47e71 100644 --- a/mod/thewire/everyone.php +++ b/mod/thewire/everyone.php @@ -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); diff --git a/mod/thewire/index.php b/mod/thewire/index.php index a1de242c5..36dc5ddab 100644 --- a/mod/thewire/index.php +++ b/mod/thewire/index.php @@ -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); diff --git a/pages/account/forgotten_password.php b/pages/account/forgotten_password.php index 3fb629ef6..1906a889e 100644 --- a/pages/account/forgotten_password.php +++ b/pages/account/forgotten_password.php @@ -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(); diff --git a/pages/account/register.php b/pages/account/register.php index 2638ef561..f18061dfc 100644 --- a/pages/account/register.php +++ b/pages/account/register.php @@ -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); diff --git a/pages/dashboard/index.php b/pages/dashboard/index.php index 4cd77aa55..ef3d987b1 100644 --- a/pages/dashboard/index.php +++ b/pages/dashboard/index.php @@ -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 diff --git a/pages/dashboard/latest.php b/pages/dashboard/latest.php index 3e8ddeefb..973a3f8be 100644 --- a/pages/dashboard/latest.php +++ b/pages/dashboard/latest.php @@ -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); diff --git a/pages/entities/index.php b/pages/entities/index.php index 91cbfad0a..a2cb22455 100644 --- a/pages/entities/index.php +++ b/pages/entities/index.php @@ -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; } diff --git a/pages/friends/add.php b/pages/friends/add.php index 5eb6608a6..23881b7c5 100644 --- a/pages/friends/add.php +++ b/pages/friends/add.php @@ -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); diff --git a/pages/friends/collections.php b/pages/friends/collections.php index a37ba3a43..80e472f66 100644 --- a/pages/friends/collections.php +++ b/pages/friends/collections.php @@ -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); diff --git a/pages/friends/edit.php b/pages/friends/edit.php index a56009472..94527a243 100644 --- a/pages/friends/edit.php +++ b/pages/friends/edit.php @@ -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 diff --git a/pages/friends/index.php b/pages/friends/index.php index 473e456c4..61169cc85 100644 --- a/pages/friends/index.php +++ b/pages/friends/index.php @@ -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); diff --git a/pages/friends/of.php b/pages/friends/of.php index 9e49ccfd4..b5d5829ad 100644 --- a/pages/friends/of.php +++ b/pages/friends/of.php @@ -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); diff --git a/pages/settings/plugins.php b/pages/settings/plugins.php index 671d0ff2c..657519d38 100644 --- a/pages/settings/plugins.php +++ b/pages/settings/plugins.php @@ -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); diff --git a/pages/settings/statistics.php b/pages/settings/statistics.php index 248dc8e50..741003308 100644 --- a/pages/settings/statistics.php +++ b/pages/settings/statistics.php @@ -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); diff --git a/pages/settings/user.php b/pages/settings/user.php index 6fd578ac9..2a530548c 100644 --- a/pages/settings/user.php +++ b/pages/settings/user.php @@ -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); diff --git a/services/export/handler.php b/services/export/handler.php index 81d4222e5..9f9f9a86a 100644 --- a/services/export/handler.php +++ b/services/export/handler.php @@ -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 diff --git a/views/default/canvas/default.php b/views/default/canvas/default.php index cfcee9484..60dc90b0d 100644 --- a/views/default/canvas/default.php +++ b/views/default/canvas/default.php @@ -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']; +} diff --git a/views/default/canvas/layouts/administration.php b/views/default/canvas/layouts/administration.php index 9b0144ade..0e18eb7e8 100644 --- a/views/default/canvas/layouts/administration.php +++ b/views/default/canvas/layouts/administration.php @@ -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"> diff --git a/views/default/canvas/layouts/one_column.php b/views/default/canvas/layouts/one_column.php index 67366efc6..e4a7845f5 100644 --- a/views/default/canvas/layouts/one_column.php +++ b/views/default/canvas/layouts/one_column.php @@ -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 diff --git a/views/default/canvas/layouts/one_column_with_sidebar.php b/views/default/canvas/layouts/one_column_with_sidebar.php index dff45a452..046c49997 100644 --- a/views/default/canvas/layouts/one_column_with_sidebar.php +++ b/views/default/canvas/layouts/one_column_with_sidebar.php @@ -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"> @@ -14,10 +17,14 @@ </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> diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php index 0c6fb7e88..4e6da8203 100644 --- a/views/default/js/initialise_elgg.php +++ b/views/default/js/initialise_elgg.php @@ -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'); } - ); - -}); - -}; diff --git a/views/default/messages/exceptions/exception.php b/views/default/messages/exceptions/exception.php index 6e66445a3..ecbd791e5 100644 --- a/views/default/messages/exceptions/exception.php +++ b/views/default/messages/exceptions/exception.php @@ -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 diff --git a/views/default/page_elements/sidebar.php b/views/default/page_elements/sidebar.php index 2706a23c5..8a5574da6 100644 --- a/views/default/page_elements/sidebar.php +++ b/views/default/page_elements/sidebar.php @@ -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']; |