From: vincent@cubedesigners.com Date: Thu, 1 Apr 2010 08:10:21 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f2978bc4e80fa8f347318d89e378092429b22c14;p=cubeextranet.git --- diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 0b2b58a86..e7ebd2f40 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -143,6 +143,19 @@ class wsFlash extends cubeFlashGateway { } } + public function getAllIcones() + { + global $core; + $dao = new wsDAOIcone($core->con); + $icones = $dao->selectAll(); + foreach($icones as $icone) { + $i = $this->xml->addChild('icone'); + $i->addAttribute('id', $icone->icone_id); + $i->addAttribute('nom', $icone->nom); + $i->addAttribute('path', ICONS . $icone->icone_id . '.png'); + } + } + protected function _themeToXML($theme) { $t = $this->xml->addChild('theme'); @@ -157,7 +170,7 @@ class wsFlash extends cubeFlashGateway { $files->addChild($k, $f); } $oo = array('on', 'off'); - foreach(wsIcones::$files as $v) { + foreach(wsIcone::$files as $v) { foreach($oo as $o) { $f = ICONS . $theme->icones . '/nav-' . $v . '-' . $o . '.png'; $files->addChild($v . '_' . $o, $f); diff --git a/inc/ws/DAO/_common.php b/inc/ws/DAO/_common.php index 9f766edb7..0fbe2cd7f 100644 --- a/inc/ws/DAO/_common.php +++ b/inc/ws/DAO/_common.php @@ -2,5 +2,6 @@ $__autoload['wsDAOBook'] = dirname(__FILE__) . '/class.ws.dao.book.php'; $__autoload['wsDAODocument'] = dirname(__FILE__) . '/class.ws.dao.document.php'; $__autoload['wsDAOTheme'] = dirname(__FILE__) . '/class.ws.dao.theme.php'; +$__autoload['wsDAOIcone'] = dirname(__FILE__) . '/class.ws.dao.icone.php'; ?> \ No newline at end of file diff --git a/inc/ws/DAO/class.ws.dao.icone.php b/inc/ws/DAO/class.ws.dao.icone.php new file mode 100644 index 000000000..8bfe03f88 --- /dev/null +++ b/inc/ws/DAO/class.ws.dao.icone.php @@ -0,0 +1,26 @@ +icone_id = $r->icone_id; + $icone->nom = $r->nom; + $icone->date = $r->date; + $icone->makeImage(); + return $icone; + } + + public function selectById($icone_id) + { + $r = $this->con->select('SELECT * FROM icones WHERE icone_id=\'' . $this->con->escape($icone_id) . '\''); + return $this->singleton($r); + } + + public function selectAll() + { + $r = $this->con->select('SELECT * FROM icones'); + return $this->factory($r); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Metier/_common.php b/inc/ws/Metier/_common.php index 3a9ee437f..b8c6e7b0d 100644 --- a/inc/ws/Metier/_common.php +++ b/inc/ws/Metier/_common.php @@ -9,6 +9,6 @@ $__autoload['wsDocument'] = dirname(__FILE__) . '/class.ws.document.php'; $__autoload['wsLink'] = dirname(__FILE__) . '/class.ws.link.php'; $__autoload['wsDocumentLocalInfos'] = dirname(__FILE__) . '/class.ws.document.localinfos.php'; $__autoload['wsBox'] = dirname(__FILE__) . '/class.ws.box.php'; -$__autoload['wsIcones'] = dirname(__FILE__) . '/class.ws.icones.php'; +$__autoload['wsIcone'] = dirname(__FILE__) . '/class.ws.icone.php'; ?> \ No newline at end of file diff --git a/inc/ws/Metier/class.ws.icone.php b/inc/ws/Metier/class.ws.icone.php new file mode 100644 index 000000000..1991984d0 --- /dev/null +++ b/inc/ws/Metier/class.ws.icone.php @@ -0,0 +1,49 @@ +icone_id . '/'; + $final = ROOT . '/icones/' . $this->icone_id . '.png'; + + if ($this->date <= filemtime($final)) { + return; + } + + $h = 0; + $w = 0; + $mod = 0; + foreach(wsIcone::$files as $file) { + $image = $root . 'nav-' . $file . '-off.png'; + $dim = getimagesize($image); + $mod = max(filemtime($file), $mod); + $h = max($h, $dim[1]); + $w += $dim[0]; + } + + $im = imagecreatetruecolor($w, $h); + imagelayereffect($im, IMG_EFFECT_REPLACE); + $color = imagecolorallocatealpha($im, 255, 255, 255, 127); + imagefill($im, 0 , 0 , $color); + imagesavealpha($im, true); + imagealphablending($im, true); + $x = 0; + foreach(self::$files as $file) { + $image = $root . 'nav-' . $file . '-off.png'; + $s = imagecreatefrompng($image); + $w = imagesx($s); + $h = imagesy($s); + imagecopy($im, $s , $x , 0 , 0 , 0 , $w , $h); + $x += $w; + } + + imagepng($im, $final); + } +} + +?> \ No newline at end of file diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index 1de956a81..a82f9eda0 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -24,6 +24,8 @@ class wsThemeParametres extends wsParametres { $this->fields['bookShadeAlpha'] = array('type' => 'integer', 'default' => 100, 'editable' => true, 'label' => __('Intensité de l\'ombre sous le fluidbook'), 'extra' => true, 'grade' => 3, 'min' => 0, 'max' => 100); + $this->fields['iconSet'] = array('type' => 'icones', 'default' => 1, 'editable' => true, + 'label' => __("Jeu d'icônes"), 'extra' => false, 'grade' => 3); /* */$this->fields['colorizeIcons'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Colorier les icônes'), 'extra' => true, 'grade' => 4); /* */$this->fields['couleurI'] = array('type' => 'couleur', 'default' => 'transparent', 'editable' => true, @@ -81,11 +83,11 @@ 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('colorizeIcons', 'couleurI')); + 'fieldsnames' => array('iconSet', 'colorizeIcons', 'couleurI')); $this->forms['pagesbar'] = array('label' => __('Personnalisation de la barre des pages'), 'fieldsnames' => array('pagesBar', 'sections', 'pagesBarTxtColor')); $this->forms['book'] = array('label' => __('Personnalisation du fluidbook'), - 'fieldsnames' => array('displayPageNumber', 'shadeAlpha', 'pageNoReflection', 'usePageEdges','bookShadeColor','bookShadeAlpha')); + 'fieldsnames' => array('displayPageNumber', 'shadeAlpha', 'pageNoReflection', 'usePageEdges', 'bookShadeColor', 'bookShadeAlpha')); $this->forms['menubar'] = array('label' => __('Personnalisation de la barre de menu'), 'fieldsnames' => array('shadeOnMenu', 'menuImage', 'couleurS')); $this->forms['menu'] = array('label' => __('Personnalisation des menus'), diff --git a/swf/_src/wsComposer.fla b/swf/_src/wsComposer.fla index c0572e7d5..1d92c219d 100644 Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ