From 1fd8bd6e296e2b1fc960fde1dd204b6c4e3e8aec Mon Sep 17 00:00:00 2001 From: Evan Winslow Date: Wed, 8 Jun 2011 02:31:30 -0700 Subject: River revamp for 1.8 --- .../views/default/river/object/blog/create.php | 30 +++------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'mod/blog/views/default') diff --git a/mod/blog/views/default/river/object/blog/create.php b/mod/blog/views/default/river/object/blog/create.php index bd2405d42..613cbb165 100644 --- a/mod/blog/views/default/river/object/blog/create.php +++ b/mod/blog/views/default/river/object/blog/create.php @@ -7,29 +7,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = strip_tags($object->excerpt); $excerpt = elgg_get_excerpt($excerpt); -$params = array( - 'href' => $object->getURL(), - 'text' => $object->title, -); -$link = elgg_view('output/url', $params); - -$group_string = ''; -$container = $object->getContainerEntity(); -if ($container instanceof ElggGroup) { - $params = array( - 'href' => $container->getURL(), - 'text' => $container->name, - ); - $group_link = elgg_view('output/url', $params); - $group_string = elgg_echo('river:ingroup', array($group_link)); -} - -echo elgg_echo('blog:river:create'); - -echo " $link $group_string"; - -if ($excerpt) { - echo '
'; - echo $excerpt; - echo '
'; -} +echo elgg_view('river/item', array( + 'item' => $vars['item'], + 'message' => $excerpt, +)); \ No newline at end of file -- cgit v1.2.3 From 0594a363ae77c5427eb96a8753e644897fdc5491 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 24 Jun 2011 21:03:45 -0400 Subject: Fixes #3139 DRYs up group modules --- mod/blog/views/default/blog/group_module.php | 22 ++++++++++------------ .../views/default/bookmarks/group_module.php | 21 ++++++++++----------- mod/file/views/default/file/group_module.php | 22 ++++++++++------------ .../views/default/discussion/group_module.php | 22 ++++++++++------------ .../default/groups/profile/activity_module.php | 11 ++++++----- mod/groups/views/default/groups/profile/module.php | 20 ++++++++++++++++++++ mod/pages/views/default/pages/group_module.php | 21 ++++++++++----------- 7 files changed, 76 insertions(+), 63 deletions(-) create mode 100644 mod/groups/views/default/groups/profile/module.php (limited to 'mod/blog/views/default') diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php index 6cfe6c98e..d769fbd59 100644 --- a/mod/blog/views/default/blog/group_module.php +++ b/mod/blog/views/default/blog/group_module.php @@ -14,10 +14,6 @@ $all_link = elgg_view('output/url', array( 'text' => elgg_echo('link:view:all'), )); -$header = "$all_link"; -$header .= '

' . elgg_echo('blog:group') . '

'; - - elgg_push_context('widgets'); $options = array( 'type' => 'object', @@ -34,12 +30,14 @@ if (!$content) { $content = '

' . elgg_echo('blog:none') . '

'; } -if ($group->canWriteToContainer()) { - $new_link = elgg_view('output/url', array( - 'href' => "blog/add/$group->guid", - 'text' => elgg_echo('blog:write'), - )); - $content .= "$new_link"; -} +$new_link = elgg_view('output/url', array( + 'href' => "blog/add/$group->guid", + 'text' => elgg_echo('blog:write'), +)); -echo elgg_view_module('info', '', $content, array('header' => $header)); +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('blog:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php index 3166fc0f0..3797de010 100644 --- a/mod/bookmarks/views/default/bookmarks/group_module.php +++ b/mod/bookmarks/views/default/bookmarks/group_module.php @@ -16,9 +16,6 @@ $all_link = elgg_view('output/url', array( 'text' => elgg_echo('link:view:all'), )); -$header = "$all_link"; -$header .= '

' . elgg_echo('bookmarks:group') . '

'; - elgg_push_context('widgets'); $options = array( 'type' => 'object', @@ -35,12 +32,14 @@ if (!$content) { $content = '

' . elgg_echo('bookmarks:none') . '

'; } -if ($group->canWriteToContainer()) { - $new_link = elgg_view('output/url', array( - 'href' => "bookmarks/add/$group->guid", - 'text' => elgg_echo('bookmarks:add'), - )); - $content .= "$new_link"; -} +$new_link = elgg_view('output/url', array( + 'href' => "bookmarks/add/$group->guid", + 'text' => elgg_echo('bookmarks:add'), +)); -echo elgg_view_module('info', '', $content, array('header' => $header)); +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('bookmarks:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php index 830b1096c..c37b13927 100644 --- a/mod/file/views/default/file/group_module.php +++ b/mod/file/views/default/file/group_module.php @@ -14,10 +14,6 @@ $all_link = elgg_view('output/url', array( 'text' => elgg_echo('link:view:all'), )); -$header = "$all_link"; -$header .= '

' . elgg_echo('file:group') . '

'; - - elgg_push_context('widgets'); $options = array( 'type' => 'object', @@ -34,12 +30,14 @@ if (!$content) { $content = '

' . elgg_echo('file:none') . '

'; } -if ($group->canWriteToContainer()) { - $new_link = elgg_view('output/url', array( - 'href' => "file/add/$group->guid", - 'text' => elgg_echo('file:add'), - )); - $content .= "$new_link"; -} +$new_link = elgg_view('output/url', array( + 'href' => "file/add/$group->guid", + 'text' => elgg_echo('file:add'), +)); -echo elgg_view_module('info', '', $content, array('header' => $header)); +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('file:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php index 165d9b1be..3a46e336e 100644 --- a/mod/groups/views/default/discussion/group_module.php +++ b/mod/groups/views/default/discussion/group_module.php @@ -17,10 +17,6 @@ $all_link = elgg_view('output/url', array( 'text' => elgg_echo('link:view:all'), )); -$header = "$all_link"; -$header .= '

' . elgg_echo('discussion:group') . '

'; - - elgg_push_context('widgets'); $options = array( 'type' => 'object', @@ -37,12 +33,14 @@ if (!$content) { $content = '

' . elgg_echo('grouptopic:notcreated') . '

'; } -if ($group->canWriteToContainer()) { - $new_link = elgg_view('output/url', array( - 'href' => "discussion/add/" . $group->getGUID(), - 'text' => elgg_echo('groups:addtopic'), - )); - $content .= "$new_link"; -} +$new_link = elgg_view('output/url', array( + 'href' => "discussion/add/" . $group->getGUID(), + 'text' => elgg_echo('groups:addtopic'), +)); -echo elgg_view_module('info', '', $content, array('header' => $header)); +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('discussion:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); \ No newline at end of file diff --git a/mod/groups/views/default/groups/profile/activity_module.php b/mod/groups/views/default/groups/profile/activity_module.php index 4ea97cad6..5e557b443 100644 --- a/mod/groups/views/default/groups/profile/activity_module.php +++ b/mod/groups/views/default/groups/profile/activity_module.php @@ -21,16 +21,13 @@ $all_link = elgg_view('output/url', array( 'text' => elgg_echo('link:view:all'), )); -$header = "$all_link"; -$header .= '

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

'; - elgg_push_context('widgets'); $db_prefix = elgg_get_config('dbprefix'); $content = elgg_list_river(array( 'limit' => 4, 'pagination' => false, - 'joins' => array("join {$db_prefix}entities e1 on e1.guid = rv.object_guid"), + 'joins' => array("JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid"), 'wheres' => array("(e1.container_guid = $group->guid)"), )); elgg_pop_context(); @@ -39,4 +36,8 @@ if (!$content) { $content = '

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

'; } -echo elgg_view_module('info', '', $content, array('header' => $header)); +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('groups:activity'), + 'content' => $content, + 'all_link' => $all_link, +)); diff --git a/mod/groups/views/default/groups/profile/module.php b/mod/groups/views/default/groups/profile/module.php new file mode 100644 index 000000000..69854e59b --- /dev/null +++ b/mod/groups/views/default/groups/profile/module.php @@ -0,0 +1,20 @@ +{$vars['all_link']}"; +$header .= '

' . $vars['title'] . '

'; + +if ($group->canWriteToContainer() && isset($vars['add_link'])) { + $vars['content'] .= "{$vars['add_link']}"; +} + +echo elgg_view_module('info', '', $vars['content'], array('header' => $header)); diff --git a/mod/pages/views/default/pages/group_module.php b/mod/pages/views/default/pages/group_module.php index 1d3437e18..7e2656ca3 100644 --- a/mod/pages/views/default/pages/group_module.php +++ b/mod/pages/views/default/pages/group_module.php @@ -17,9 +17,6 @@ $all_link = elgg_view('output/url', array( 'text' => elgg_echo('link:view:all'), )); -$header = "$all_link"; -$header .= '

' . elgg_echo('pages:group') . '

'; - elgg_push_context('widgets'); $options = array( @@ -37,12 +34,14 @@ if (!$content) { $content = '

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

'; } -if ($group->canWriteToContainer()) { - $new_link = elgg_view('output/url', array( - 'href' => "pages/add/$group->guid", - 'text' => elgg_echo('pages:add'), - )); - $content .= "$new_link"; -} +$new_link = elgg_view('output/url', array( + 'href' => "pages/add/$group->guid", + 'text' => elgg_echo('pages:add'), +)); -echo elgg_view_module('info', '', $content, array('header' => $header)); +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('pages:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); -- cgit v1.2.3 From 64dcaa8cdc75669974501eb0627a5d5b348deb29 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 26 Jun 2011 07:07:27 -0400 Subject: Fixes #3368 combining $vars with parameters for object/elements/summary view --- mod/blog/views/default/object/blog.php | 2 ++ mod/bookmarks/views/default/object/bookmarks.php | 4 +++- mod/file/views/default/object/file.php | 2 ++ mod/groups/views/default/group/default.php | 1 + mod/groups/views/default/object/groupforumtopic.php | 2 ++ mod/pages/views/default/object/page_top.php | 2 ++ mod/thewire/views/default/object/thewire.php | 1 + views/default/object/default.php | 1 + views/default/object/elements/summary.php | 6 +++--- 9 files changed, 17 insertions(+), 4 deletions(-) (limited to 'mod/blog/views/default') diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 8456829fe..ba08180b1 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -74,6 +74,7 @@ if ($full) { 'subtitle' => $subtitle, 'tags' => $tags, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); $blog_info = elgg_view_image_block($owner_icon, $list_body); @@ -94,6 +95,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($owner_icon, $list_body); diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index 38b0a721a..ca1f5d312 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -65,6 +65,7 @@ if ($full && !elgg_in_context('gallery')) { 'subtitle' => $subtitle, 'tags' => $tags, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); $bookmark_info = elgg_view_image_block($owner_icon, $list_body); @@ -118,7 +119,8 @@ HTML; 'tags' => $tags, 'content' => $content, ); - + $params = $params + $vars; $body = elgg_view('object/elements/summary', $params); + echo elgg_view_image_block($owner_icon, $body); } \ No newline at end of file diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index c6ac2a429..95e190d35 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -76,6 +76,7 @@ if ($full && !elgg_in_context('gallery')) { 'subtitle' => $subtitle, 'tags' => $tags, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); $file_info = elgg_view_image_block($file_icon, $list_body); @@ -104,6 +105,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($file_icon, $list_body); diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php index 2aa377813..fc91f90d0 100644 --- a/mod/groups/views/default/group/default.php +++ b/mod/groups/views/default/group/default.php @@ -31,6 +31,7 @@ if ($vars['full_view']) { 'metadata' => $metadata, 'subtitle' => $group->briefdescription, ); + $params = $params + $vars; $list_body = elgg_view('group/elements/summary', $params); echo elgg_view_image_block($icon, $list_body); diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index 3a4decbe4..22589b84d 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -67,6 +67,7 @@ if ($full) { 'subtitle' => $subtitle, 'tags' => $tags, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); $info = elgg_view_image_block($poster_icon, $list_body); @@ -90,6 +91,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($poster_icon, $list_body); diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php index 2ad44e38c..8ba9fc298 100644 --- a/mod/pages/views/default/object/page_top.php +++ b/mod/pages/views/default/object/page_top.php @@ -82,6 +82,7 @@ if ($full) { 'subtitle' => $subtitle, 'tags' => $tags, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); $info = elgg_view_image_block($page_icon, $list_body); @@ -103,6 +104,7 @@ HTML; 'tags' => $tags, 'content' => $excerpt, ); + $params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($page_icon, $list_body); diff --git a/mod/thewire/views/default/object/thewire.php b/mod/thewire/views/default/object/thewire.php index 3ae347711..2727df60d 100644 --- a/mod/thewire/views/default/object/thewire.php +++ b/mod/thewire/views/default/object/thewire.php @@ -51,6 +51,7 @@ $params = array( 'content' => thewire_filter($post->description), 'tags' => false, ); +$params = $params + $vars; $list_body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($owner_icon, $list_body); diff --git a/views/default/object/default.php b/views/default/object/default.php index 27bb1890e..a50f19387 100644 --- a/views/default/object/default.php +++ b/views/default/object/default.php @@ -42,6 +42,7 @@ $params = array( 'subtitle' => $subtitle, 'tags' => $vars['entity']->tags, ); +$params = $params + $vars; $body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($icon, $body); diff --git a/views/default/object/elements/summary.php b/views/default/object/elements/summary.php index 9206ada66..10cf0b148 100644 --- a/views/default/object/elements/summary.php +++ b/views/default/object/elements/summary.php @@ -3,15 +3,15 @@ * Object summary * * Sample output - * + *
  • Public
  • Like this
*

Title

*

Posted 3 hours ago by George

*

one, two

- *
Excerpt text
+ *
Excerpt text
* * @uses $vars['entity'] ElggEntity * @uses $vars['title'] Title link (optional) false = no title, '' = default - * @uses $vars['metadata'] HTML for entity metadata and actions (optional) + * @uses $vars['metadata'] HTML for entity menu and metadata (optional) * @uses $vars['subtitle'] HTML for the subtitle (optional) * @uses $vars['tags'] HTML for the tags (optional) * @uses $vars['content'] HTML for the entity content (optional) -- cgit v1.2.3 From d450c043eeabbe5d0d5466cba59045fd3a1888c9 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 27 Jun 2011 07:26:16 -0400 Subject: Refs #3407 using elgg-form and elgg-foot in core forms. Plugins next --- mod/blog/lib/blog.php | 1 + mod/blog/views/default/forms/blog/save.php | 2 +- mod/groups/lib/groups.php | 2 +- mod/groups/views/default/forms/groups/edit.php | 2 +- mod/groups/views/default/forms/groups/invite.php | 2 +- mod/groups/views/default/groups/edit.php | 5 ++++- .../views/default/forms/notificationsettings/save.php | 7 ++++++- .../views/default/notifications/subscriptions/form.php | 2 +- .../default/notifications/subscriptions/forminternals.php | 8 -------- views/default/core/settings/account.php | 2 +- views/default/css/elements/forms.php | 4 +--- views/default/forms/avatar/crop.php | 2 +- views/default/forms/avatar/upload.php | 2 +- views/default/forms/comments/add.php | 2 +- views/default/forms/friends/collections/add.php | 4 ++-- views/default/forms/plugins/settings/save.php | 4 ++-- views/default/forms/profile/edit.php | 2 +- views/default/forms/user/requestnewpassword.php | 2 +- views/default/forms/useradd.php | 2 +- views/default/forms/usersettings/save.php | 2 +- views/default/forms/widgets/save.php | 2 +- views/default/input/form.php | 15 ++++++++++++--- 22 files changed, 42 insertions(+), 34 deletions(-) (limited to 'mod/blog/views/default') diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index d13b2244e..0f81597eb 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -262,6 +262,7 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) { $vars = array(); $vars['id'] = 'blog-post-edit'; $vars['name'] = 'blog_post'; + $vars['class'] = 'elgg-form-alt'; if ($page == 'edit') { $blog = get_entity((int)$guid); diff --git a/mod/blog/views/default/forms/blog/save.php b/mod/blog/views/default/forms/blog/save.php index d99f45f01..79309b6ef 100644 --- a/mod/blog/views/default/forms/blog/save.php +++ b/mod/blog/views/default/forms/blog/save.php @@ -150,7 +150,7 @@ $body_input $categories_input -