aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r--mod/groups/views/default/forum/topicposts.php44
1 files changed, 40 insertions, 4 deletions
diff --git a/mod/groups/views/default/forum/topicposts.php b/mod/groups/views/default/forum/topicposts.php
index 60337522c..99b6b0ee8 100644
--- a/mod/groups/views/default/forum/topicposts.php
+++ b/mod/groups/views/default/forum/topicposts.php
@@ -12,6 +12,7 @@
* @uses $vars['entity'] The posted comment to view
*/
+
?>
<div class="topic_post"><!-- start the topic_post -->
@@ -47,8 +48,8 @@
</table>
<?php
- //if the comment owner is looking at it, they can edit
- if ($vars['entity']->canEdit()) {
+ //if the comment owner is looking at it, or admin they can edit
+ if ($vars['entity']->canEdit() || ($vars['entity']->owner_guid == $_SESSION['user']->guid)) {
?>
<p class="topic-post-menu">
<?php
@@ -58,8 +59,43 @@
'text' => elgg_echo('delete'),
'confirm' => elgg_echo('deleteconfirm'),
));
-
- ?>
+
+ //display an edit link that will open up an edit area
+ echo " <a class=\"manifest_details\">edit</a>";
+ echo "<div class=\"manifest_file\">";
+ //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', 'value' => $vars['entity']->value));
+ $post = elgg_view('input/hidden', array('internalname' => 'post', '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')));
+ $commentOwner = elgg_view('input/hidden', array('internalname' => 'commentOwner', 'value' => $vars['entity']->owner_guid));
+ $access = elgg_view('input/hidden', array('internalname' => 'access', 'value' => $vars['entity']->access_id));
+
+ $form_body = <<<EOT
+
+ <div class='edit_forum_comments'>
+ <p>
+ $text_textarea
+ </p>
+ $post
+ $topic
+ $group
+ $commentOwner
+ <p>
+ $submit_input
+ </p>
+
+ </div>
+
+EOT;
+
+?>
+
+ <?php
+ echo elgg_view('input/form', array('action' => "{$vars['url']}action/groups/editpost", 'body' => $form_body, 'internalid' => 'editforumpostForm'));
+ ?>
+ </div>
</p>
<?php