From 7ccee82ef0284fb0399369ad6282cd9ddc3e0e1d Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 22 Feb 2009 13:23:27 +0000 Subject: users can now edit and delete their forum comments git-svn-id: https://code.elgg.org/elgg/trunk@2877 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/views/default/forum/topicposts.php | 44 ++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'mod/groups/views') 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 */ + ?>
@@ -47,8 +48,8 @@ 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)) { ?>

elgg_echo('delete'), 'confirm' => elgg_echo('deleteconfirm'), )); - - ?> + + //display an edit link that will open up an edit area + echo " edit"; + echo "

"; + //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 = << +

+ $text_textarea +

+ $post + $topic + $group + $commentOwner +

+ $submit_input +

+ +
+ +EOT; + +?> + + "{$vars['url']}action/groups/editpost", 'body' => $form_body, 'internalid' => 'editforumpostForm')); + ?> +