From 51f65f6debcb86ed5b329aa79bf571d60f587468 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 4 Mar 2009 11:22:39 +0000 Subject: Added contentWrapper view git-svn-id: https://code.elgg.org/elgg/trunk@3063 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 13 ++++++++----- mod/groups/all.php | 5 ++--- mod/groups/edit.php | 2 +- mod/groups/groupprofile.php | 2 +- mod/groups/views/default/groups/contentwrapper.php | 5 +++++ mod/groups/views/rss/groups/contentwrapper.php | 5 +++++ views/default/page_elements/contentwrapper.php | 11 +++++++++++ views/rss/page_elements/contentwrapper.php | 5 +++++ 8 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 mod/groups/views/default/groups/contentwrapper.php create mode 100644 mod/groups/views/rss/groups/contentwrapper.php create mode 100644 views/default/page_elements/contentwrapper.php create mode 100644 views/rss/page_elements/contentwrapper.php diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 3b7735f9f..4aa0983db 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -620,18 +620,21 @@ $subtype = $entity->getSubtype(); if (empty($subtype)) { $subtype = $entity_type; } - + + $contents = ''; if (elgg_view_exists("{$entity_type}/{$subtype}")) { - return elgg_view("{$entity_type}/{$subtype}",array( + $contents = elgg_view("{$entity_type}/{$subtype}",array( 'entity' => $entity, 'full' => $full ), $bypass, $debug); - } else { - return elgg_view("{$entity_type}/default",array( + } + if (empty($contents)) { + $contents = elgg_view("{$entity_type}/default",array( 'entity' => $entity, 'full' => $full ), $bypass, $debug); - } + } + return $contents; } /** diff --git a/mod/groups/all.php b/mod/groups/all.php index 8036abc94..7a6be0596 100644 --- a/mod/groups/all.php +++ b/mod/groups/all.php @@ -59,9 +59,8 @@ set_context($context); $title = sprintf(elgg_echo("groups:all"),page_owner_entity()->name); - $area2 = elgg_view_title($title); - $area2 .= "
" . elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)); - $area2 .= $objects . "
"; + $area2 = elgg_view_title($title); + $area2 .= elgg_view('groups/contentwrapper', array('body' => elgg_view("groups/group_sort_menu", array("count" => $group_count, "filter" => $filter)) . $objects)); $body = elgg_view_layout('sidebar_boxes',$area1, $area2); // Finally draw the page diff --git a/mod/groups/edit.php b/mod/groups/edit.php index 848906dc8..da6477b9f 100644 --- a/mod/groups/edit.php +++ b/mod/groups/edit.php @@ -24,7 +24,7 @@ $body .= elgg_view("forms/groups/edit", array('entity' => $group)); } else { - $body .= "
" . elgg_echo('groups:noaccess') . "
"; + $body .= elgg_view('groups/contentwrapper',array('body' => elgg_echo('groups:noaccess'))); } $body = elgg_view_layout('two_column_left_sidebar', '', $body); diff --git a/mod/groups/groupprofile.php b/mod/groups/groupprofile.php index 7d84f5d25..aed1f2a9b 100644 --- a/mod/groups/groupprofile.php +++ b/mod/groups/groupprofile.php @@ -50,7 +50,7 @@ $title = elgg_echo('groups:notfound'); $area2 = elgg_view_title($title); - $area2 .= "
" . elgg_echo('groups:notfound:details') . "
"; + $area2 .= elgg_view('groups/contentwrapper',array('body' => elgg_echo('groups:notfound:details'))); $body = elgg_view_layout('two_column_left_sidebar', "", $area2,""); } diff --git a/mod/groups/views/default/groups/contentwrapper.php b/mod/groups/views/default/groups/contentwrapper.php new file mode 100644 index 000000000..384f08980 --- /dev/null +++ b/mod/groups/views/default/groups/contentwrapper.php @@ -0,0 +1,5 @@ +"
"
\ No newline at end of file diff --git a/mod/groups/views/rss/groups/contentwrapper.php b/mod/groups/views/rss/groups/contentwrapper.php new file mode 100644 index 000000000..640dd8104 --- /dev/null +++ b/mod/groups/views/rss/groups/contentwrapper.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/views/default/page_elements/contentwrapper.php b/views/default/page_elements/contentwrapper.php new file mode 100644 index 000000000..ff54a0b6e --- /dev/null +++ b/views/default/page_elements/contentwrapper.php @@ -0,0 +1,11 @@ +
+ +
\ No newline at end of file diff --git a/views/rss/page_elements/contentwrapper.php b/views/rss/page_elements/contentwrapper.php new file mode 100644 index 000000000..640dd8104 --- /dev/null +++ b/views/rss/page_elements/contentwrapper.php @@ -0,0 +1,5 @@ + \ No newline at end of file -- cgit v1.2.3