[Jaws-commits] r12437 - in trunk/jaws/html/gadgets/StaticPage: . languages schema

afz at jaws-project.com afz at jaws-project.com
Tue Jan 17 11:32:40 UTC 2012


Author: afz
Date: 2012-01-17 11:32:40 +0000 (Tue, 17 Jan 2012)
New Revision: 12437

Added:
   trunk/jaws/html/gadgets/StaticPage/schema/0.8.3.xml
Modified:
   trunk/jaws/html/gadgets/StaticPage/AdminModel.php
   trunk/jaws/html/gadgets/StaticPage/Info.php
   trunk/jaws/html/gadgets/StaticPage/languages/en.php
   trunk/jaws/html/gadgets/StaticPage/schema/schema.xml
Log:
Trying to multi user functionality to StaticPage gadget

Modified: trunk/jaws/html/gadgets/StaticPage/AdminModel.php
===================================================================
--- trunk/jaws/html/gadgets/StaticPage/AdminModel.php	2012-01-17 11:30:37 UTC (rev 12436)
+++ trunk/jaws/html/gadgets/StaticPage/AdminModel.php	2012-01-17 11:32:40 UTC (rev 12437)
@@ -89,26 +89,6 @@
             }
         }
 
-        if (version_compare($old, '0.8.3', '<')) {
-            $result = $this->installSchema('schema.xml', '', "0.8.1.xml");
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-
-            $result = $this->InsertGroup('General', 'general', true);
-            if (Jaws_Error::IsError($result)) {
-                return $result;
-            }
-
-            // ACL keys
-            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/StaticPage/ManageGroups',  'true');
-
-            $layoutModel = $GLOBALS['app']->loadGadget('Layout', 'AdminModel');
-            if (!Jaws_Error::isError($layoutModel)) {
-                $layoutModel->ChangeGadgetActionName('StaticPage', 'Display', 'PagesList');
-            }
-        }
-
         if (version_compare($old, '0.8.0', '<')) {
             $sql = '
                 SELECT [page_id], [title], [fast_url], [published], [show_title], [content]
@@ -141,6 +121,38 @@
             $GLOBALS['app']->Session->PopLastResponse(); // emptying all responses message
         }
 
+        if (version_compare($old, '0.8.3', '<')) {
+            $result = $this->installSchema('0.8.3.xml', '', "0.8.1.xml");
+            if (Jaws_Error::IsError($result)) {
+                return $result;
+            }
+
+            $result = $this->InsertGroup('General', 'general', true);
+            if (Jaws_Error::IsError($result)) {
+                return $result;
+            }
+
+            // ACL keys
+            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/StaticPage/ManageGroups',  'false');
+
+            $layoutModel = $GLOBALS['app']->loadGadget('Layout', 'AdminModel');
+            if (!Jaws_Error::isError($layoutModel)) {
+                $layoutModel->ChangeGadgetActionName('StaticPage', 'Display', 'PagesList');
+            }
+        }
+
+        if (version_compare($old, '0.8.4', '<')) {
+            $result = $this->installSchema('schema.xml', '', "0.8.3.xml");
+            if (Jaws_Error::IsError($result)) {
+                return $result;
+            }
+
+            // ACL keys
+            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/StaticPage/PublishPages',         'false');
+            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/StaticPage/ManagePublishedPages', 'false');
+            $GLOBALS['app']->ACL->NewKey('/ACL/gadgets/StaticPage/ModifyOthersPages',    'false');
+        }
+
         return true;
     }
 

Modified: trunk/jaws/html/gadgets/StaticPage/Info.php
===================================================================
--- trunk/jaws/html/gadgets/StaticPage/Info.php	2012-01-17 11:30:37 UTC (rev 12436)
+++ trunk/jaws/html/gadgets/StaticPage/Info.php	2012-01-17 11:32:40 UTC (rev 12437)
@@ -15,7 +15,7 @@
         parent::Init('StaticPage');
         $this->GadgetName(_t('STATICPAGE_NAME'));
         $this->GadgetDescription(_t('STATICPAGE_DESCRIPTION'));
-        $this->GadgetVersion('0.8.3');
+        $this->GadgetVersion('0.8.4');
         $this->Doc('gadget/StaticPage');
         $this->ListURL(true);
 
@@ -23,6 +23,9 @@
             'AddPage',
             'EditPage',
             'DeletePage',
+            'PublishPages',
+            'ManagePublishedPages',
+            'ModifyOthersPages',
             'ManageGroups',
             'Properties'
         );

Modified: trunk/jaws/html/gadgets/StaticPage/languages/en.php
===================================================================
--- trunk/jaws/html/gadgets/StaticPage/languages/en.php	2012-01-17 11:30:37 UTC (rev 12436)
+++ trunk/jaws/html/gadgets/StaticPage/languages/en.php	2012-01-17 11:32:40 UTC (rev 12437)
@@ -30,6 +30,9 @@
 define('_EN_STATICPAGE_ACL_ADDPAGE', "Add Pages");
 define('_EN_STATICPAGE_ACL_EDITPAGE', "Edit Pages");
 define('_EN_STATICPAGE_ACL_DELETEPAGE', "Delete Pages");
+define('_EN_STATICPAGE_ACL_PUBLISHPAGES', "Publish Pages");
+define('_EN_STATICPAGE_ACL_MANAGEPUBLISHEDPAGES', "Manage Published Pages");
+define('_EN_STATICPAGE_ACL_MODIFYOTHERSPAGES', "Modify other's pages");
 define('_EN_STATICPAGE_ACL_MANAGEGROUPS', "Manage Groups");
 define('_EN_STATICPAGE_ACL_PROPERTIES', "Configure settings");
 

Added: trunk/jaws/html/gadgets/StaticPage/schema/0.8.3.xml
===================================================================
--- trunk/jaws/html/gadgets/StaticPage/schema/0.8.3.xml	                        (rev 0)
+++ trunk/jaws/html/gadgets/StaticPage/schema/0.8.3.xml	2012-01-17 11:32:40 UTC (rev 12437)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<database>
+
+  <name><variable>database</variable></name>
+
+  <table>
+    <name><variable>table_prefix</variable>static_pages</name>
+    <declaration>
+
+      <field>
+        <name>page_id</name>
+        <type>integer</type>
+        <notnull>true</notnull>
+        <autoincrement>true</autoincrement>
+      </field>
+
+      <field>
+        <name>group_id</name>
+        <type>integer</type>
+        <notnull>true</notnull>
+        <default>1</default>
+      </field>
+
+      <field>
+        <name>base_language</name>
+        <type>text</type>
+        <length>5</length>
+        <default>en</default>
+      </field>
+
+      <field>
+        <name>fast_url</name>
+        <type>text</type>
+        <length>90</length>
+      </field>
+
+      <field>
+        <name>show_title</name>
+        <type>boolean</type>
+        <notnull>true</notnull>
+        <default>Y</default>
+     </field>
+
+     <field>
+        <name>updated</name>
+        <type>timestamp</type>
+      </field>
+
+      <index>
+        <name><variable>table_prefix</variable>static_pages_fast_url</name>
+        <field>
+          <name>fast_url</name>
+        </field>
+      </index>
+
+    </declaration>
+  </table>
+
+  <table>
+    <name><variable>table_prefix</variable>static_pages_translation</name>
+    <declaration>
+
+      <field>
+        <name>translation_id</name>
+        <type>integer</type>
+        <notnull>true</notnull>
+        <autoincrement>true</autoincrement>
+      </field>
+
+      <field>
+        <name>base_id</name>
+        <type>integer</type>
+      </field>
+      
+      <field>
+        <name>title</name>
+        <type>text</type>
+        <length>255</length>
+      </field>
+
+      <field>
+        <name>content</name>
+        <type>text</type>
+      </field>
+
+      <field>
+        <name>language</name>
+        <type>text</type>
+        <length>5</length>
+        <default>en</default>
+      </field>
+
+      <field>
+        <name>published</name>
+        <type>boolean</type>
+        <notnull>true</notnull>
+        <default>Y</default>
+     </field>
+
+     <field>
+        <name>updated</name>
+        <type>timestamp</type>
+      </field>
+      
+    </declaration>
+  </table>
+
+  <table>
+    <name><variable>table_prefix</variable>static_pages_groups</name>
+    <declaration>
+
+      <field>
+        <name>id</name>
+        <type>integer</type>
+        <notnull>true</notnull>
+        <autoincrement>true</autoincrement>
+      </field>
+
+      <field>
+        <name>title</name>
+        <type>text</type>
+        <length>128</length>
+      </field>
+
+      <field>
+        <name>fast_url</name>
+        <type>text</type>
+        <length>90</length>
+      </field>
+
+      <field>
+        <name>visible</name>
+        <type>boolean</type>
+        <notnull>true</notnull>
+        <default>true</default>
+      </field>
+
+      <index>
+        <name><variable>table_prefix</variable>static_pages_gtitle</name>
+        <field>
+          <name>title</name>
+        </field>
+      </index>
+
+    </declaration>
+  </table>
+
+</database>

Modified: trunk/jaws/html/gadgets/StaticPage/schema/schema.xml
===================================================================
--- trunk/jaws/html/gadgets/StaticPage/schema/schema.xml	2012-01-17 11:30:37 UTC (rev 12436)
+++ trunk/jaws/html/gadgets/StaticPage/schema/schema.xml	2012-01-17 11:32:40 UTC (rev 12437)
@@ -91,6 +91,13 @@
       </field>
 
       <field>
+        <name>user</name>
+        <type>integer</type>
+        <notnull>false</notnull>
+        <default>0</default>
+      </field>
+
+      <field>
         <name>published</name>
         <type>boolean</type>
         <notnull>true</notnull>



More information about the Jaws-commits mailing list