From 6c404e4df7643aec1c2a8611888d974266972fa5 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Fri, 15 Aug 2008 03:37:26 +0000 Subject: [PATCH] Fixed page comment system for new URL handler git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@60841 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageCommentInterface.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index a471aa6a..ba1efb59 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -6,7 +6,14 @@ * @package cms * @subpackage comments */ -class PageCommentInterface extends ViewableData { +class PageCommentInterface extends RequestHandlingData { + static $url_handlers = array( + '$Item!' => '$Item', + ); + static $allowed_actions = array( + 'PostCommentForm', + ); + protected $controller, $methodName, $page; /** @@ -35,6 +42,10 @@ class PageCommentInterface extends ViewableData { $this->page = $page; } + function Link() { + return Controller::join_links($this->controller->Link(), $this->methodName); + } + /** * See @link PageCommentInterface::$comments_require_login * @param boolean state The new state of this static field @@ -114,7 +125,7 @@ class PageCommentInterface extends ViewableData { $fields->push(new TextareaField("Comment", _t('PageCommentInterface.YOURCOMMENT', "Comments"))); - $form = new PageCommentInterface_Form($this->controller, $this->methodName . ".PostCommentForm",$fields, new FieldSet( + $form = new PageCommentInterface_Form($this, "PostCommentForm", $fields, new FieldSet( new FormAction("postcomment", _t('PageCommentInterface.POST', 'Post')) ));