Author: Jonathan.Wage
Date: 2010-01-14 21:02:03 +0100 (Thu, 14 Jan 2010)
New Revision: 26651
Removed:
plugins/sfSympalCommentsPlugin/branches/1.4/modules/sympal_comments/lib/Basesympal_commentsComponents.class.php
Modified:
plugins/sfSympalCommentsPlugin/branches/1.4/lib/helper/CommentsHelper.php
Log:
[1.4][sfSympalCommentsPlugin][1.0] Removing use of unnecessary component
Modified:
plugins/sfSympalCommentsPlugin/branches/1.4/lib/helper/CommentsHelper.php
===================================================================
--- plugins/sfSympalCommentsPlugin/branches/1.4/lib/helper/CommentsHelper.php
2010-01-14 19:56:24 UTC (rev 26650)
+++ plugins/sfSympalCommentsPlugin/branches/1.4/lib/helper/CommentsHelper.php
2010-01-14 20:02:03 UTC (rev 26651)
@@ -2,5 +2,21 @@
function get_sympal_comments($content)
{
- return get_component('sympal_comments', 'for_content', array('content' =>
$content));
+ return get_partial('sympal_comments/for_content', array(
+ 'content' => $content,
+ 'form' => get_sympal_new_comment_form($content)
+ ));
+}
+
+function get_sympal_new_comment_form($content)
+{
+ $user = sfContext::getInstance()->getUser();
+ $form = new sfSympalNewCommentForm();
+ $form->setDefault('content_id', $content->getId());
+
+ if (sfSympalConfig::get('sfSympalCommentsPlugin', 'requires_auth') &&
$user->isAuthenticated())
+ {
+ $form->setDefault('user_id', $user->getGuardUser()->getId());
+ }
+ return $form;
}
\ No newline at end of file
Deleted:
plugins/sfSympalCommentsPlugin/branches/1.4/modules/sympal_comments/lib/Basesympal_commentsComponents.class.php
===================================================================
---
plugins/sfSympalCommentsPlugin/branches/1.4/modules/sympal_comments/lib/Basesympal_commentsComponents.class.php
2010-01-14 19:56:24 UTC (rev 26650)
+++
plugins/sfSympalCommentsPlugin/branches/1.4/modules/sympal_comments/lib/Basesympal_commentsComponents.class.php
2010-01-14 20:02:03 UTC (rev 26651)
@@ -1,15 +0,0 @@
-<?php
-
-class Basesympal_commentsComponents extends sfComponents
-{
- public function executeFor_content()
- {
- $this->form = new sfSympalNewCommentForm();
- $this->form->setDefault('content_id', $this->content->getId());
-
- if (sfSympalConfig::get('sfSympalCommentsPlugin', 'requires_auth') &&
$this->getUser()->isAuthenticated())
- {
- $this->form->setDefault('user_id',
$this->getUser()->getGuardUser()->getId());
- }
- }
-}
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.