aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/comments/add.php3
-rw-r--r--views/default/comments/forms/edit.php26
2 files changed, 8 insertions, 21 deletions
diff --git a/actions/comments/add.php b/actions/comments/add.php
index bdc7fd06f..e02079dbd 100644
--- a/actions/comments/add.php
+++ b/actions/comments/add.php
@@ -11,7 +11,8 @@
*/
// Make sure we're logged in; forward to the front page if not
- if (!isloggedin()) forward();
+ gatekeeper();
+ action_gatekeeper();
// Get input
$entity_guid = (int) get_input('entity_guid');
diff --git a/views/default/comments/forms/edit.php b/views/default/comments/forms/edit.php
index 700a451cb..b435d69b9 100644
--- a/views/default/comments/forms/edit.php
+++ b/views/default/comments/forms/edit.php
@@ -13,26 +13,12 @@
*/
if (isset($vars['entity']) && isloggedin()) {
-
-?>
-
- <form action="<?php echo $vars['url']; ?>action/comments/add" method="post">
- <p>
- <label><?php echo elgg_echo("generic_comments:text"); ?><br />
- <?php
-
- echo elgg_view('input/longtext',array('internalname' => 'generic_comment'));
-
- ?>
- </label>
- </p>
- <p>
- <input type="hidden" name="entity_guid" value="<?php echo $vars['entity']->getGUID(); ?>" />
- <input type="submit" value="<?php echo elgg_echo("save"); ?>" />
- </p>
- </form>
-
-<?php
+
+ $form_body = "<p><label>".elgg_echo("generic_comments:text")."<br />" . elgg_view('input/longtext',array('internalname' => 'generic_comment')) . "</label></p>";
+ $form_body .= "<p>" . elgg_view('input/hidden', array('internalname' => 'entity_guid', 'value' => $vars['entity']->getGUID()));
+ $form_body .= elgg_view('input/submit', array('value' => elgg_echo("save"))) . "</p>";
+
+ echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/comments/add"));
}