Author: fizyk
Date: 2010-04-11 23:07:22 +0200 (Sun, 11 Apr 2010)
New Revision: 29082

Added:
   plugins/vjCommentPlugin/TRUNK/TODO
   plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
Removed:
   plugins/vjCommentPlugin/TRUNK/package.xml
Modified:
   plugins/vjCommentPlugin/TRUNK/README
   plugins/vjCommentPlugin/TRUNK/config/app.yml
   plugins/vjCommentPlugin/TRUNK/config/doctrine/schema.yml
   
plugins/vjCommentPlugin/TRUNK/modules/comment/lib/BaseCommentComponents.class.php
Log:
added setting that allows adding relation bewteen comment and sfGuardUser, so 
it will no longer be mandatory to use sfGuardUser.

Modified: plugins/vjCommentPlugin/TRUNK/README
===================================================================
--- plugins/vjCommentPlugin/TRUNK/README        2010-04-11 20:15:21 UTC (rev 
29081)
+++ plugins/vjCommentPlugin/TRUNK/README        2010-04-11 21:07:22 UTC (rev 
29082)
@@ -1,7 +1,8 @@
 vjCommentPlugin
 =================
 
-This readme presents briefly how to use this plugin.
+This plugin proviedes possibility to add commentable functionality to your 
models, 
+which will allow users to place comments.
 
 A presentation of the plugin is available 
[here](http://www.ville-villejuif.fr/symfony/vjCommentPlugin/).
 
@@ -10,33 +11,39 @@
 
   * Install the plugin
 
-        $ symfony plugin:install vjCommentPlugin
-        $ symfony plugin:publish-assets
-        $ symfony cc
+    $ symfony plugin:install vjCommentPlugin
+    $ symfony plugin:publish-assets
+    $ symfony cc
 
+  * If you do migrations, run them now:
 
-How to make something commentable ?
+    ./symfony doctrine:generate-migrations-diff
+    ./symfony doctrine:migrate
+
+How to make something commentable?
 -------------
 
-Add behavior in your schema
+Add behavior in your schema:
 
   * edit config/doctrine/schema.yml
 
-        News:
+        YourModel:
           actAs:
             Commentable:
             # others behaviors
 
-Build your project
+Build your project:
 
-  * It's a new project (you don't have build all, so do it !)
+  * If it's a new project (you don't have build all, so do it !)
 
         $ symfony doctrine:build --all
 
-  * It's an old project (you created it before this plugin :p), I've tried 
migration but it seems to be a problem with behavior in migration so you'll 
need to rebuild your model ...
+  * If it's an old project, you're adding Commentable ability to:
 
-        $ symfony doctrine:build --all
+        $ symfony doctrine:build --model --forms --filters --sql
 
+At this point behaviour doesn't change or add anything to the model, so 
migrations will do nothing.
+
 Activate module in frontend
 
   * edit apps/your_frontend_app/config/settings.yml
@@ -54,13 +61,32 @@
 
   * edit your template file
 
-        <?php include_component('comment', 'formComment', array('object' => 
$news)) ?>
-        <?php include_component('comment', 'list', array('object' => $news, 
'i' => 0)) ?>
+        <?php include_component('comment', 'formComment', array('object' => 
$yourModelsObject)) ?>
+        <?php include_component('comment', 'list', array('object' => 
$yourModelsObject, 'i' => 0)) ?>
 
 And ... that's all !
 You only need to get your object and to pass it to the template and two 
components do the rest.
 
+Logged users and comments
+-------------
 
+Since 1.1.0 we've added setting, that would allow you to connect sfGuardUser 
with comments:
+
+  * edit apps/your_frontend_app/config/app.yml
+
+        all:
+          vjCommentPlugin:
+            guardbind: false
+            restricted: false
+
+First setting adds relation between Comment and sfGuardUser model.
+After setting it to true, make sure to run:
+
+    ./symfony doctrine:generate-migrations-diff
+    ./symfony doctrine:migrate
+
+Second setting if set to true restricts comments only to logged in user.
+
 How to enable reCaptcha
 -------------
 
@@ -114,10 +140,6 @@
 You can remove, validate or invalidate a report and edit or remove a comment.
 There's three states : untreated, validated and invalidated. By default, list 
only shows untreated reports. You can switch in filters.
 
-
-How to disable or param Gravatar
--------------
-
 In the list of the commentAdmin module, comment's body is truncated to 50 
characters by default to keep a readable list.
 You can edit this option :
 

Added: plugins/vjCommentPlugin/TRUNK/TODO
===================================================================
--- plugins/vjCommentPlugin/TRUNK/TODO                          (rev 0)
+++ plugins/vjCommentPlugin/TRUNK/TODO  2010-04-11 21:07:22 UTC (rev 29082)
@@ -0,0 +1,9 @@
+# vjCommentPlugin TODO #
+
+* Storing name, email address and website in session or cookie
+* Option to set Profile methods to retrieve website address
+* Option to set Profile methods to retrieve email address
+* set gravatar to call from gravatar website, OR use custom method to retrieve 
avatars. (trying to set folder outside of web/ for uploads makes it tricky to 
use gravatars).
+* Find a way to connect Comments with Commentable object through relation.
+* Listener for the routes
+* Special fields and listener for sfGuardUser and models
\ No newline at end of file

Modified: plugins/vjCommentPlugin/TRUNK/config/app.yml
===================================================================
--- plugins/vjCommentPlugin/TRUNK/config/app.yml        2010-04-11 20:15:21 UTC 
(rev 29081)
+++ plugins/vjCommentPlugin/TRUNK/config/app.yml        2010-04-11 21:07:22 UTC 
(rev 29082)
@@ -2,6 +2,7 @@
   recaptcha:
     enabled:        false
   vjCommentPlugin:
+    guardbind: false
     restricted: false
   commentAdmin:
     max_length:     50

Modified: plugins/vjCommentPlugin/TRUNK/config/doctrine/schema.yml
===================================================================
--- plugins/vjCommentPlugin/TRUNK/config/doctrine/schema.yml    2010-04-11 
20:15:21 UTC (rev 29081)
+++ plugins/vjCommentPlugin/TRUNK/config/doctrine/schema.yml    2010-04-11 
21:07:22 UTC (rev 29082)
@@ -34,6 +34,7 @@
       type: integer
   relations:
     Comment: { local: reply, foreign: id }
+<?php if( sfConfig::get( 'app_vjCommentPlugin_guardbind', false ) ):  ?>
     sfGuardUser:
       alias: User
       local: user_id
@@ -41,6 +42,7 @@
       foreign: id
       foreignType: many
       foreignAlias: Comments
+<?php endif; ?>
 
 
 CommentReport:

Modified: 
plugins/vjCommentPlugin/TRUNK/modules/comment/lib/BaseCommentComponents.class.php
===================================================================
--- 
plugins/vjCommentPlugin/TRUNK/modules/comment/lib/BaseCommentComponents.class.php
   2010-04-11 20:15:21 UTC (rev 29081)
+++ 
plugins/vjCommentPlugin/TRUNK/modules/comment/lib/BaseCommentComponents.class.php
   2010-04-11 21:07:22 UTC (rev 29082)
@@ -21,6 +21,9 @@
       //preparing temporary array with sent values
       $formValues = $request->getParameter($this->form->getName());
 
+      //TODO! Review this conditions:
+      //1. captcha should be enabled
+      //2. if sfGuardUser bound on, user should not be authenticated
       if(sfConfig::get('app_recaptcha_enabled') && 
$this->getUser()->isAuthenticated() )
       {
         $captcha = array(

Deleted: plugins/vjCommentPlugin/TRUNK/package.xml
===================================================================
--- plugins/vjCommentPlugin/TRUNK/package.xml   2010-04-11 20:15:21 UTC (rev 
29081)
+++ plugins/vjCommentPlugin/TRUNK/package.xml   2010-04-11 21:07:22 UTC (rev 
29082)
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package 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"; packagerversion="1.7.1" 
version="2.0" 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>vjCommentPlugin</name>
- <channel>pear.symfony-project.com</channel>
- <summary>Comment behavior + comment's administration</summary>
- <description>You want to add comments on news page, pool or anything ? Just 
use this plugin ! It provides a comment behavior. Now, everything is 
commentable !</description>
- <lead>
-  <name>Jean-Philippe MORVAN</name>
-  <user>jp_morvan</user>
-  <email>[email protected]</email>
-  <active>yes</active>
- </lead>
- <date>2010-03-29</date>
- <version>
-  <release>1.0.4</release>
-  <api>0.0.1</api>
- </version>
- <stability>
-  <release>stable</release>
-  <api>alpha</api>
- </stability>
- <license uri="http://www.symfony-project.com/license";>MIT license</license>
- <notes>-</notes>
- <contents>
-  <dir name="/">
-   <file name="config/app.yml" role="data"/>
-   <file name="config/routing.yml" role="data"/>
-   <file name="config/doctrine/schema.yml" role="data"/>
-   <file name="i18n/fr/messages.xml" role="data"/>
-   <file name="i18n/fr/sf_admin.xml" role="data"/>
-   <file name="i18n/fr/vjComment.xml" role="data"/>
-   <file name="i18n/pl/messages.xml" role="data"/>
-   <file name="i18n/pl/sf_admin.xml" role="data"/>
-   <file name="i18n/pl/vjComment.xml" role="data"/>
-   <file 
name="lib/doctrine/extension/Commentable/Template/Listener/Commentable.php" 
role="data"/>
-   <file name="lib/doctrine/extension/Commentable/Template/Commentable.php" 
role="data"/>
-   <file name="lib/filter/doctrine/PluginCommentFormFilter.class.php" 
role="data"/>
-   <file name="lib/filter/doctrine/PluginCommentReportFormFilter.class.php" 
role="data"/>
-   <file name="lib/form/doctrine/PluginCommentCommonForm.class.php" 
role="data"/>
-   <file name="lib/form/doctrine/PluginCommentForm.class.php" role="data"/>
-   <file name="lib/form/doctrine/PluginCommentReportForm.class.php" 
role="data"/>
-   <file name="lib/helper/GravatarHelper.php" role="data"/>
-   <file name="lib/model/doctrine/PluginComment.class.php" role="data"/>
-   <file name="lib/model/doctrine/PluginCommentReport.class.php" role="data"/>
-   <file name="lib/model/doctrine/PluginCommentReportTable.class.php" 
role="data"/>
-   <file name="lib/model/doctrine/PluginCommentTable.class.php" role="data"/>
-   <file name="lib/tools/GravatarApi.class.php" role="data"/>
-   <file name="lib/tools/commentTools.class.php" role="data"/>
-   <file name="modules/comment/actions/actions.class.php" role="data"/>
-   <file name="modules/comment/actions/components.class.php" role="data"/>
-   <file name="modules/comment/lib/BaseCommentActions.class.php" role="data"/>
-   <file name="modules/comment/lib/BaseCommentComponents.class.php" 
role="data"/>
-   <file name="modules/comment/templates/_comment.php" role="data"/>
-   <file name="modules/comment/templates/_comment_author.php" role="data"/>
-   <file name="modules/comment/templates/_comment_body.php" role="data"/>
-   <file name="modules/comment/templates/_comment_infos.php" role="data"/>
-   <file name="modules/comment/templates/_form.php" role="data"/>
-   <file name="modules/comment/templates/_formComment.php" role="data"/>
-   <file name="modules/comment/templates/_formReport.php" role="data"/>
-   <file name="modules/comment/templates/_list.php" role="data"/>
-   <file name="modules/comment/templates/reportSentSuccess.php" role="data"/>
-   <file name="modules/comment/templates/reportSuccess.php" role="data"/>
-   <file name="modules/commentAdmin/actions/actions.class.php" role="data"/>
-   <file name="modules/commentAdmin/config/generator.yml" role="data"/>
-   <file name="modules/commentAdmin/lib/BaseCommentAdminActions.class.php" 
role="data"/>
-   <file name="modules/commentAdmin/lib/commentAdminForm.class.php" 
role="data"/>
-   <file 
name="modules/commentAdmin/lib/commentAdminGeneratorConfiguration.class.php" 
role="data"/>
-   <file name="modules/commentAdmin/lib/commentAdminGeneratorHelper.class.php" 
role="data"/>
-   <file name="modules/commentAdmin/lib/commentAdminReplyForm.class.php" 
role="data"/>
-   <file name="modules/commentAdmin/templates/_body.php" role="data"/>
-   <file name="modules/commentAdmin/templates/_bodyReply.php" role="data"/>
-   <file name="modules/commentAdmin/templates/_form_actions.php" role="data"/>
-   <file name="modules/commentAdmin/templates/_form_header.php" role="data"/>
-   <file name="modules/commentAdmin/templates/_list.php" role="data"/>
-   <file name="modules/commentAdmin/templates/_list_header.php" role="data"/>
-   <file name="modules/commentAdmin/templates/_list_td_actions.php" 
role="data"/>
-   <file name="modules/commentAdmin/templates/indexSuccess.php" role="data"/>
-   <file name="modules/commentReportAdmin/actions/actions.class.php" 
role="data"/>
-   <file name="modules/commentReportAdmin/config/generator.yml" role="data"/>
-   <file 
name="modules/commentReportAdmin/lib/BaseCommentReportAdminActions.class.php" 
role="data"/>
-   <file 
name="modules/commentReportAdmin/lib/commentReportAdminGeneratorConfiguration.class.php"
 role="data"/>
-   <file 
name="modules/commentReportAdmin/lib/commentReportAdminGeneratorHelper.class.php"
 role="data"/>
-   <file name="modules/commentReportAdmin/templates/_comment_link.php" 
role="data"/>
-   <file name="modules/commentReportAdmin/templates/_state.php" role="data"/>
-   <file name="more/modules/fr/commentAdmin/config/generator.yml" role="data"/>
-   <file name="more/modules/fr/commentReportAdmin/config/generator.yml" 
role="data"/>
-   <file name="web/css/comment.min.css" role="data"/>
-   <file name="web/css/commentAdmin.min.css" role="data"/>
-   <file name="web/css/commentReportAdmin.min.css" role="data"/>
-   <file name="web/css/form.min.css" role="data"/>
-   <file name="web/css/formComment.min.css" role="data"/>
-   <file name="web/css/infoBulle.min.css" role="data"/>
-   <file name="web/css/replyTo.min.css" role="data"/>
-   <file name="web/css/reportComment.min.css" role="data"/>
-   <file name="web/css/reportSent.min.css" role="data"/>
-   <file name="web/images/arrow-down.png" role="data"/>
-   <file name="web/images/comments.png" role="data"/>
-   <file name="web/images/delete.png" role="data"/>
-   <file name="web/images/edit.png" role="data"/>
-   <file name="web/images/email_edit.png" role="data"/>
-   <file name="web/images/error.png" role="data"/>
-   <file name="web/images/error_delete.png" role="data"/>
-   <file name="web/images/exclamation.png" role="data"/>
-   <file name="web/images/flag_green.png" role="data"/>
-   <file name="web/images/flag_orange.png" role="data"/>
-   <file name="web/images/flag_red.png" role="data"/>
-   <file name="web/images/gravatar_default.png" role="data"/>
-   <file name="web/images/magnifier.png" role="data"/>
-   <file name="web/images/restore.png" role="data"/>
-   <file name="web/images/validate.png" role="data"/>
-   <file name="web/js/reply.js" role="data"/>
-   <file name="web/js/reply.min.js" role="data"/>
-   <file name="LICENSE" role="data"/>
-   <file name="README" role="data"/>
-  </dir>
- </contents>
- <dependencies>
-  <required>
-   <php>
-    <min>5.2.4</min>
-   </php>
-   <pearinstaller>
-    <min>1.4.1</min>
-   </pearinstaller>
-   <package>
-    <name>symfony</name>
-    <channel>pear.symfony-project.com</channel>
-    <min>1.3.0</min>
-    <max>1.5.0</max>
-    <exclude>1.5.0</exclude>
-   </package>
-  </required>
- </dependencies>
- <phprelease/>
- <changelog>
-  <release>
-   <version>
-    <release>1.0.4</release>
-   </version>
-   <stability>
-    <release>stable</release>
-   </stability>
-   <license uri="http://www.symfony-project.com/license";>MIT license</license>
-   <license>MIT</license>
-   <date>2010-03-29</date>
-   <notes>
-     * jp_morvan: move messages.fr.xml, sf_admin.fr.xml and vjComment.fr.xml 
to fr/messages.xml, fr/sf_admin.xml and fr/vjComment.xml
-     * fizyk: add polish translation
-   </notes>
-  </release>
- </changelog>
-</package>
\ No newline at end of file

Added: plugins/vjCommentPlugin/TRUNK/package.xml.tmpl
===================================================================
--- plugins/vjCommentPlugin/TRUNK/package.xml.tmpl                              
(rev 0)
+++ plugins/vjCommentPlugin/TRUNK/package.xml.tmpl      2010-04-11 21:07:22 UTC 
(rev 29082)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="##ENCODING##"?>
+<package 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"; packagerversion="1.4.1" 
version="2.0" 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>vjCommentPlugin</name>
+  <channel>plugins.symfony-project.org</channel>
+  <summary>Your name here</summary>
+  <description>Your name here</description>
+  <lead>
+    <name>Jean-Philippe MORVAN</name>
+    <user>jp_morvan</user>
+    <email>[email protected]</email>
+    <active>yes</active>
+  </lead>
+  <packager>
+    <name>Grzegorz Śliwiński</name>
+    <user>fizyk</user>
+    <email>[email protected]</email>
+    <active>yes</active>
+  </packager>
+  <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.2.4</min>
+      </php>
+      <pearinstaller>
+        <min>1.4.1</min>
+      </pearinstaller>
+      <package>
+        <name>symfony</name>
+        <channel>pear.symfony-project.com</channel>
+        <min>1.2.0</min>
+        <max>1.3.0</max>
+        <exclude>1.3.0</exclude>
+      </package>
+    </required>
+  </dependencies>
+  <phprelease></phprelease>
+  <changelog>
+    <release>
+      <version>
+        <release>1.1.0</release>
+        <api>1.0.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.symfony-project.org/license";>MIT 
license</license>
+      <date>2010-04-12</date>
+      <license>MIT</license>
+      <notes>
+        * fizyk: added setting that allows adding relation bewteen comment and 
sfGuardUser, so it will no longer be mandatory to use sfGuardUser.
+        * fizyk: integrated functionality to make use of sfGuardUser
+        * fizyk: added relation to sfGuardUser
+      </notes>
+    </release>
+    <release>
+      <version>
+        <release>1.0.4</release>
+        <api>1.0.0</api>
+      </version>
+      <stability>
+        <release>stable</release>
+        <api>stable</api>
+      </stability>
+      <license uri="http://www.symfony-project.org/license";>MIT 
license</license>
+      <date>2010-03-29</date>
+      <license>MIT</license>
+      <notes>
+        * jp_morvan: move messages.fr.xml, sf_admin.fr.xml and 
vjComment.fr.xml to fr/messages.xml, fr/sf_admin.xml and fr/vjComment.xml
+        * fizyk: add polish translation
+      </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.

Reply via email to