Ticket #3369: sfSimpleBlog.patch
| File sfSimpleBlog.patch, 28.5 kB (added by Tero.Alen, 3 months ago) |
|---|
-
a/plugins/sfSimpleBlogPlugin/config/schema.yml
old new 1 1 propel: 2 2 _attributes: { package: plugins.sfSimpleBlogPlugin.lib.model } 3 3 4 4 sf_blog_post: 5 5 _attributes: { phpName: sfSimpleBlogPost } 6 6 id: ~ … … 15 15 published_at: { type: date } 16 16 _uniques: 17 17 stripped_title_published_at: [stripped_title, published_at] 18 18 19 19 sf_blog_comment: 20 20 _attributes: { phpName: sfSimpleBlogComment } 21 21 id: ~ 22 22 sf_blog_post_id: { type: integer, foreignTable: sf_blog_post, foreignReference: id, onDelete: cascade } 23 author_name: varchar(255)24 author_email: varchar(255)23 author_name: { type: varchar, size:255, required: true } 24 author_email: { type: varchar, size:255, required: true } 25 25 author_url: varchar(255) 26 content: longvarchar26 content: { type: longvarchar, required: true } 27 27 is_moderated: { type: boolean, default: false } 28 28 created_at: ~ 29 29 30 30 sf_blog_tag: 31 31 _attributes: { phpName: sfSimpleBlogTag } 32 32 sf_blog_post_id: { type: integer, primaryKey: true, foreignTable: sf_blog_post, foreignReference: id, onDelete: cascade } -
/dev/null
old new 1 <?php 2 3 /** 4 * sfSimpleBlogComment form base class. 5 * 6 * @package form 7 * @subpackage sf_simple_blog_comment 8 * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $ 9 */ 10 class BasesfSimpleBlogCommentForm extends BaseFormPropel 11 { 12 public function setup() 13 { 14 $this->setWidgets(array( 15 'id' => new sfWidgetFormInputHidden(), 16 'sf_blog_post_id' => new sfWidgetFormPropelSelect(array('model' => 'sfSimpleBlogPost', 'add_empty' => true)), 17 'author_name' => new sfWidgetFormInput(), 18 'author_email' => new sfWidgetFormInput(), 19 'author_url' => new sfWidgetFormInput(), 20 'content' => new sfWidgetFormTextarea(), 21 'is_moderated' => new sfWidgetFormInputCheckbox(), 22 'created_at' => new sfWidgetFormDateTime(), 23 )); 24 25 $this->setValidators(array( 26 'id' => new sfValidatorPropelChoice(array('model' => 'sfSimpleBlogComment', 'column' => 'id', 'required' => false)), 27 'sf_blog_post_id' => new sfValidatorPropelChoice(array('model' => 'sfSimpleBlogPost', 'column' => 'id', 'required' => false)), 28 'author_name' => new sfValidatorString(array('max_length' => 255)), 29 'author_email' => new sfValidatorString(array('max_length' => 255)), 30 'author_url' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 31 'content' => new sfValidatorString(), 32 'is_moderated' => new sfValidatorBoolean(array('required' => false)), 33 'created_at' => new sfValidatorDateTime(array('required' => false)), 34 )); 35 36 $this->widgetSchema->setNameFormat('sf_simple_blog_comment[%s]'); 37 38 $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); 39 40 parent::setup(); 41 } 42 43 public function getModelName() 44 { 45 return 'sfSimpleBlogComment'; 46 } 47 48 49 } -
/dev/null
old new 1 <?php 2 3 /** 4 * sfSimpleBlogPost form base class. 5 * 6 * @package form 7 * @subpackage sf_simple_blog_post 8 * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $ 9 */ 10 class BasesfSimpleBlogPostForm extends BaseFormPropel 11 { 12 public function setup() 13 { 14 $this->setWidgets(array( 15 'id' => new sfWidgetFormInputHidden(), 16 'author_id' => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => true)), 17 'title' => new sfWidgetFormInput(), 18 'stripped_title' => new sfWidgetFormInput(), 19 'extract' => new sfWidgetFormTextarea(), 20 'content' => new sfWidgetFormTextarea(), 21 'is_published' => new sfWidgetFormInputCheckbox(), 22 'allow_comments' => new sfWidgetFormInputCheckbox(), 23 'created_at' => new sfWidgetFormDateTime(), 24 'published_at' => new sfWidgetFormDate(), 25 )); 26 27 $this->setValidators(array( 28 'id' => new sfValidatorPropelChoice(array('model' => 'sfSimpleBlogPost', 'column' => 'id', 'required' => false)), 29 'author_id' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => false)), 30 'title' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 31 'stripped_title' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 32 'extract' => new sfValidatorString(array('required' => false)), 33 'content' => new sfValidatorString(array('required' => false)), 34 'is_published' => new sfValidatorBoolean(array('required' => false)), 35 'allow_comments' => new sfValidatorBoolean(array('required' => false)), 36 'created_at' => new sfValidatorDateTime(array('required' => false)), 37 'published_at' => new sfValidatorDate(array('required' => false)), 38 )); 39 40 $this->validatorSchema->setPostValidator( 41 new sfValidatorPropelUnique(array('model' => 'sfSimpleBlogPost', 'column' => array('stripped_title', 'published_at'))) 42 ); 43 44 $this->widgetSchema->setNameFormat('sf_simple_blog_post[%s]'); 45 46 $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); 47 48 parent::setup(); 49 } 50 51 public function getModelName() 52 { 53 return 'sfSimpleBlogPost'; 54 } 55 56 57 } -
/dev/null
old new 1 <?php 2 3 /** 4 * sfSimpleBlogTag form base class. 5 * 6 * @package form 7 * @subpackage sf_simple_blog_tag 8 * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 8807 2008-05-06 14:12:28Z fabien $ 9 */ 10 class BasesfSimpleBlogTagForm extends BaseFormPropel 11 { 12 public function setup() 13 { 14 $this->setWidgets(array( 15 'sf_blog_post_id' => new sfWidgetFormInputHidden(), 16 'tag' => new sfWidgetFormInputHidden(), 17 'created_at' => new sfWidgetFormDateTime(), 18 )); 19 20 $this->setValidators(array( 21 'sf_blog_post_id' => new sfValidatorPropelChoice(array('model' => 'sfSimpleBlogPost', 'column' => 'id', 'required' => false)), 22 'tag' => new sfValidatorPropelChoice(array('model' => 'sfSimpleBlogTag', 'column' => 'tag', 'required' => false)), 23 'created_at' => new sfValidatorDateTime(array('required' => false)), 24 )); 25 26 $this->widgetSchema->setNameFormat('sf_simple_blog_tag[%s]'); 27 28 $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); 29 30 parent::setup(); 31 } 32 33 public function getModelName() 34 { 35 return 'sfSimpleBlogTag'; 36 } 37 38 39 } -
/dev/null
old new 1 <?php 2 3 /** 4 * sfSimpleBlogComment form. 5 * 6 * @package form 7 * @subpackage sf_blog_comment 8 * @version SVN: $Id: sfPropelFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $ 9 */ 10 class sfSimpleBlogCommentForm extends BasesfSimpleBlogCommentForm 11 { 12 public function configure() 13 { 14 unset($this->widgetSchema['sf_blog_post_id']); 15 unset($this->widgetSchema['is_moderated']); 16 unset($this->widgetSchema['created_at']); 17 18 $this->widgetSchema->setLabels(array_merge($this->widgetSchema->getLabels(), array( 19 'author_name' => 'Name (required)', 20 'author_email' => 'Mail (required) (will not be published)', 21 'author_url' => 'Website', 22 'content' => '' 23 ))); 24 25 $this->validatorSchema['author_name']->setOption('min_length', 4); 26 $this->validatorSchema['author_name']->setOption('max_length', 100); 27 $this->validatorSchema['author_name']->setMessage('required', 'You must provide a name to leave a comment'); 28 $this->validatorSchema['author_name']->setMessage('min_length', 'You must provide a longer name (4 characters minimum)'); 29 $this->validatorSchema['author_name']->setMessage('max_length', 'You must provide a shorter name (100 characters maximum)'); 30 31 $this->validatorSchema['author_email'] = new sfValidatorEmail(array('required' => true), array( 32 'required' => 'You must provide an email to leave a comment', 33 'invalid' => 'This email address is not valid' 34 )); 35 36 $this->validatorSchema['content']->setOption('min_length', 4); 37 $this->validatorSchema['content']->setMessage('required', 'You must provide a text content to leave a comment'); 38 $this->validatorSchema['content']->setMessage('min_length', 'You must provide a longer content (4 characters minimum)'); 39 40 $this->widgetSchema->setFormFormatterName('div'); 41 } 42 43 public function updateObject() 44 { 45 parent::updateObject(); 46 47 $automoderation = sfConfig::get('app_sfSimpleBlog_comment_automoderation', 'first_post'); 48 if($automoderation === true || (($automoderation == 'first_post') && !DbFinder::from('sfSimpleBlogComment')->isAuthorApproved($this->object->getAuthorName(),$this->object->getAuthorEmail()))) 49 { 50 $this->object->setIsModerated(true); 51 } 52 } 53 } -
/dev/null
old new 1 <?php 2 3 /** 4 * sfSimpleBlogPost form. 5 * 6 * @package form 7 * @subpackage sf_blog_post 8 * @version SVN: $Id: sfPropelFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $ 9 */ 10 class sfSimpleBlogPostForm extends BasesfSimpleBlogPostForm 11 { 12 public function configure() 13 { 14 } 15 } -
/dev/null
old new 1 <?php 2 3 /** 4 * sfSimpleBlogTag form. 5 * 6 * @package form 7 * @subpackage sf_blog_tag 8 * @version SVN: $Id: sfPropelFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $ 9 */ 10 class sfSimpleBlogTagForm extends BasesfSimpleBlogTagForm 11 { 12 public function configure() 13 { 14 } 15 } -
a/plugins/sfSimpleBlogPlugin/lib/model/map/sfSimpleBlogCommentMapBuilder.php
old new 36 36 37 37 $tMap->addForeignKey('SF_BLOG_POST_ID', 'SfBlogPostId', 'int', CreoleTypes::INTEGER, 'sf_blog_post', 'ID', false, null); 38 38 39 $tMap->addColumn('AUTHOR_NAME', 'AuthorName', 'string', CreoleTypes::VARCHAR, false, 255);39 $tMap->addColumn('AUTHOR_NAME', 'AuthorName', 'string', CreoleTypes::VARCHAR, true, 255); 40 40 41 $tMap->addColumn('AUTHOR_EMAIL', 'AuthorEmail', 'string', CreoleTypes::VARCHAR, false, 255);41 $tMap->addColumn('AUTHOR_EMAIL', 'AuthorEmail', 'string', CreoleTypes::VARCHAR, true, 255); 42 42 43 43 $tMap->addColumn('AUTHOR_URL', 'AuthorUrl', 'string', CreoleTypes::VARCHAR, false, 255); 44 44 45 $tMap->addColumn('CONTENT', 'Content', 'string', CreoleTypes::LONGVARCHAR, false, null);45 $tMap->addColumn('CONTENT', 'Content', 'string', CreoleTypes::LONGVARCHAR, true, null); 46 46 47 47 $tMap->addColumn('IS_MODERATED', 'IsModerated', 'boolean', CreoleTypes::BOOLEAN, false, null); 48 48 -
a/plugins/sfSimpleBlogPlugin/lib/model/plugin/PluginsfSimpleBlogPost.php
old new 3 3 /** 4 4 * Subclass for representing a row from the 'sf_blog_post' table. 5 5 * 6 * 6 * 7 7 * 8 8 * @package plugins.sfSimpleBlogPlugin.lib.model 9 */ 9 */ 10 10 class PluginsfSimpleBlogPost extends BasesfSimpleBlogPost 11 11 { 12 12 protected $nbComments = null; 13 13 14 public function __toString() 15 { 16 return $this->getTitle(); 17 } 18 14 19 public function setTitle($text) 15 20 { 16 21 parent::setTitle($text); 17 22 18 $this->setStrippedTitle(sfSimpleBlogTools::stripText($text)); 23 $this->setStrippedTitle(sfSimpleBlogTools::stripText($text)); 19 24 } 20 25 21 26 public function getAuthor() … … 23 28 $getUserMethod = 'get'.sfConfig::get('app_sfSimpleBlog_user_class', 'sfGuardUser'); 24 29 if (!method_exists($this, $getUserMethod)) 25 30 { 26 throw new sfException(sprintf('Method sfSimpleBlogPost::%s does not exist - check the sfSimpleBlog_user_class parameter of the app.yml file', $getUserMethod)); 31 throw new sfException(sprintf('Method sfSimpleBlogPost::%s does not exist - check the sfSimpleBlog_user_class parameter of the app.yml file', $getUserMethod)); 27 32 } 28 33 29 34 return call_user_func(array($this, $getUserMethod)); … … 40 45 41 46 public function getNbComments() 42 47 { 43 if ($this->nbComments === null) 48 if ($this->nbComments === null) 44 49 { 45 50 $this->nbComments = DbFinder::from('sfSimpleBlogComment')-> 46 51 relatedTo($this)-> 47 52 where('IsModerated', false)-> 48 53 count(); 49 54 } 50 55 51 56 return $this->nbComments; 52 57 } 53 58 … … 57 62 relatedTo($this)-> 58 63 orderBy('Tag')-> 59 64 find(); 60 65 61 66 return implode($tags, ' '); 62 67 } 63 68 … … 108 113 { 109 114 $this->setPublishedAt(date("Y-m-d")); 110 115 } 111 116 112 117 parent::setIsPublished($flag); 113 118 } 114 119 -
a/plugins/sfSimpleBlogPlugin/modules/sfSimpleBlog/lib/BasesfSimpleBlogActions.class.php
old new 40 40 $posts = DbFinder::from('sfSimpleBlogPost')-> 41 41 recent()-> 42 42 find($this->getRequestParameter('nb', sfConfig::get('app_sfSimpleBlog_feed_count', 5))); 43 43 44 44 $this->feed = sfFeedPeer::createFromObjects( 45 45 $posts, 46 46 array( … … 60 60 $comments = DbFinder::from('sfSimpleBlogComment')-> 61 61 recent()-> 62 62 find($this->getRequestParameter('nb', sfConfig::get('app_sfSimpleBlog_feed_count', 5))); 63 63 64 64 $this->feed = sfFeedPeer::createFromObjects( 65 65 $comments, 66 66 array( … … 86 86 relatedTo($post)-> 87 87 recent()-> 88 88 find($this->getRequestParameter('nb', sfConfig::get('app_sfSimpleBlog_feed_count', 5))); 89 89 90 90 $this->feed = sfFeedPeer::createFromObjects( 91 91 $comments, 92 92 array( … … 107 107 $this->post_pager = DbFinder::from('sfSimpleBlogPost')-> 108 108 recent()-> 109 109 tagged($tag)-> 110 paginate($this->getRequestParameter('page', 1), sfConfig::get('app_sfSimpleBlog_post_max_per_page', 5)); 110 paginate($this->getRequestParameter('page', 1), sfConfig::get('app_sfSimpleBlog_post_max_per_page', 5)); 111 111 } 112 112 113 113 public function executePostsForTagFeed() 114 114 { 115 115 sfLoader::loadHelpers(array('I18N')); … … 119 119 recent()-> 120 120 tagged($tag)-> 121 121 find($this->getRequestParameter('nb', sfConfig::get('app_sfSimpleBlog_feed_count', 5))); 122 122 123 123 $this->feed = sfFeedPeer::createFromObjects( 124 124 $posts, 125 125 array( … … 132 132 ); 133 133 $this->setTemplate('feed'); 134 134 } 135 135 136 136 public function executeShow() 137 137 { 138 138 $this->post = DbFinder::from('sfSimpleBlogPost')->findByStrippedTitleAndDate( … … 141 141 ); 142 142 $this->forward404Unless($this->post); 143 143 $this->comments = $this->post->getComments(); 144 145 $this->comment_form = $this->getRequest()->getAttribute('comment_form', new sfSimpleBlogCommentForm()); 144 146 } 145 147 146 148 protected function getDateFromRequest() 147 149 { 148 150 return $this->getRequestParameter('date') != null ? $this->getRequestParameter('date') : $this->getRequestParameter('year').'-'.$this->getRequestParameter('month').'-'.$this->getRequestParameter('day'); 149 151 } 150 152 151 153 public function executeAddComment() 152 154 { 153 155 $this->forward404Unless(sfConfig::get('app_sfSimpleBlog_comment_enabled', true)); … … 158 160 $this->forward404Unless($post); 159 161 $this->forward404Unless($post->allowComments()); 160 162 161 $comment = new sfSimpleBlogComment(); 162 $comment->setSfBlogPostId($post->getId()); 163 $automoderation = sfConfig::get('app_sfSimpleBlog_comment_automoderation', 'first_post'); 164 if($automoderation === true || (($automoderation == 'first_post') && !DbFinder::from('sfSimpleBlogComment')->isAuthorApproved($this->getRequestParameter('name'),$this->getRequestParameter('mail')))) 165 { 166 $comment->setIsModerated(true); 167 $this->setFlash('add_comment', 'moderated'); 168 } 169 else 170 { 171 $this->setFlash('add_comment', 'normal'); 172 } 173 $comment->setAuthorName($this->getRequestParameter('name')); 174 $comment->setAuthorEmail($this->getRequestParameter('mail')); 175 if($url = $this->getRequestParameter('website', '')) 163 $this->comment_form = new sfSimpleBlogCommentForm(); 164 $this->comment_form->bind(array_merge($this->getRequestParameter('sf_simple_blog_comment'), array('sf_blog_post_id' => $post->getId()))); 165 166 if($this->comment_form->isValid()) 176 167 { 177 if(strpos($url, 'http://') !== 0) 168 $comment = $this->comment_form->save(); 169 170 if($comment->getIsModerated()) 178 171 { 179 $url = 'http://'.$url; 172 $this->getUser()->setFlash('add_comment', 'moderated'); 173 } 174 else 175 { 176 $this->getUser()->setFlash('add_comment', 'normal'); 177 } 178 179 $email_pref = sfConfig::get('app_sfSimpleBlog_comment_mail_alert', 1); 180 if($email_pref == 1 || ($email_pref == 'moderated' && $comment->getIsModerated())) 181 { 182 $this->sendMailOnComment($comment); 183 } 184 185 if($this->getRequest()->isXmlHttpRequest()) 186 { 187 $this->post = $post; 188 $this->comments = $post->getComments(); 189 return 'Ajax'; 190 } 191 else 192 { 193 $this->redirect(sfSimpleBlogTools::generatePostUri($post)); 180 194 } 181 $comment->setAuthorUrl($url);182 }183 $comment->setContent(strip_tags($this->getRequestParameter('content')));184 $comment->save();185 186 $email_pref = sfConfig::get('app_sfSimpleBlog_comment_mail_alert', 1);187 if($email_pref == 1 || ($email_pref == 'moderated' && $comment->getIsModerated()))188 {189 $this->getRequest()->setAttribute('comment', $comment);190 $raw_email = $this->sendEmail('sfSimpleBlog', 'sendMailOnComment');191 $this->logMessage($raw_email, 'debug');192 }193 194 if($this->getRequest()->isXmlHttpRequest())195 {196 $this->post = $post;197 $this->comments = $post->getComments();198 return 'Ajax';199 195 } 200 196 else 201 197 { 202 $this->redirect(sfSimpleBlogTools::generatePostUri($post)); 198 $this->getRequest()->setAttribute('comment_form', $this->comment_form); 199 $this->forward('sfSimpleBlog', 'show'); 203 200 } 204 201 } 205 206 p ublic function executeSendMailOnComment()202 203 protected function sendMailOnComment($comment) 207 204 { 208 // Mail action cannot be called directly from the outside209 $this->forward404If($this->getController()->getActionStack()->getSize() == 1);210 211 205 sfLoader::loadHelpers(array('I18N')); 212 $this->comment = $this->getRequest()->getAttribute('comment'); 213 214 $mail = new sfMail(); 215 $mail->setCharset('utf-8'); 216 $mail->setSender('no-reply@'.$this->getRequest()->getHost()); 217 $mail->setMailer('mail'); 218 $mail->setFrom($mail->getSender(), sfConfig::get('app_sfSimpleBlog_title')); 219 220 $mail->addAddresses(sfConfig::get('app_sfSimpleBlog_email')); 206 $this->comment = $comment; 221 207 222 208 if($this->comment->getIsModerated()) 223 209 { … … 225 211 } 226 212 else 227 213 { 228 $subject_string = '[%1%] New comment on "%2%"'; 214 $subject_string = '[%1%] New comment on "%2%"'; 229 215 } 230 $mail ->setSubject(__($subject_string, array(216 $mailSubject = __($subject_string, array( 231 217 '%1%' => sfConfig::get('app_sfSimpleBlog_title'), 232 218 '%2%' => $this->comment->getPostTitle() 233 ))); 234 235 $this->mail = $mail; 219 )); 220 221 $mailBody = $this->getPartial('commentMail', array('comment' => $this->comment)); 222 $this->logMessage($mailBody, 'debug'); 223 224 $mailer = new Swift(new Swift_Connection_NativeMail()); 225 $message = new Swift_Message($mailSubject, $mailBody, 'text/html'); 226 227 $mailer->send($message, sfConfig::get('app_sfSimpleBlog_email'), 'no-reply@'.$this->getRequest()->getHost()); 228 $mailer->disconnect(); 236 229 } 237 230 238 231 public function handleErrorAddComment() 239 232 { 240 233 if($this->getRequest()->isXmlHttpRequest()) … … 246 239 $this->forward404Unless($this->post); 247 240 $this->comments = $this->post->getComments(); 248 241 $this->getResponse()->setContentType('text/html; charset=utf-8'); 249 return 'Ajax'; 242 return 'Ajax'; 250 243 } 251 244 else 252 245 { 253 $this->forward('sfSimpleBlog', 'show'); 246 $this->forward('sfSimpleBlog', 'show'); 254 247 } 255 248 } 256 249 -
a/plugins/sfSimpleBlogPlugin/modules/sfSimpleBlog/templates/_add_comment.php
old new 1 1 <?php use_helper('Validation') ?> 2 2 <h3><?php echo __('Leave a reply') ?></h3> 3 <?php echo form_tag('sfSimpleBlog/addComment', 'name=add_comment class=add_comment id=sfSimpleBlog_add_comment_form') ?> 4 <?php echo input_hidden_tag('stripped_title', $post->getStrippedTitle()) ?> 5 <?php echo input_hidden_tag('date', $post->getPublishedAt()) ?> 6 <div class="form_control"> 7 <?php echo form_error('name') ?> 8 <?php echo input_tag('name', '', 'id= class=text') ?> 9 <label for="name"><?php echo __('Name (required)') ?></label> 10 </div> 11 <div class="form_control"> 12 <?php echo form_error('mail') ?> 13 <?php echo input_tag('mail', '', 'id= class=text') ?> 14 <label for="mail"><?php echo __('Mail (required) (will not be published)') ?></label> 15 </div> 16 <div class="form_control"> 17 <?php echo form_error('website') ?> 18 <?php echo input_tag('website', '', 'id= class=text') ?> 19 <label for="url"><?php echo __('Website') ?></label> 20 </div> 21 <div class="form_control"> 22 <?php echo form_error('content') ?> 23 <?php echo textarea_tag('content', '', 'id=') ?> 24 <label for="content"></label> 25 </div> 26 <div class="form_control"> 27 <?php echo submit_tag(__('Submit comment')) ?> 28 </div> 3 <form id="sfSimpleBlog_add_comment_form" name="add_comment" action="<?php echo url_for('sfSimpleBlog/addComment') ?>" method="POST" class="add_comment"> 4 <?php echo $comment_form ?> 29 5 </form> 30 6 31 7 <?php if(sfConfig::get('app_sfSimpleBlog_use_ajax', true)): ?> 32 8 <script> 33 document.getElementById('sfSimpleBlog_add_comment_form').onsubmit = function () { 9 document.getElementById('sfSimpleBlog_add_comment_form').onsubmit = function () { 34 10 new Ajax.Updater( 35 11 'sfSimpleBlog_comment_list', 36 document.getElementById('sfSimpleBlog_add_comment_form').action, 12 document.getElementById('sfSimpleBlog_add_comment_form').action, 37 13 { parameters: Form.serialize(this), evalScripts: true, encoding: 'UTF-8' } 38 ); 39 return false; 40 }; 14 ); 15 return false; 16 }; 41 17 </script> 42 18 <?php endif; ?> -
/dev/null
old new 1 <?php use_helper('Date', 'I18N') ?> 2 3 <?php echo __('A new comment has been posted on the post "%1%".', array('%1%' => $comment->getPostTitle())) ?> 4 5 6 <?php echo __('Author: ').$comment->getAuthorName() ?> 7 8 <?php echo __('Email: ').$comment->getAuthorEmail() ?> 9 10 <?php echo __('Website: ').$comment->getAuthorUrl() ?> 11 12 <?php echo __('Comment: ').$comment->getContent() ?> 13 14 15 <?php if($comment->getIsModerated()): ?> 16 <?php echo __('This comment was automatically moderated and is waiting for your approval.') ?> 17 18 <?php echo __('Accept this comment:') ?> 19 <?php else: ?> 20 <?php echo __('Moderate this comment:') ?> 21 <?php endif; ?> 22 23 <?php echo url_for('sfSimpleBlogCommentAdmin/togglePublish?from_email=1&id='.$comment->getId(), true) ?> -
a/plugins/sfSimpleBlogPlugin/modules/sfSimpleBlog/templates/_comment_list.php
old new 8 8 <?php elseif($sf_user->getFlash('add_comment') == 'moderated'): ?> 9 9 <div class="comment moderated"><?php echo __('Your comment has been submitted and is awaiting moderation') ?></div> 10 10 <?php elseif($sf_user->getFlash('add_comment') != 'normal'): ?> 11 <?php include_partial('sfSimpleBlog/add_comment', array('post' => $post )) ?>11 <?php include_partial('sfSimpleBlog/add_comment', array('post' => $post, 'comment_form' => $comment_form)) ?> 12 12 <?php endif; ?> -
a/plugins/sfSimpleBlogPlugin/modules/sfSimpleBlog/templates/showSuccess.php
old new 13 13 <span class="sfSimpleBlog"> 14 14 15 15 <?php include_partial('sfSimpleBlog/post', array('post' => $post, 'in_list' => false)) ?> 16 16 17 17 <div class="comments" id="comments"> 18 18 19 19 <?php if($nb_comments = count($comments)): ?> 20 20 <h3><?php echo format_number_choice('[1]One comment so far|(1,+Inf]%1% comments so far', array('%1%' => $nb_comments), $nb_comments) ?></h3> 21 21 <?php endif; ?> 22 22 <div id="sfSimpleBlog_comment_list"> 23 <?php include_partial('sfSimpleBlog/comment_list', array('post' => $post, 'comments' => $comments )) ?>23 <?php include_partial('sfSimpleBlog/comment_list', array('post' => $post, 'comments' => $comments, 'comment_form' => $comment_form)) ?> 24 24 </div> 25 25 26 26 </div>