Author: khiramatsu
Date: 2010-04-18 21:33:38 +0200 (Sun, 18 Apr 2010)
New Revision: 29194
Added:
plugins/sfSimpleCommentPlugin/LICENSE
plugins/sfSimpleCommentPlugin/README
plugins/sfSimpleCommentPlugin/VERSION
plugins/sfSimpleCommentPlugin/config/
plugins/sfSimpleCommentPlugin/config/app.yml.example
plugins/sfSimpleCommentPlugin/config/doctrine/
plugins/sfSimpleCommentPlugin/config/doctrine/schema.yml
plugins/sfSimpleCommentPlugin/config/sfSimpleCommentPluginConfiguration.class.php
plugins/sfSimpleCommentPlugin/lib/
plugins/sfSimpleCommentPlugin/lib/filter/
plugins/sfSimpleCommentPlugin/lib/filter/doctrine/
plugins/sfSimpleCommentPlugin/lib/filter/doctrine/PluginsfSimpleCommentFormFilter.class.php
plugins/sfSimpleCommentPlugin/lib/form/
plugins/sfSimpleCommentPlugin/lib/form/doctrine/
plugins/sfSimpleCommentPlugin/lib/form/doctrine/PluginsfSimpleCommentForm.class.php
plugins/sfSimpleCommentPlugin/lib/form/doctrine/sfSimpleCommentForm.class.php
plugins/sfSimpleCommentPlugin/lib/form/sfSimpleCommentForm.class.php
plugins/sfSimpleCommentPlugin/lib/model/
plugins/sfSimpleCommentPlugin/lib/model/doctrine/
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleComment.class.php
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleCommentTable.class.php
plugins/sfSimpleCommentPlugin/lib/sfSimpleCommentRouting.class.php
plugins/sfSimpleCommentPlugin/modules/
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/actions.class.php
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/components.class.php
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/config/
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/lib/
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_form.php
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_index.php
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_new.php
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/newSuccess.php
plugins/sfSimpleCommentPlugin/package.xml
Log:
initial commit
Added: plugins/sfSimpleCommentPlugin/LICENSE
===================================================================
--- plugins/sfSimpleCommentPlugin/LICENSE (rev 0)
+++ plugins/sfSimpleCommentPlugin/LICENSE 2010-04-18 19:33:38 UTC (rev
29194)
@@ -0,0 +1,7 @@
+Copyright (c) 2010 Kazuhiro Hiramatsu
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Added: plugins/sfSimpleCommentPlugin/README
===================================================================
--- plugins/sfSimpleCommentPlugin/README (rev 0)
+++ plugins/sfSimpleCommentPlugin/README 2010-04-18 19:33:38 UTC (rev
29194)
@@ -0,0 +1,86 @@
+# sfSimpleComment plugin (for symfony 1.4) #
+
+The `sfSimpleCommentPlugin` is a symfony plugin that provides basic comments
feature for all doctrine models. It's a great bedrock for any more complex
comments solutions.
+
+It gives you the basic generic model (comment) and the module (controller and
component; frontend only right now) to make any model commentable in a minute.
+
+## Installation ##
+
+ * Install the plugin (via a package)
+
+ symfony plugin:install sfSimpleCommentPlugin
+
+ * Install the plugin (via a Subversion checkout)
+
+ svn co
http//svn.symfony-project.com/plugins/sfSimpleCommentPlugin/trunk
plugins/sfSimpleCommentPlugin
+
+ * Activate the plugin in the `config/ProjectConfiguration.class.php`
+
+ [php]
+ class ProjectConfiguration extends sfProjectConfiguration
+ {
+ public function setup()
+ {
+ $this->enablePlugins(array(
+ 'sfSimpleCommentPlugin',
+ '...'
+ ));
+ }
+ }
+
+ * Rebuild your model/classes
+
+ symfony doctrine:build --all
+
+ * Enable required module in your `settings.yml` (optional)
+
+ all:
+ .settings:
+ enabled_modules: [default, sfSimpleComment]
+
+ * Clear you cache
+
+ symfony cc
+
+
+### Use in your application ###
+
+To use sfSimpleCommentPlugin in symfony application:
+
+ * Enable ability to comment for selected models in `app.yml` (in other words
add requried config entries to your `app.yml`)
+
+ all:
+ [...]
+ sfSimpleComment:
+ commentable_types: [YourCommentableModel, YourCommentableModel2]
+
+ * Inlcude comments list and comment form components on selected pages (like
showSuccess template of selected models)
+
+ <?php include_component('sfSimpleComment', 'index',
array('commentable' => $yourModelInstance)); ?>
+
+ <?php include_component('sfSimpleComment', 'new', array('commentable'
=> $yourModelInstance)); ?>
+
+ * That's all, enjoy :)
+
+
+### (Extend) Convenient connection between comments and commentable models ###
+
+For each commentable type you can add comment inherited class in project
`scheme.yml`. That will make commenting more strict on code level and gives you
possibilty to set default `object_type` value if you are creating comments out
of the default sfSimpleComment module. From other point of view that gives you
ability to set neat alias' between commentable type and comment model in
doctrine:
+
+ ArticleComment:
+ inheritance:
+ extends: sfSimpleComment
+ type: column_aggregation
+ keyField: object_type
+ keyValue: Article
+ relations:
+ Article:
+ local: object_id
+ foreign: id
+ type: one
+ foreignType: many
+ onDelete: CASCADE
+ foreignAlias: Comments
+ alias: Article
+
+
Added: plugins/sfSimpleCommentPlugin/VERSION
===================================================================
--- plugins/sfSimpleCommentPlugin/VERSION (rev 0)
+++ plugins/sfSimpleCommentPlugin/VERSION 2010-04-18 19:33:38 UTC (rev
29194)
@@ -0,0 +1 @@
+0.9.0
Added: plugins/sfSimpleCommentPlugin/config/app.yml.example
===================================================================
--- plugins/sfSimpleCommentPlugin/config/app.yml.example
(rev 0)
+++ plugins/sfSimpleCommentPlugin/config/app.yml.example 2010-04-18
19:33:38 UTC (rev 29194)
@@ -0,0 +1,3 @@
+all:
+ sfSimpleComment:
+ commentable_types: [Article, Company]
Added: plugins/sfSimpleCommentPlugin/config/doctrine/schema.yml
===================================================================
--- plugins/sfSimpleCommentPlugin/config/doctrine/schema.yml
(rev 0)
+++ plugins/sfSimpleCommentPlugin/config/doctrine/schema.yml 2010-04-18
19:33:38 UTC (rev 29194)
@@ -0,0 +1,23 @@
+options:
+ type: INNODB
+ collate: utf8_unicode_ci
+ charset: utf8
+
+sfSimpleComment:
+ actAs:
+ Timestampable: ~
+ columns:
+ id: {type: integer(4), primary: true, autoincrement: true}
+ body: {type: text, notnull: true}
+ user_id: {type: integer(4), notnull: true}
+ object_id: {type: integer(4), notnull: true}
+ object_type: {type: string(64), notnull: true}
+ relations:
+ sfGuardUser:
+ local: user_id
+ foreign: id
+ type: one
+ foreignType: many
+ onDelete: CASCADE
+ foreignAlias: Comments
+ alias: User
Added:
plugins/sfSimpleCommentPlugin/config/sfSimpleCommentPluginConfiguration.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/config/sfSimpleCommentPluginConfiguration.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/config/sfSimpleCommentPluginConfiguration.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,15 @@
+<?php
+
+class sfSimpleCommentPluginConfiguration extends sfPluginConfiguration
+{
+ /**
+ * @see sfPluginConfiguration
+ */
+ public function initialize()
+ {
+ $this->dispatcher->connect(
+ 'routing.load_configuration',
+ array('sfSimpleCommentRouting', 'listenToRoutingLoadConfigurationEvent')
+ );
+ }
+}
Added:
plugins/sfSimpleCommentPlugin/lib/filter/doctrine/PluginsfSimpleCommentFormFilter.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/lib/filter/doctrine/PluginsfSimpleCommentFormFilter.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/lib/filter/doctrine/PluginsfSimpleCommentFormFilter.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * PluginsfSimpleComment form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage filter
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: sfDoctrineFormFilterPluginTemplate.php 23810
2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+abstract class PluginsfSimpleCommentFormFilter extends
BasesfSimpleCommentFormFilter
+{
+}
Added:
plugins/sfSimpleCommentPlugin/lib/form/doctrine/PluginsfSimpleCommentForm.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/lib/form/doctrine/PluginsfSimpleCommentForm.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/lib/form/doctrine/PluginsfSimpleCommentForm.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * PluginsfSimpleComment form.
+ *
+ * @package ##PROJECT_NAME##
+ * @subpackage form
+ * @author ##AUTHOR_NAME##
+ * @version SVN: $Id: sfDoctrineFormPluginTemplate.php 23810 2009-11-12
11:07:44Z Kris.Wallsmith $
+ */
+abstract class PluginsfSimpleCommentForm extends BasesfSimpleCommentForm
+{
+ public function setup()
+ {
+ unset($this['user_id'], $this['created_at'], $this['updated_at']);
+
+ $this->widgetSchema['refpath'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['refpath'] = new sfValidatorString(array(
+ 'min_length' => 3,
+ 'required' => true
+ ));
+
+ $this->widgetSchema['object_id'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['object_id'] = new sfValidatorInteger(array(
+ 'required' => true
+ ));
+
+ $this->widgetSchema['object_type'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['object_type'] = new sfValidatorRegex(array(
+ 'pattern' => '/^('.implode('|',
sfConfig::get('app_sfSimpleComment_commentable_types')).')$/',
+ 'required' => true
+ ));
+
+
+ $this->widgetSchema['body'] = new sfWidgetFormTextarea();
+ $this->validatorSchema['body'] = new sfValidatorString(array(
+ 'min_length' => 3,
+ 'max_length' => 255,
+ 'required' => true
+ ));
+
+ $this->widgetSchema->setNameFormat('sfSimpleComment[%s]');
+ }
+}
Added:
plugins/sfSimpleCommentPlugin/lib/form/doctrine/sfSimpleCommentForm.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/lib/form/doctrine/sfSimpleCommentForm.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/lib/form/doctrine/sfSimpleCommentForm.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,35 @@
+<?php
+
+
+class sfSimpleCommentForm extends BaseCommentForm
+{
+ public function configure()
+ {
+ unset($this['user_id'], $this['created_at'], $this['updated_at']);
+
+ $this->widgetSchema['refpath'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['refpath'] = new sfValidatorString(array(
+ 'min_length' => 3,
+ 'required' => true
+ ));
+
+ $this->widgetSchema['object_id'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['object_id'] = new sfValidatorInteger(array(
+ 'required' => true
+ ));
+
+ $this->widgetSchema['object_type'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['object_type'] = new sfValidatorRegex(array(
+ 'pattern' => '/^('.implode('|',
sfConfig::get('app_comments_commentable_types')).')$/',
+ 'required' => true
+ ));
+
+
+ $this->widgetSchema['body'] = new sfWidgetFormTextarea();
+ $this->validatorSchema['body'] = new sfValidatorString(array(
+ 'min_length' => 3,
+ 'max_length' => 255,
+ 'required' => true
+ ));
+ }
+}
Added: plugins/sfSimpleCommentPlugin/lib/form/sfSimpleCommentForm.class.php
===================================================================
--- plugins/sfSimpleCommentPlugin/lib/form/sfSimpleCommentForm.class.php
(rev 0)
+++ plugins/sfSimpleCommentPlugin/lib/form/sfSimpleCommentForm.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,36 @@
+<?php
+
+
+class sfSimpleCommentForm extends BaseCommentForm
+{
+ public function configure()
+ {
+ unset($this['user_id'], $this['created_at'], $this['updated_at']);
+
+ $this->widgetSchema['refpath'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['refpath'] = new sfValidatorString(array(
+ 'min_length' => 3,
+ 'required' => true
+ ));
+
+ $this->widgetSchema['object_id'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['object_id'] = new sfValidatorInteger(array(
+ 'min' => 1,
+ 'required' => true
+ ));
+
+ $this->widgetSchema['object_type'] = new sfWidgetFormInputHidden();
+ $this->validatorSchema['object_type'] = new sfValidatorRegex(array(
+ 'pattern' => '/^('.implode('|',
sfConfig::get('app_comments_commentable_types')).')$/',
+ 'required' => true
+ ));
+
+
+ $this->widgetSchema['body'] = new sfWidgetFormTextarea();
+ $this->validatorSchema['body'] = new sfValidatorString(array(
+ 'min_length' => 3,
+ 'max_length' => 255,
+ 'required' => true
+ ));
+ }
+}
Added:
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleComment.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleComment.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleComment.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * PluginsfSimpleComment
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @package ##PACKAGE##
+ * @subpackage ##SUBPACKAGE##
+ * @author ##NAME## <##EMAIL##>
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class PluginsfSimpleComment extends BasesfSimpleComment
+{
+
+}
\ No newline at end of file
Added:
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleCommentTable.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleCommentTable.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/lib/model/doctrine/PluginsfSimpleCommentTable.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * PluginsfSimpleCommentTable
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ */
+class PluginsfSimpleCommentTable extends Doctrine_Table
+{
+ /**
+ * Returns an instance of this class.
+ *
+ * @return object PluginsfSimpleCommentTable
+ */
+ public static function getInstance()
+ {
+ return Doctrine_Core::getTable('PluginsfSimpleComment');
+ }
+}
\ No newline at end of file
Added: plugins/sfSimpleCommentPlugin/lib/sfSimpleCommentRouting.class.php
===================================================================
--- plugins/sfSimpleCommentPlugin/lib/sfSimpleCommentRouting.class.php
(rev 0)
+++ plugins/sfSimpleCommentPlugin/lib/sfSimpleCommentRouting.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,23 @@
+<?php
+
+
+class sfSimpleCommentRouting
+{
+ /**
+ * Listens to the routing.load_configuration event.
+ *
+ * @param sfEvent An sfEvent instance
+ */
+ static public function listenToRoutingLoadConfigurationEvent(sfEvent $event)
+ {
+ $event->getSubject()->prependRoute('sf_simple_comment', new
sfDoctrineRouteCollection(array(
+ 'name' => 'sf_simple_comment',
+ 'model' => 'sfSimpleComment',
+ 'module' => 'sfSimpleComment',
+ 'column' => 'id',
+ 'prefix_path' => 'sf_simple_comment',
+ 'with_wildcard_routes' => false,
+ 'actions' => array('create', 'delete'),
+ )));
+ }
+}
Added:
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/actions.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/actions.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/actions.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,46 @@
+<?php
+
+
+class sfSimpleCommentActions extends sfActions
+{
+ public function executeCreate(sfWebRequest $request)
+ {
+ $this->forward404Unless($request->isMethod(sfRequest::POST));
+
+ $this->form = new sfSimpleCommentForm();
+
+ $this->processForm($request, $this->form);
+
+ $this->setTemplate('new');
+ }
+
+ public function executeDelete(sfWebRequest $request)
+ {
+ $request->checkCSRFProtection();
+
+ $comment = Doctrine::getTable('sfSimpleComment')->createQuery('sc')
+ ->innerJoin('sc.User u')
+ ->where('sc.id = ?', $request->getParameter('id'))
+ ->andWhere('u.id = ?', $this->getUser()->getGuardUser()->getId())
+ ->execute();
+
+ $this->forward404Unless($comment, sprintf('Object comment does not exist
(%s).', $request->getParameter('id')));
+
+ $comment->delete();
+
+ $this->redirect($request->getReferer());
+ }
+
+ protected function processForm(sfWebRequest $request, sfForm $form)
+ {
+ $values = $request->getParameter($form->getName());
+ $form->bind($values);
+ if ($form->isValid())
+ {
+ $form->updateObject(array('user_id' =>
$this->getUser()->getGuardUser()->getId()));
+ $comment = $form->save();
+
+ $this->redirect(base64_decode($values['refpath']));
+ }
+ }
+}
Added:
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/components.class.php
===================================================================
---
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/components.class.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/actions/components.class.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,43 @@
+<?php
+
+
+class sfSimpleCommentComponents extends sfComponents
+{
+ public function executeNew()
+ {
+ $this->form = new sfSimpleCommentForm();
+ $commentable = $this->getCommentableDetails();
+
+ $this->form->setDefaults(array(
+ 'object_id' => $commentable['id'],
+ 'object_type' => $commentable['type'],
+ 'refpath' =>
base64_encode($this->getContext()->getRouting()->getCurrentInternalUri(true))
+ ));
+ }
+
+ public function executeIndex()
+ {
+ $commentable = $this->getCommentableDetails();
+
+ $this->comments = Doctrine::getTable('sfSimpleComment')->createQuery('sc')
+ ->innerJoin('sc.User u')
+ ->where('sc.object_type = ?', $commentable['type'])
+ ->andWhere('sc.object_id = ?', $commentable['id'])
+ ->execute();
+ }
+
+
+ private function getCommentableDetails()
+ {
+ $id = (int) $this->commentable->getId();
+ if ($this->commentable instanceof sfOutputEscaper) {
+ $type = (string) get_class($this->commentable->getRawValue());
+ }
+ else
+ {
+ $type = (string) get_class($this->commentable);
+ }
+
+ return array('id' => $id, 'type' => $type);
+ }
+}
Added: plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_form.php
===================================================================
--- plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_form.php
(rev 0)
+++ plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_form.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,31 @@
+<?php use_stylesheets_for_form($form) ?>
+<?php use_javascripts_for_form($form) ?>
+
+<form action="<?php echo
url_for('sfSimpleComment/'.($form->getObject()->isNew() ? 'create' :
'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() :
'')) ?>" method="post" <?php $form->isMultipart() and print
'enctype="multipart/form-data" ' ?>>
+<?php if (!$form->getObject()->isNew()): ?>
+<input type="hidden" name="sf_method" value="put" />
+<?php endif; ?>
+ <table>
+ <tfoot>
+ <tr>
+ <td colspan="2">
+ <?php echo $form->renderHiddenFields(false) ?>
+ <?php if (!$form->getObject()->isNew()): ?>
+ <?php echo link_to('Delete',
'sfSimpleComment/delete?id='.$form->getObject()->getId(), array('method' =>
'delete', 'confirm' => 'Are you sure?')) ?>
+ <?php endif; ?>
+ <input type="submit" value="<?php echo __('Save'); ?>" />
+ </td>
+ </tr>
+ </tfoot>
+ <tbody>
+ <?php echo $form->renderGlobalErrors() ?>
+ <tr>
+ <th><?php echo $form['body']->renderLabel() ?></th>
+ <td>
+ <?php echo $form['body']->renderError() ?>
+ <?php echo $form['body'] ?>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</form>
Added:
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_index.php
===================================================================
--- plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_index.php
(rev 0)
+++ plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_index.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,9 @@
+<?php foreach($comments as $comment): ?>
+ <p class="sfSimpleComment">
+ <span class="author"><?php echo $comment->getUser()->getUsername();
?></span>:
+ <?php echo $comment->getBody(); ?>
+ <span class="actions">
+ <?php echo link_to(__('Delete'),
'@sf_simple_comment_delete?id='.$comment->getId(), array('method' => 'delete',
'confirm' => __('Are you sure?'))); ?>
+ </span>
+ </p>
+<?php endforeach; ?>
Added: plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_new.php
===================================================================
--- plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_new.php
(rev 0)
+++ plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/_new.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,3 @@
+<h1><?php echo __('New Comment'); ?></h1>
+
+<?php include_partial('sfSimpleComment/form', array('form' => $form)) ?>
Added:
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/newSuccess.php
===================================================================
---
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/newSuccess.php
(rev 0)
+++
plugins/sfSimpleCommentPlugin/modules/sfSimpleComment/templates/newSuccess.php
2010-04-18 19:33:38 UTC (rev 29194)
@@ -0,0 +1,4 @@
+<h1><?php echo __('New comment'); ?></h1>
+<p><?php //echo link_to(__('Back'),
base64_decode($form->offsetGet('refpath')->getValue())); ?></p>
+
+<?php include_partial('sfSimpleComment/form', array('form' => $form)) ?>
Added: plugins/sfSimpleCommentPlugin/package.xml
===================================================================
--- plugins/sfSimpleCommentPlugin/package.xml (rev 0)
+++ plugins/sfSimpleCommentPlugin/package.xml 2010-04-18 19:33:38 UTC (rev
29194)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package packagerversion="1.4.1" version="2.0"
xmlns="http://pear.php.net/dtd/package-2.0"
xmlns:tasks="http://pear.php.net/dtd/tasks-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0
http://pear.php.net/dtd/package-2.0.xsd">
+ <name>sfSimpleCommentPlugin</name>
+ <channel>plugins.symfony-project.org</channel>
+ <summary>Comments feature plugin.</summary>
+ <description>Provides simple and easy-to-use comment
functionality.</description>
+ <lead>
+ <name>Kazuhiro Hiramatsu</name>
+ <user>khiramatsu</user>
+ <email>[email protected]</email>
+ <active>yes</active>
+ </lead>
+ <date>##CURRENT_DATE##</date>
+ <version>
+ <release>##PLUGIN_VERSION##</release>
+ <api>##API_VERSION##</api>
+ </version>
+ <stability>
+ <release>##STABILITY##</release>
+ <api>##STABILITY##</api>
+ </stability>
+ <license uri="http://www.symfony-project.org/license">MIT license</license>
+ <notes>-</notes>
+ <contents>
+ ##CONTENTS##
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.0.0</min>
+ </php>
+ <pearinstaller>
+ <min>1.4.1</min>
+ </pearinstaller>
+ <package>
+ <name>symfony</name>
+ <channel>pear.symfony-project.com</channel>
+ <min>1.4.0</min>
+ <max>1.5.0</max>
+ <exclude>1.5.0</exclude>
+ </package>
+ </required>
+ </dependencies>
+
+ <phprelease>
+ </phprelease>
+
+ <changelog>
+ <release>
+ <version>
+ <release>0.9.0</release>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <license uri="http://www.symfony-project.com/license">MIT
license</license>
+ <date>2010-04-18</date>
+ <license>MIT</license>
+ <notes>
+ Initial release.
+ </notes>
+ </release>
+ </changelog>
+</package>
--
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.