[Jaws-commits] r9711 - in branches/0.8/jaws/html/gadgets/Blog: . languages schema

afz at jaws-project.com afz at jaws-project.com
Wed Oct 22 18:14:01 UTC 2008


Author: afz
Date: 2008-10-22 18:14:00 +0000 (Wed, 22 Oct 2008)
New Revision: 9711

Added:
   branches/0.8/jaws/html/gadgets/Blog/schema/0.8.1.xml
Modified:
   branches/0.8/jaws/html/gadgets/Blog/AdminModel.php
   branches/0.8/jaws/html/gadgets/Blog/Info.php
   branches/0.8/jaws/html/gadgets/Blog/languages/en.php
   branches/0.8/jaws/html/gadgets/Blog/languages/fa.php
Log:
Add new feature to Blog gadget: add/check ACL for publish entries

Modified: branches/0.8/jaws/html/gadgets/Blog/AdminModel.php
===================================================================
--- branches/0.8/jaws/html/gadgets/Blog/AdminModel.php	2008-10-21 19:02:44 UTC (rev 9710)
+++ branches/0.8/jaws/html/gadgets/Blog/AdminModel.php	2008-10-22 18:14:00 UTC (rev 9711)
@@ -135,12 +135,16 @@
             }
 
             // ACL keys
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Blog/ManageTrackbacks',  'true');
+            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Blog/ManageTrackbacks',  'false');
 
             // Registry keys.
             $GLOBALS['app']->Registry->NewKey('/gadgets/Blog/trackback_status', 'approved');
         }
 
+        // ACL keys
+        $GLOBALS['app']->ACL->Set('/ACL/gadgets/Blog/ManageTrackbacks',  'false');
+        $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/Blog/PublishEntries',  'false');
+
         return true;
     }
 
@@ -423,7 +427,7 @@
         $params['title']      = $title;
         $params['content']    = str_replace("\r\n", "\n", $content);
         $params['trackbacks'] = $trackbacks;
-        $params['publish']    = $publish;
+        $params['publish']    = $GLOBALS['app']->Session->GetPermission('Blog', 'PublishEntries')? $publish : false;
         $params['fast_url']   = $fast_url;
         $params['comments']   = $allow_comments;
 
@@ -547,6 +551,11 @@
                 return new Jaws_Error(_t('BLOG_ERROR_ENTRY_NOT_UPDATED'), _t('BLOG_NAME'));
             }
         }
+
+        if (!$GLOBALS['app']->Session->GetPermission('Blog', 'PublishEntries')) {
+            $params['published']  = $e['published'];
+        }
+
         //Current fast url changes?
         if ($e['fast_url'] != $fast_url && $autoDraft === false) {
             $fast_url = $this->GetRealFastUrl($fast_url, 'blog');

Modified: branches/0.8/jaws/html/gadgets/Blog/Info.php
===================================================================
--- branches/0.8/jaws/html/gadgets/Blog/Info.php	2008-10-21 19:02:44 UTC (rev 9710)
+++ branches/0.8/jaws/html/gadgets/Blog/Info.php	2008-10-22 18:14:00 UTC (rev 9711)
@@ -21,7 +21,7 @@
         parent::Init('Blog');
         $this->GadgetName(_t('BLOG_NAME'));
         $this->GadgetDescription(_t('BLOG_DESCRIPTION'));
-        $this->GadgetVersion('0.8.1');
+        $this->GadgetVersion('0.8.2');
         $this->Doc('gadget/Blog');
         $this->ListURL(true);
 
@@ -30,6 +30,7 @@
             'AddEntries',
             'ModifyOthersEntries',
             'DeleteEntries',
+            'PublishEntries',
             'ManageComments',
             'ManageTrackbacks',
             'ManageCategories',

Modified: branches/0.8/jaws/html/gadgets/Blog/languages/en.php
===================================================================
--- branches/0.8/jaws/html/gadgets/Blog/languages/en.php	2008-10-21 19:02:44 UTC (rev 9710)
+++ branches/0.8/jaws/html/gadgets/Blog/languages/en.php	2008-10-22 18:14:00 UTC (rev 9711)
@@ -18,6 +18,7 @@
 define('_EN_BLOG_ACL_ADDENTRIES', "Add entries");
 define('_EN_BLOG_ACL_MODIFYOTHERSENTRIES', "Modify other's entries");
 define('_EN_BLOG_ACL_DELETEENTRIES', "Delete entries");
+define('_EN_BLOG_ACL_PUBLISHENTRIES', "Publish entries");
 define('_EN_BLOG_ACL_MANAGECOMMENTS', "Manage comments");
 define('_EN_BLOG_ACL_MANAGETRACKBACKS', "Manage trackbacks");
 define('_EN_BLOG_ACL_MANAGECATEGORIES', "Manage categories");

Modified: branches/0.8/jaws/html/gadgets/Blog/languages/fa.php
===================================================================
--- branches/0.8/jaws/html/gadgets/Blog/languages/fa.php	2008-10-21 19:02:44 UTC (rev 9710)
+++ branches/0.8/jaws/html/gadgets/Blog/languages/fa.php	2008-10-22 18:14:00 UTC (rev 9711)
@@ -16,6 +16,7 @@
 define('_FA_BLOG_ACL_ADDENTRIES', "افزودن مطلب");
 define('_FA_BLOG_ACL_MODIFYOTHERSENTRIES', "ویرایش مطالب دیگران");
 define('_FA_BLOG_ACL_DELETEENTRIES', "حذف مطلب");
+define('_EN_BLOG_ACL_PUBLISHENTRIES', "انتشار مطلب");
 define('_FA_BLOG_ACL_MANAGECOMMENTS', "مدیریت نظرات");
 define('_FA_BLOG_ACL_MANAGETRACKBACKS', "مدیریت دنبالک‌ها");
 define('_FA_BLOG_ACL_MANAGECATEGORIES', "مدیریت طبقه بندی ها");

Added: branches/0.8/jaws/html/gadgets/Blog/schema/0.8.1.xml
===================================================================
--- branches/0.8/jaws/html/gadgets/Blog/schema/0.8.1.xml	                        (rev 0)
+++ branches/0.8/jaws/html/gadgets/Blog/schema/0.8.1.xml	2008-10-22 18:14:00 UTC (rev 9711)
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<database>
+
+ <name><variable>database</variable></name>
+
+ <table>
+  <name><variable>table_prefix</variable>blog</name>
+  <declaration>
+
+   <field>
+    <name>id</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <autoincrement>true</autoincrement>
+   </field>
+
+   <field>
+    <name>user_id</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <default>0</default>
+   </field>
+
+   <field>
+    <name>title</name>
+    <type>text</type>
+    <length>240</length>
+    <notnull>true</notnull>
+    <default></default>
+   </field>
+
+   <field>
+    <name>text</name>
+    <type>text</type>
+   </field>
+
+   <field>
+    <name>fast_url</name>
+    <type>text</type>
+    <length>90</length>
+   </field>
+
+   <field>
+    <name>comments</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <default>0</default>
+   </field>
+
+   <field>
+    <name>clicks</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <default>0</default>
+   </field>
+
+   <field>
+    <name>allow_comments</name>
+    <type>boolean</type>
+    <notnull>true</notnull>
+    <default>true</default>
+   </field>
+
+   <field>
+    <name>trackbacks</name>
+    <type>text</type>
+   </field>
+
+   <field>
+    <name>published</name>
+    <type>boolean</type>
+    <notnull>true</notnull>
+    <default>true</default>
+   </field>
+
+   <field>
+    <name>publishtime</name>
+    <type>timestamp</type>
+   </field>
+
+   <field>
+    <name>createtime</name>
+    <type>timestamp</type>
+   </field>
+
+   <field>
+    <name>updatetime</name>
+    <type>timestamp</type>
+   </field>
+
+   <index>
+     <name><variable>table_prefix</variable>blog_fu</name>
+     <field>
+       <name>fast_url</name>
+     </field>
+   </index>
+
+  </declaration>
+ </table>
+
+ <table>
+  <name><variable>table_prefix</variable>blog_trackback</name>
+  <declaration>
+
+   <field>
+    <name>id</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <autoincrement>true</autoincrement>
+   </field>
+
+   <field>
+    <name>parent_id</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <default>0</default>
+   </field>
+
+   <field>
+    <name>url</name>
+    <type>text</type>
+    <length>255</length>
+    <notnull>true</notnull>
+    <default></default>
+   </field>
+
+   <field>
+    <name>title</name>
+    <type>text</type>
+    <length>255</length>
+    <notnull>true</notnull>
+    <default></default>
+   </field>
+
+   <field>
+    <name>excerpt</name>
+    <type>text</type>
+   </field>
+
+   <field>
+    <name>blog_name</name>
+    <type>text</type>
+    <length>255</length>
+    <notnull>true</notnull>
+    <default></default>
+   </field>
+
+   <field>
+    <name>ip</name>
+    <type>text</type>
+    <length>31</length>
+   </field>
+
+   <field>
+    <name>status</name>
+    <type>text</type>
+    <length>10</length>
+    <notnull>true</notnull>
+    <default>approved</default>
+   </field>
+
+   <field>
+    <name>createtime</name>
+    <type>timestamp</type>
+   </field>
+
+   <field>
+    <name>updatetime</name>
+    <type>timestamp</type>
+   </field>
+
+  </declaration>
+ </table>
+
+ <table>
+  <name><variable>table_prefix</variable>blog_category</name>
+  <declaration>
+
+   <field>
+    <name>id</name>
+    <type>integer</type>
+    <notnull>true</notnull>
+    <autoincrement>true</autoincrement>
+   </field>
+
+   <field>
+    <name>name</name>
+    <type>text</type>
+    <length>255</length>
+    <notnull>true</notnull>
+    <default></default>
+   </field>
+
+   <field>
+    <name>description</name>
+    <type>text</type>
+   </field>
+
+   <field>
+    <name>fast_url</name>
+    <type>text</type>
+    <length>90</length>
+    <default></default>
+   </field>
+
+   <field>
+    <name>createtime</name>
+    <type>timestamp</type>
+   </field>
+
+   <field>
+    <name>updatetime</name>
+    <type>timestamp</type>
+   </field>
+
+  </declaration>
+ </table>
+
+ <table>
+     <name><variable>table_prefix</variable>blog_entrycat</name>
+     <declaration>
+
+         <field>
+             <name>entry_id</name>
+             <type>integer</type>
+             <notnull>true</notnull>
+             <default>0</default>
+         </field>
+
+         <field>
+             <name>category_id</name>
+             <type>integer</type>
+             <notnull>true</notnull>
+             <default>0</default>
+         </field>
+
+         <index>
+             <name><variable>table_prefix</variable>blog_entrycat_ec</name>
+             <unique>true</unique>
+             <field>
+                <name>entry_id</name>
+             </field>
+             <field>
+                 <name>category_id</name>
+             </field>
+      </index>
+
+     </declaration>
+ </table>
+
+</database>



More information about the Jaws-commits mailing list