From 6ccf524f48df49ed97a2c0c051f0276a377b9f48 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 14 Jan 2011 02:14:20 +0000 Subject: finished discussion rewrite to use new html/css git-svn-id: http://code.elgg.org/elgg/trunk@7881 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/discussion/group_module.php | 51 ++++++++++++++++++++ mod/groups/views/default/forum/maintopic.php | 55 ---------------------- mod/groups/views/default/forum/topics.php | 25 ---------- mod/groups/views/default/forum/viewposts.php | 47 ------------------ .../views/default/groups/profile/forum_widget.php | 51 -------------------- .../views/default/groups/profile/widgets.php | 5 -- .../views/default/object/groupforumtopic.php | 22 +++++++-- 7 files changed, 70 insertions(+), 186 deletions(-) create mode 100644 mod/groups/views/default/discussion/group_module.php delete mode 100644 mod/groups/views/default/forum/maintopic.php delete mode 100644 mod/groups/views/default/forum/topics.php delete mode 100644 mod/groups/views/default/forum/viewposts.php delete mode 100644 mod/groups/views/default/groups/profile/forum_widget.php (limited to 'mod/groups/views/default') diff --git a/mod/groups/views/default/discussion/group_module.php b/mod/groups/views/default/discussion/group_module.php new file mode 100644 index 000000000..b42084655 --- /dev/null +++ b/mod/groups/views/default/discussion/group_module.php @@ -0,0 +1,51 @@ +forum_enable == 'no') { + return true; +} + +$group = $vars['entity']; + + +$all_link = elgg_view('output/url', array( + 'href' => "pg/discussion/owner/$group->guid", + 'text' => elgg_echo('link:view:all'), +)); + +$header = "$all_link"; +$header .= '

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

'; + + +elgg_push_context('widgets'); +$options = array( + 'type' => 'object', + 'subtype' => 'groupforumtopic', + 'container_guid' => $group->getGUID(), + 'limit' => 6, + 'full_view' => false, + 'pagination' => false, +); +$content = elgg_list_entities($options); +elgg_pop_context(); + +if (!$content) { + $content = '

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

'; +} + +$new_link = elgg_view('output/url', array( + 'href' => "pg/discussion/add/" . $group->getGUID(), + 'text' => elgg_echo('groups:addtopic'), +)); +$content .= "$new_link"; + + +$params = array( + 'header' => $header, + 'body' => $content, +); +echo elgg_view('layout/objects/module', $params); diff --git a/mod/groups/views/default/forum/maintopic.php b/mod/groups/views/default/forum/maintopic.php deleted file mode 100644 index 7031c7418..000000000 --- a/mod/groups/views/default/forum/maintopic.php +++ /dev/null @@ -1,55 +0,0 @@ - - -
- - owner_guid)) { - // display the user icon - echo "
" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'tiny')) . "
"; - // display the user name - echo "
"; - // if comment owner, group owner, or site admin - display edit and delete options - if (groups_can_edit_discussion($vars['entity'], elgg_get_page_owner()->owner_guid)) { - echo ""; - - } - - echo "

" . $post_owner->name . "

"; - } else { - echo "
"; - echo "

" . elgg_echo('profile:deleteduser') . "

"; - } - - //display the date of the comment - echo "

" . elgg_view_friendly_time($vars['entity']->time_created) . "

"; - echo "
"; // close entity-listing-info - echo "
"; // close entity-listing.topic - - //display the actual message posted - echo "
"; - echo parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->description))); - echo "
"; -?> - - \ No newline at end of file diff --git a/mod/groups/views/default/forum/topics.php b/mod/groups/views/default/forum/topics.php deleted file mode 100644 index e67294c72..000000000 --- a/mod/groups/views/default/forum/topics.php +++ /dev/null @@ -1,25 +0,0 @@ - - -
-
-

-
- isMember(get_loggedin_user())) { - ?> -
- -
- -
-". elgg_echo("grouptopic:notcreated") . "

"; \ No newline at end of file diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php deleted file mode 100644 index 3c9da1258..000000000 --- a/mod/groups/views/default/forum/viewposts.php +++ /dev/null @@ -1,47 +0,0 @@ -name, $group->getURL()); -elgg_push_breadcrumb(elgg_echo('item:object:groupforumtopic'), elgg_get_site_url()."pg/groups/forum/{$vars['entity']->container_guid}"); -elgg_push_breadcrumb($vars['entity']->title); - -echo elgg_view('navigation/breadcrumbs'); -*/ - -//display follow up comments -$count = $vars['entity']->countAnnotations('group_topic_post'); -$offset = (int) get_input('offset',0); - -$baseurl = elgg_get_site_url() . "mod/groups/topicposts.php?topic={$vars['entity']->guid}&group_guid={$vars['entity']->container_guid}"; -echo elgg_view('navigation/pagination',array( - 'limit' => 50, - 'offset' => $offset, - 'baseurl' => $baseurl, - 'count' => $count, - )); - -?> - $vars['entity'])); - - // check to find out the status of the topic and act - if($vars['entity']->status == "closed") { - echo elgg_view_comments($vars['entity'], false); - //this topic has been closed by the owner - echo "

" . elgg_echo("groups:topicisclosed") . "

"; - echo "

" . elgg_echo("groups:topiccloseddesc") . "

"; - - }elseif(elgg_get_page_owner()->isMember(get_loggedin_user())){ - //comments are on and the user viewing is a member - echo elgg_view_comments($vars['entity']); - }else{ - //the user is not a member so cannot post a comment - echo elgg_view_comments($vars['entity'], false); - } diff --git a/mod/groups/views/default/groups/profile/forum_widget.php b/mod/groups/views/default/groups/profile/forum_widget.php deleted file mode 100644 index 969eb0559..000000000 --- a/mod/groups/views/default/groups/profile/forum_widget.php +++ /dev/null @@ -1,51 +0,0 @@ -forum_enable == 'no') { - return true; -} - -$group = $vars['entity']; - - -$all_link = elgg_view('output/url', array( - 'href' => "pg/discussion/owner/$group->guid", - 'text' => elgg_echo('link:view:all'), -)); - -$header = "$all_link"; -$header .= '

' . elgg_echo('groups:latestdiscussion') . '

'; - - -elgg_push_context('widgets'); -$options = array( - 'type' => 'object', - 'subtype' => 'groupforumtopic', - 'container_guid' => $group->getGUID(), - 'limit' => 6, - 'full_view' => false, - 'pagination' => false, -); -$content = elgg_list_entities($options); -elgg_pop_context(); - -if (!$content) { - $content = '

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

'; -} - -$new_link = elgg_view('output/url', array( - 'href' => "pg/discussion/add/" . $group->getGUID(), - 'text' => elgg_echo('groups:addtopic'), -)); -$content .= "$new_link"; - - -$params = array( - 'header' => $header, - 'body' => $content, -); -echo elgg_view('layout/objects/module', $params); diff --git a/mod/groups/views/default/groups/profile/widgets.php b/mod/groups/views/default/groups/profile/widgets.php index af558c90d..3e28c0091 100644 --- a/mod/groups/views/default/groups/profile/widgets.php +++ b/mod/groups/views/default/groups/profile/widgets.php @@ -12,11 +12,6 @@ echo "
"; echo "
"; echo elgg_view("groups/profile/activity_widget", array('entity' => $vars['entity'])); echo "
"; - - // forum latest - //echo "
"; - echo elgg_view("groups/profile/forum_widget", array('entity' => $vars['entity'])); - //echo "
"; // enable tools to extend this area echo elgg_view("groups/tool_latest", array('entity' => $vars['entity'])); diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index a89419931..c6f9da4b4 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -//$full = elgg_get_array_value('full', $vars, FALSE); +$full = elgg_get_array_value('full', $vars, FALSE); $topic = elgg_get_array_value('entity', $vars, FALSE); if (!$topic) { @@ -46,17 +46,33 @@ $metadata = elgg_view('layout/objects/list/metadata', array( 'handler' => 'discussion', )); -$subtitle = "$poster_text $date $comments_link $comments_text"; - // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { $metadata = ''; } if ($full) { + $subtitle = "$poster_text $date $comments_link"; + + $params = array( + 'entity' => $topic, + 'title' => false, + 'metadata' => $metadata, + 'subtitle' => $subtitle, + 'tags' => $tags, + ); + $list_body = elgg_view('layout/objects/list/body', $params); + + $info = elgg_view_image_block($poster_icon, $list_body); + echo <<$comments_text"; $params = array( 'entity' => $topic, -- cgit v1.2.3