]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 29 Apr 2010 08:15:26 +0000 (08:15 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 29 Apr 2010 08:15:26 +0000 (08:15 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.theme.php
inc/ws/Metier/class.ws.theme.parametres.php
swf/_src/wsComposer.fla

index 405d6012c75cf52be7d182380b74f63aec13d6ba..e4650a5a740e15098af47d9c01d8be491d08229e 100644 (file)
@@ -144,7 +144,6 @@ class wsFlash extends cubeFlashGateway {
                if (isset($this->args['book_id'])) {\r
                        $dao = new wsDAOBook($core->con);\r
                        $book = $dao->selectById($this->args['book_id']);\r
-\r
                }\r
 \r
                $dao = new wsDAOTheme($core->con);\r
@@ -170,6 +169,22 @@ class wsFlash extends cubeFlashGateway {
                }\r
        }\r
 \r
+       public function deleteTheme()\r
+       {\r
+               global $core;\r
+\r
+               $dao = new wsDAOTheme($core->con);\r
+               $dao->delete($this->args['theme_id']);\r
+       }\r
+\r
+       public function renameTheme()\r
+       {\r
+               global $core;\r
+\r
+               $dao = new wsDAOTheme($core->con);\r
+               $dao->rename($this->args['theme_id'], $this->args['text']);\r
+       }\r
+\r
        public function duplicateTheme()\r
        {\r
                global $core;\r
index 3927572d79d989b6b97f52cb5ab5295a3abe55dc..ff2e0dbbafe6c7d7577518eb206dcc73c18121bd 100644 (file)
@@ -54,8 +54,30 @@ class wsDAOTheme extends extranetDAO {
                return $r->theme_id + 1;\r
        }\r
 \r
+       public function delete($theme_id)\r
+       {\r
+               if (is_null($theme_id) || $theme_id == '') {\r
+                       return;\r
+               }\r
+               $this->con->execute('DELETE FROM themes WHERE theme_id=\'' . $this->con->escape($theme_id) . '\'');\r
+               if (file_exists(ROOT . '/themes/' . $theme_id)) {\r
+                       files::deltree(ROOT . '/themes/' . $theme_id);\r
+                       unlink(ROOT . '/themes/' . $theme_id . '.jpg');\r
+               }\r
+       }\r
+\r
+       public function rename($theme_id, $newname)\r
+       {\r
+               $c = $this->con->openCursor('themes');\r
+               $c->nom = $newname;\r
+               $c->update('WHERE theme_id=\'' . $this->con->escape($theme_id) . '\'');\r
+       }\r
+\r
        public function duplicate($theme_id, $proprietaire)\r
        {\r
+               if (is_null($theme_id) || $theme_id == '') {\r
+                       return;\r
+               }\r
                $theme = $this->selectById($theme_id);\r
                // Copie des données\r
                $c = $this->con->openCursor('themes');\r
@@ -68,16 +90,23 @@ class wsDAOTheme extends extranetDAO {
                $c->date = TIME;\r
                $c->insert();\r
                // Copie des fichiers\r
-               $from = ROOT . '/themes/' . $theme_id . '/';\r
-               $to = ROOT . '/themes/' . $c->theme_id . '/';\r
+               $from = ROOT . '/themes/' . $theme_id ;\r
+               $to = ROOT . '/themes/' . $c->theme_id;\r
                $dr = opendir($from);\r
                if (!file_exists($to)) {\r
                        mkdir($to, 0777, true);\r
-               } while ($file = readdir($dr)) {\r
+               } else {\r
+                       files::deltree($to);\r
+                       mkdir($to, 0777, true);\r
+               } //.\r
+               while ($file = readdir($dr)) {\r
                        if ($file == '.' || $file == '..') {\r
                                continue;\r
                        }\r
-                       copy($from . $file, $to . $file);\r
+                       copy($from . '/' . $file, $to . '/' . $file);\r
+               }\r
+               if (file_exists($from . '.jpg')) {\r
+                       copy($from . '.jpg', $to . '.jpg');\r
                }\r
 \r
                return $this->selectById($c->theme_id);\r
index e80129150797b2b99c9bc86d7eb65b54cf1b61e9..533f143bedb0cfbcb7489369b018c6f7eecf92bf 100644 (file)
@@ -87,6 +87,8 @@ class wsThemeParametres extends wsParametres {
                        'label' => __("Afficher le reflet sur la page"), 'extra' => true, 'grade' => 4);\r
                $this->fields['usePageEdges'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
                        'label' => __("Afficher la bordure des pages"), 'extra' => true, 'grade' => 4);\r
+               $this->fields['pageEdgeColor'] = array('type' => 'couleur', 'default' => 'cccccc', 'editable' => true,\r
+                       'label' => __('Couleur de la bordure'), 'extra' => true, 'grade' => 4);\r
                $this->fields['arrowsColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
                        'label' => __('Couleur des flèches'), 'extra' => true, 'grade' => 4);\r
                $this->fields['displayPageNumber'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
@@ -105,12 +107,12 @@ class wsThemeParametres extends wsParametres {
                $this->forms['bouton'] = array('label' => __('Personnalisation des boutons'),\r
                        'fieldsnames' => array('couleurA', 'arrowsColor'));\r
                $this->forms['icones'] = array('label' => __('Personnalisation des icônes'),\r
-                       'fieldsnames' => array('iconSet','iconShadColor','|', 'colorizeIcons', 'couleurI'));\r
+                       'fieldsnames' => array('iconSet', 'iconShadColor', '|', 'colorizeIcons', 'couleurI'));\r
                $this->forms['pagesbar'] = array('label' => __('Personnalisation de la barre des pages'),\r
                        'fieldsnames' => array('pagesBar'));\r
                $this->forms['book'] = array('label' => __('Personnalisation du fluidbook'),\r
                        'fieldsnames' => array('pageReflection', 'shadeAlpha',\r
-                               '|', 'usePageEdges',\r
+                               '|', 'usePageEdges', 'pageEdgeColor',\r
                                '|', 'bookShadeColor', 'bookShadeAlpha',\r
                                '|', 'displayPageNumber', 'colorPageNumber',\r
                                '|', 'linksColor'));\r
index 856700c04643db14639ebe8a514b0ff4065c9529..9911b480dc765e628bb3b17ea67da11843c7a2e4 100644 (file)
Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ