From 22bb75ea6cd36fc3f6b0f6be608aa4637063d29a Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sat, 12 Feb 2011 02:29:23 +0000 Subject: Fixes #2904: Converted most elgg_view('layout/objects/module') instances to elgg_view_module() git-svn-id: http://code.elgg.org/elgg/trunk@8135 36083f99-b078-4883-b0ff-0f9b5a30f544 --- documentation/theming/preview/objects.php | 28 ++++------------------ engine/lib/views.php | 8 ++----- mod/blog/views/default/blog/group_module.php | 8 +------ mod/blog/views/default/blog/sidebar/archives.php | 6 +---- mod/blog/views/default/blog/sidebar/revisions.php | 6 +---- mod/file/views/default/file/group_module.php | 8 +------ .../views/default/discussion/group_module.php | 8 +------ .../default/groups/profile/activity_module.php | 9 ++----- .../views/default/groups/sidebar/featured.php | 6 +---- mod/groups/views/default/groups/sidebar/find.php | 6 +---- .../views/default/groups/sidebar/members.php | 6 +---- mod/pages/views/default/pages/group_module.php | 8 +------ mod/pages/views/default/pages/sidebar/history.php | 7 +----- .../views/default/pages/sidebar/navigation.php | 6 +---- views/default/core/members/sidebar.php | 16 +++---------- views/default/core/river/body.php | 5 ++-- views/default/layout/elements/owner_block.php | 1 + views/default/layout/shells/admin/menu.php | 6 +---- views/default/layout/shells/two_sidebar.php | 2 +- views/default/output/tagcloud.php | 7 +----- 20 files changed, 28 insertions(+), 129 deletions(-) diff --git a/documentation/theming/preview/objects.php b/documentation/theming/preview/objects.php index 179178c5a..0dc08cd98 100644 --- a/documentation/theming/preview/objects.php +++ b/documentation/theming/preview/objects.php @@ -23,36 +23,16 @@ $url = current_page_url();
'elgg-module-aside', - 'body' => $ipsum, - 'class' => 'elgg-module-aside', - )); - ?> - 'elgg-module-popup', - 'body' => $ipsum, - 'class' => 'elgg-module-popup', - )); + echo elgg_view_module('aside', 'elgg-module-aside', $ipsum); + echo elgg_view_module('popup', 'elgg-module-popup', $ipsum); ?>
'elgg-module-info', - 'body' => $ipsum, - 'class' => 'elgg-module-info', - )); - ?> - 'elgg-module-featured', - 'body' => $ipsum, - 'class' => 'elgg-module-featured', - )); + echo elgg_view_module('info', 'elgg-module-info', $ipsum); + echo elgg_view_module('featured', 'elgg-module-featured', $ipsum); ?>
diff --git a/engine/lib/views.php b/engine/lib/views.php index 144a346f5..21d606e01 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1094,12 +1094,8 @@ function elgg_view_latest_comments($owner_guid, $type = 'object', $subtype = '', 'pagination' => false, 'list_class' => 'elgg-latest-comments', )); - $params = array( - 'title' => $title, - 'body' => $body, - 'class' => 'elgg-module-aside', - ); - return elgg_view('layout/objects/module', $params); + + return elgg_view_module('aside', $title, $body); } /** diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php index e56670316..8c3fc373f 100644 --- a/mod/blog/views/default/blog/group_module.php +++ b/mod/blog/views/default/blog/group_module.php @@ -40,10 +40,4 @@ $new_link = elgg_view('output/url', array( )); $content .= "$new_link"; - -$params = array( - 'header' => $header, - 'body' => $content, - 'class' => 'elgg-module-info', -); -echo elgg_view('layout/objects/module', $params); +echo elgg_view_module('info', '', $content, array('header' => $header)); diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php index bd74500ca..a76193831 100644 --- a/mod/blog/views/default/blog/sidebar/archives.php +++ b/mod/blog/views/default/blog/sidebar/archives.php @@ -25,10 +25,6 @@ if ($page_owner && $vars['page'] != 'friends') { } $content .= ''; - echo elgg_view('layout/objects/module', array( - 'title' => $title, - 'body' => $content, - 'class' => 'elgg-module-aside', - )); + echo elgg_view_module('aside', $title, $content); } } \ No newline at end of file diff --git a/mod/blog/views/default/blog/sidebar/revisions.php b/mod/blog/views/default/blog/sidebar/revisions.php index 1baf00037..b78eb6816 100644 --- a/mod/blog/views/default/blog/sidebar/revisions.php +++ b/mod/blog/views/default/blog/sidebar/revisions.php @@ -72,10 +72,6 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { $body .= ''; - echo elgg_view('layout/objects/module', array( - 'title' => $title, - 'body' => $body, - 'class' => 'elgg-module-aside', - )); + echo elgg_view_module('aside', $title, $body); } } \ No newline at end of file diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php index ebd07c2b2..8c80f297c 100644 --- a/mod/file/views/default/file/group_module.php +++ b/mod/file/views/default/file/group_module.php @@ -40,10 +40,4 @@ $new_link = elgg_view('output/url', array( )); $content .= "$new_link"; - -$params = array( - 'header' => $header, - 'body' => $content, - 'class' => 'elgg-module-info', -); -echo elgg_view('layout/objects/module', $params); +echo elgg_view_module('info', '', $content, array('header' => $header)); diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php index dd3a3e1cb..afe47ab68 100644 --- a/mod/groups/views/default/discussion/group_module.php +++ b/mod/groups/views/default/discussion/group_module.php @@ -43,10 +43,4 @@ $new_link = elgg_view('output/url', array( )); $content .= "$new_link"; - -$params = array( - 'header' => $header, - 'body' => $content, - 'class' => 'elgg-module-info', -); -echo elgg_view('layout/objects/module', $params); +echo elgg_view_module('info', '', $content, array('header' => $header)); diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php index 18bfbd596..58bf25095 100644 --- a/mod/groups/views/default/groups/profile/activity_module.php +++ b/mod/groups/views/default/groups/profile/activity_module.php @@ -36,12 +36,7 @@ if (!$content) { $content = '

' . elgg_echo('groups:activity:none') . '

'; } -$params = array( - 'header' => $header, - 'body' => $content, - 'class' => 'elgg-module-info', -); -echo elgg_view('layout/objects/module', $params); +echo elgg_view_module('info', '', $content, array('header' => $header)); return true; ?> @@ -63,7 +58,7 @@ return true; $items = get_data($sql); - if (count($items) > 0) { + if (count($items) > 0) { $river_items = elgg_view('river/item/list',array( 'limit' => $limit, 'offset' => $offset, diff --git a/mod/groups/views/default/groups/sidebar/featured.php b/mod/groups/views/default/groups/sidebar/featured.php index 46dc53abf..695782783 100644 --- a/mod/groups/views/default/groups/sidebar/featured.php +++ b/mod/groups/views/default/groups/sidebar/featured.php @@ -21,9 +21,5 @@ if ($featured_groups) { } elgg_pop_context(); - echo elgg_view('layout/objects/module', array( - 'title' => elgg_echo("groups:featured"), - 'body' => $body, - 'class' => 'elgg-module-aside', - )); + echo elgg_view_module('aside', elgg_echo("groups:featured"), $body); } diff --git a/mod/groups/views/default/groups/sidebar/find.php b/mod/groups/views/default/groups/sidebar/find.php index de2a6e740..0d31ee711 100644 --- a/mod/groups/views/default/groups/sidebar/find.php +++ b/mod/groups/views/default/groups/sidebar/find.php @@ -7,8 +7,4 @@ $url = elgg_get_site_url() . 'pg/groups/world'; $body = elgg_view_form('groups/search', array('action' => $url, 'method' => 'get')); -echo elgg_view('layout/objects/module', array( - 'title' => elgg_echo('groups:searchtag'), - 'body' => $body, - 'class' => 'elgg-module-aside', -)); +echo elgg_view_module('aside', elgg_echo('groups:searchtag'), $body); diff --git a/mod/groups/views/default/groups/sidebar/members.php b/mod/groups/views/default/groups/sidebar/members.php index 597ddc07c..711b99f34 100644 --- a/mod/groups/views/default/groups/sidebar/members.php +++ b/mod/groups/views/default/groups/sidebar/members.php @@ -18,8 +18,4 @@ foreach ($members as $mem) { $body .= ''; $body .= "
$all_link
"; -echo elgg_view('layout/objects/module', array( - 'title' => elgg_echo("groups:members"), - 'body' => $body, - 'class' => 'elgg-module-aside', -)); +echo elgg_view_module('aside', elgg_echo('groups:members'), $body); \ No newline at end of file diff --git a/mod/pages/views/default/pages/group_module.php b/mod/pages/views/default/pages/group_module.php index 1cf36067e..c41de043d 100644 --- a/mod/pages/views/default/pages/group_module.php +++ b/mod/pages/views/default/pages/group_module.php @@ -43,10 +43,4 @@ $new_link = elgg_view('output/url', array( )); $content .= "$new_link"; - -$params = array( - 'header' => $header, - 'body' => $content, - 'class' => 'elgg-module-info', -); -echo elgg_view('layout/objects/module', $params); +echo elgg_view_module('info', '', $content, array('header' => $header)); diff --git a/mod/pages/views/default/pages/sidebar/history.php b/mod/pages/views/default/pages/sidebar/history.php index 3c0b7bc14..dad06ab4f 100644 --- a/mod/pages/views/default/pages/sidebar/history.php +++ b/mod/pages/views/default/pages/sidebar/history.php @@ -11,9 +11,4 @@ if ($vars['page']) { $content = $content = list_annotations($vars['page']->guid, 'page', 20, false); } -echo elgg_view('layout/objects/module', array( - 'title' => $title, - 'body' => $content, - 'class' => 'elgg-module-aside', -)); - +echo elgg_view_module('aside', $title, $content); \ No newline at end of file diff --git a/mod/pages/views/default/pages/sidebar/navigation.php b/mod/pages/views/default/pages/sidebar/navigation.php index cbf21c058..43790a976 100644 --- a/mod/pages/views/default/pages/sidebar/navigation.php +++ b/mod/pages/views/default/pages/sidebar/navigation.php @@ -19,11 +19,7 @@ if (!$content) { $content = '

' . elgg_echo('pages:none') . '

'; } -echo elgg_view('layout/objects/module', array( - 'title' => $title, - 'body' => $content, - 'class' => 'elgg-module-aside', -)); +echo elgg_view_module('aside', $title, $content); ?>