aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default/forum
diff options
context:
space:
mode:
authorpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-10 17:13:37 +0000
committerpete <pete@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-10 17:13:37 +0000
commit409331a459355fb827aa33acf3275f3d618a2510 (patch)
treec300483fe791a99a4e6890cf507ddf7c9843078d /mod/groups/views/default/forum
parent755367a31d3c1dbc1cc24ce270a217d2390cbe44 (diff)
downloadelgg-409331a459355fb827aa33acf3275f3d618a2510.tar.gz
elgg-409331a459355fb827aa33acf3275f3d618a2510.tar.bz2
Updated Groups to the new interface. Some view clean-up & simplification done.
git-svn-id: http://code.elgg.org/elgg/trunk@5348 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default/forum')
-rw-r--r--mod/groups/views/default/forum/topicposts.php140
-rw-r--r--mod/groups/views/default/forum/topics.php30
-rw-r--r--mod/groups/views/default/forum/viewposts.php14
3 files changed, 81 insertions, 103 deletions
diff --git a/mod/groups/views/default/forum/topicposts.php b/mod/groups/views/default/forum/topicposts.php
index 20a545eec..61bca298a 100644
--- a/mod/groups/views/default/forum/topicposts.php
+++ b/mod/groups/views/default/forum/topicposts.php
@@ -15,92 +15,64 @@
?>
- <div class="topic_post"><!-- start the topic_post -->
+<div class="entity_listing topic clearfloat">
+<a name="<?php echo $vars['entity']->id; ?>"></a>
+ <?php
+ // get infomation about the owner of the comment
+ if ($post_owner = get_user($vars['entity']->owner_guid)) {
+ // display the user icon
+ echo "<div class='entity_listing_icon'>" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'tiny')) . "</div>";
+ // display the user name
+ echo "<div class='entity_listing_info'>";
+ // if comment owner, group owner, or site admin - display edit and delete options
+ if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
+ echo "<div class='entity_metadata'>";
+ echo "<div class='delete_button'>".elgg_view("output/confirmlink",array(
+ 'href' => $vars['url'] . "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'),
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm')
+ ))."</div>";
+ echo "<a class='link' onclick=\"elgg_slide_toggle(this,'.topic','.edit_comment');\">".elgg_echo('edit')."</a>";
+ echo "</div>";
+
+ }
+
+ echo "<p class='entity_title'>" . $post_owner->name . "</p>";
+ } else {
+ echo "<div class='entity_listing_icon'><img src=\"" . elgg_view('icon/user/default/tiny') . "\" /></div>";
+ echo "<div class='entity_listing_info'><p class='entity_title'>" . elgg_echo('profile:deleteduser') . "</p>";
+ }
- <table width="100%">
- <tr>
- <td>
- <a name="<?php echo $vars['entity']->id; ?>"></a>
- <?php
- //get infomation about the owner of the comment
- if ($post_owner = get_user($vars['entity']->owner_guid)) {
-
- //display the user icon
- echo "<div class=\"post_icon\">" . elgg_view("profile/icon",array('entity' => $post_owner, 'size' => 'small')) . "</div>";
-
- //display the user name
- echo "<p><b>" . $post_owner->name . "</b><br />";
-
- } else {
- echo "<div class=\"post_icon\"><img src=\"" . elgg_view('icon/user/default/small') . "\" /></div>";
- echo "<p><b>" . elgg_echo('profile:deleteduser') . "</b><br />";
- }
-
- //display the date of the comment
- echo "<small>" . friendly_time($vars['entity']->time_created) . "</small></p>";
- ?>
- </td>
- <td width="70%">
- <?php
- //display the actual message posted
- echo parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->value)));
- ?>
- </td>
- </tr>
- </table>
- <?php
+ //display the date of the comment
+ echo "<p class='entity_subtext'>" . friendly_time($vars['entity']->time_created) . "</p>";
- //if the comment owner is looking at it, or admin, or group owner they can edit
- if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
- ?>
- <p class="topic-post-menu">
- <?php
-
- echo elgg_view("output/confirmlink",array(
- 'href' => $vars['url'] . "action/groups/deletepost?post=" . $vars['entity']->id . "&topic=" . get_input('topic') . "&group=" . get_input('group_guid'),
- 'text' => elgg_echo('delete'),
- 'confirm' => elgg_echo('deleteconfirm'),
- ));
-
- //display an edit link that will open up an edit area
- echo " <a class=\"collapsibleboxlink\">".elgg_echo('edit')."</a>";
- echo "<div class=\"collapsible_box\">";
- //get the edit form and details
- $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
- $text_textarea = elgg_view('input/longtext', array('internalname' => 'postComment'.$vars['entity']->id, 'value' => $vars['entity']->value));
- $post = elgg_view('input/hidden', array('internalname' => 'post', 'value' => $vars['entity']->id));
- $field = elgg_view('input/hidden', array('internalname' => 'field_num', 'value' => $vars['entity']->id));
- $topic = elgg_view('input/hidden', array('internalname' => 'topic', 'value' => get_input('topic')));
- $group = elgg_view('input/hidden', array('internalname' => 'group', 'value' => get_input('group_guid')));
-
- $form_body = <<<EOT
-
- <div class='edit_forum_comments'>
- <p class='longtext_editarea'>
- $text_textarea
- </p>
- $post
- $topic
- $group
- $field
- <p>
- $submit_input
- </p>
-
- </div>
-
-EOT;
-
-?>
+ //display the actual message posted
+ echo parse_urls(elgg_view("output/longtext",array("value" => $vars['entity']->value)));
- <?php
- echo elgg_view('input/form', array('action' => "{$vars['url']}action/groups/editpost", 'body' => $form_body, 'internalid' => 'editforumpostForm'));
- ?>
- </div>
- </p>
+ // if comment owner, group owner, or site admin - display edit-form
+ if (groups_can_edit_discussion($vars['entity'], page_owner_entity()->owner_guid)) {
+ //get the edit form and details
+ $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
+ $text_textarea = elgg_view('input/longtext', array('internalname' => 'postComment'.$vars['entity']->id, 'value' => $vars['entity']->value));
+ $post = elgg_view('input/hidden', array('internalname' => 'post', 'value' => $vars['entity']->id));
+ $field = elgg_view('input/hidden', array('internalname' => 'field_num', 'value' => $vars['entity']->id));
+ $topic = elgg_view('input/hidden', array('internalname' => 'topic', 'value' => get_input('topic')));
+ $group = elgg_view('input/hidden', array('internalname' => 'group', 'value' => get_input('group_guid')));
+
+ $form_body = <<<EOT
- <?php
- }
- ?>
+ <p class='longtext_editarea'>$text_textarea</p>
+ $post
+ $topic
+ $group
+ $field
+ $submit_input
+EOT;
+ echo "<div class='edit_comment margin_top hidden'>";
+ echo elgg_view('input/form', array('action' => "{$vars['url']}action/groups/editpost", 'body' => $form_body, 'internalid' => 'editforumpostForm'));
+ echo "</div>";
+ }
+ echo "</div>"; // close entity_listing_info
+?>
- </div><!-- end the topic_post --> \ No newline at end of file
+</div> \ No newline at end of file
diff --git a/mod/groups/views/default/forum/topics.php b/mod/groups/views/default/forum/topics.php
index fdeffa564..821e398e1 100644
--- a/mod/groups/views/default/forum/topics.php
+++ b/mod/groups/views/default/forum/topics.php
@@ -10,24 +10,24 @@
*/
?>
-
-<h2><?php echo elgg_echo("groups:forum"); ?></h2>
-
-<?php
- //only show the add link if the user is a member
- if(page_owner_entity()->isMember($vars['user'])){
-
-?>
- <!-- display the add a topic link -->
- <div class="add_topic"><a href="<?php echo $vars['url']; ?>mod/groups/addtopic.php?group_guid=<?php echo get_input('group_guid'); ?>" class="add_topic_button"><?php echo elgg_echo("groups:addtopic"); ?></a></div>
-
-<?php
- }
-?>
+<div id="content_header" class="clearfloat">
+ <div class="content_header_title">
+ <h2><?php echo elgg_echo("groups:forum"); ?></h2>
+ </div>
+ <?php // only show the add topic button if the user is a member
+ if(page_owner_entity()->isMember($vars['user'])) {
+ ?>
+ <div class="content_header_options">
+ <a class="action_button" href="<?php echo $vars['url']; ?>mod/groups/addtopic.php?group_guid=<?php echo get_input('group_guid'); ?>"><?php echo elgg_echo("groups:addtopic"); ?></a>
+ </div>
+ <?php
+ }
+ ?>
+</div>
<?php
if($vars['topics'])
echo $vars['topics'];
else
- echo "<div class='contentWrapper'>". elgg_echo("grouptopic:notcreated") . "</div>";
+ echo "<p class='margin_top'>". elgg_echo("grouptopic:notcreated") . "</p>";
?> \ No newline at end of file
diff --git a/mod/groups/views/default/forum/viewposts.php b/mod/groups/views/default/forum/viewposts.php
index f2599f861..efb7e595c 100644
--- a/mod/groups/views/default/forum/viewposts.php
+++ b/mod/groups/views/default/forum/viewposts.php
@@ -12,10 +12,17 @@
?>
-<div id="topic_posts"><!-- open the topic_posts div -->
-<div id="pages_breadcrumbs"><b><a href="<?php echo $vars['url']; ?>pg/groups/forum/<?php echo $vars['entity']->container_guid; ?>/"><?php echo elgg_echo("groups:forum"); ?></a></b> > <?php echo $vars['entity']->title; ?></div>
-
<?php
+ echo elgg_view('page_elements/breadcrumbs', array(
+ 'breadcrumb_root_url' => '',
+ 'breadcrumb_root_text' => 'Parent Group Name',
+ 'breadcrumb_level1_url' => '#',
+ 'breadcrumb_level1_text' => elgg_echo('item:object:groupforumtopic'),
+ 'breadcrumb_currentpage' => $vars['entity']->title
+ ));
+
+
+
//display follow up comments
$count = $vars['entity']->countAnnotations('group_topic_post');
$offset = (int) get_input('offset',0);
@@ -55,4 +62,3 @@
}
?>
-</div> \ No newline at end of file