From: vincent@cubedesigners.com Date: Thu, 29 Apr 2010 08:15:26 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5a982508676012db3f6654f2a6b4488cbaaf0730;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 405d6012c..e4650a5a7 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -144,7 +144,6 @@ class wsFlash extends cubeFlashGateway { if (isset($this->args['book_id'])) { $dao = new wsDAOBook($core->con); $book = $dao->selectById($this->args['book_id']); - } $dao = new wsDAOTheme($core->con); @@ -170,6 +169,22 @@ class wsFlash extends cubeFlashGateway { } } + public function deleteTheme() + { + global $core; + + $dao = new wsDAOTheme($core->con); + $dao->delete($this->args['theme_id']); + } + + public function renameTheme() + { + global $core; + + $dao = new wsDAOTheme($core->con); + $dao->rename($this->args['theme_id'], $this->args['text']); + } + public function duplicateTheme() { global $core; diff --git a/inc/ws/DAO/class.ws.dao.theme.php b/inc/ws/DAO/class.ws.dao.theme.php index 3927572d7..ff2e0dbba 100644 --- a/inc/ws/DAO/class.ws.dao.theme.php +++ b/inc/ws/DAO/class.ws.dao.theme.php @@ -54,8 +54,30 @@ class wsDAOTheme extends extranetDAO { return $r->theme_id + 1; } + public function delete($theme_id) + { + if (is_null($theme_id) || $theme_id == '') { + return; + } + $this->con->execute('DELETE FROM themes WHERE theme_id=\'' . $this->con->escape($theme_id) . '\''); + if (file_exists(ROOT . '/themes/' . $theme_id)) { + files::deltree(ROOT . '/themes/' . $theme_id); + unlink(ROOT . '/themes/' . $theme_id . '.jpg'); + } + } + + public function rename($theme_id, $newname) + { + $c = $this->con->openCursor('themes'); + $c->nom = $newname; + $c->update('WHERE theme_id=\'' . $this->con->escape($theme_id) . '\''); + } + public function duplicate($theme_id, $proprietaire) { + if (is_null($theme_id) || $theme_id == '') { + return; + } $theme = $this->selectById($theme_id); // Copie des données $c = $this->con->openCursor('themes'); @@ -68,16 +90,23 @@ class wsDAOTheme extends extranetDAO { $c->date = TIME; $c->insert(); // Copie des fichiers - $from = ROOT . '/themes/' . $theme_id . '/'; - $to = ROOT . '/themes/' . $c->theme_id . '/'; + $from = ROOT . '/themes/' . $theme_id ; + $to = ROOT . '/themes/' . $c->theme_id; $dr = opendir($from); if (!file_exists($to)) { mkdir($to, 0777, true); - } while ($file = readdir($dr)) { + } else { + files::deltree($to); + mkdir($to, 0777, true); + } //. + while ($file = readdir($dr)) { if ($file == '.' || $file == '..') { continue; } - copy($from . $file, $to . $file); + copy($from . '/' . $file, $to . '/' . $file); + } + if (file_exists($from . '.jpg')) { + copy($from . '.jpg', $to . '.jpg'); } return $this->selectById($c->theme_id); diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index e80129150..533f143be 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -87,6 +87,8 @@ class wsThemeParametres extends wsParametres { 'label' => __("Afficher le reflet sur la page"), 'extra' => true, 'grade' => 4); $this->fields['usePageEdges'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Afficher la bordure des pages"), 'extra' => true, 'grade' => 4); + $this->fields['pageEdgeColor'] = array('type' => 'couleur', 'default' => 'cccccc', 'editable' => true, + 'label' => __('Couleur de la bordure'), 'extra' => true, 'grade' => 4); $this->fields['arrowsColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true, 'label' => __('Couleur des flèches'), 'extra' => true, 'grade' => 4); $this->fields['displayPageNumber'] = array('type' => 'boolean', 'default' => true, 'editable' => true, @@ -105,12 +107,12 @@ class wsThemeParametres extends wsParametres { $this->forms['bouton'] = array('label' => __('Personnalisation des boutons'), 'fieldsnames' => array('couleurA', 'arrowsColor')); $this->forms['icones'] = array('label' => __('Personnalisation des icônes'), - 'fieldsnames' => array('iconSet','iconShadColor','|', 'colorizeIcons', 'couleurI')); + 'fieldsnames' => array('iconSet', 'iconShadColor', '|', 'colorizeIcons', 'couleurI')); $this->forms['pagesbar'] = array('label' => __('Personnalisation de la barre des pages'), 'fieldsnames' => array('pagesBar')); $this->forms['book'] = array('label' => __('Personnalisation du fluidbook'), 'fieldsnames' => array('pageReflection', 'shadeAlpha', - '|', 'usePageEdges', + '|', 'usePageEdges', 'pageEdgeColor', '|', 'bookShadeColor', 'bookShadeAlpha', '|', 'displayPageNumber', 'colorPageNumber', '|', 'linksColor')); diff --git a/swf/_src/wsComposer.fla b/swf/_src/wsComposer.fla index 856700c04..9911b480d 100644 Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ