diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-22 13:23:27 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-22 13:23:27 +0000 |
commit | 7ccee82ef0284fb0399369ad6282cd9ddc3e0e1d (patch) | |
tree | cd6120b422f554f52e1febf7406f5a226019b49d /mod/groups/views/default | |
parent | a6e8eb522323fa2e3f2c1fd6e58a3eec9857db63 (diff) | |
download | elgg-7ccee82ef0284fb0399369ad6282cd9ddc3e0e1d.tar.gz elgg-7ccee82ef0284fb0399369ad6282cd9ddc3e0e1d.tar.bz2 |
users can now edit and delete their forum comments
git-svn-id: https://code.elgg.org/elgg/trunk@2877 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r-- | mod/groups/views/default/forum/topicposts.php | 44 |
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
|