]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 27 Aug 2010 17:39:00 +0000 (17:39 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 27 Aug 2010 17:39:00 +0000 (17:39 +0000)
inc/ws/DAO/class.ws.dao.theme.php
inc/ws/Metier/class.ws.icone.php

index 82a30d1ff45730038a1cd2e7a542c6a5407b4dbc..5f128374769180185b057dd0510b78ed210b63b1 100644 (file)
@@ -50,7 +50,7 @@ class wsDAOTheme extends extranetDAO {
 \r
        public function sauve($data)\r
        {\r
-               $parent=$this->selectById($data['theme_id']);\r
+               $parent = $this->selectById($data['theme_id']);\r
                $c = $this->con->openCursor('themes');\r
                $c->date = TIME;\r
                $p = new wsThemeParametres($parent);\r
@@ -63,7 +63,9 @@ class wsDAOTheme extends extranetDAO {
                }\r
                $c->parametres = serialize($p);\r
                $c->update('WHERE theme_id=\'' . $this->con->escape($data['theme_id']) . '\'');\r
-               unlink(ROOT . '/themes/' . $this->args['theme_id'] . '.jpg');\r
+               if (file_exists(ROOT . '/themes/' . $data['theme_id'] . '.jpg')) {\r
+                       unlink(ROOT . '/themes/' . $data['theme_id'] . '.jpg');\r
+               }\r
        }\r
 \r
        protected function getNextId()\r
index 84b83199b8c263bf15915f40987601cbca5fe553..86e0f5fd3fe1d3015c429ea3abe3b862f0e6e6b1 100644 (file)
@@ -4,10 +4,7 @@ class wsIcone extends cubeMetier {
        public $nom;\r
        public $date;\r
 \r
-       protected $_is_new = null;\r
-\r
-       public static $files = array('index', 'normal', 'sommaire', 'print', 'send', 'bookmark', 'fullscreen', 'normalscreen', 'save','archives', 'help');\r
-\r
+       public static $files = array('index', 'normal', 'sommaire', 'print', 'send', 'bookmark', 'fullscreen', 'normalscreen', 'save', 'archives', 'help');\r
 \r
        public function makeImage()\r
        {\r
@@ -19,23 +16,19 @@ class wsIcone extends cubeMetier {
                }\r
 \r
                $h = 39;\r
-               $w = 0;\r
-               if($this->isNew()){\r
-                       $w=8;\r
-               }\r
+               $w = 5;\r
                $mod = 0;\r
 \r
-               $liste = ($this->isNew())?wsIcone::$files_new:wsIcones::$files;\r
+               $liste = self::$files;\r
 \r
                foreach($liste as $file) {\r
-                       $image = $this->isNew()?$root . 'nav-' . $file . '.png':$root . 'nav-' . $file . '-off.png';\r
+                       $image =$root . 'nav-' . $file . '.png';\r
                        $dim = getimagesize($image);\r
                        $mod = max(filemtime($image), $mod);\r
                        $h = max($h, $dim[1]);\r
                        $w += $dim[0];\r
-                       if($this->isNew()){\r
-                               $w+=16;\r
-                       }\r
+                               $w += 10;\r
+\r
                }\r
 \r
                $height = $h;\r
@@ -46,21 +39,16 @@ class wsIcone extends cubeMetier {
                imagefill($im, 0 , 0 , $color);\r
                imagesavealpha($im, true);\r
                imagealphablending($im, true);\r
-               $x = 0;\r
-               if($this->isNew()){\r
-                       $x=8;\r
-               }\r
+               $x = 5;\r
                foreach($liste as $file) {\r
-                       $image = $this->isNew()?$root . 'nav-' . $file . '.png':$root . 'nav-' . $file . '-off.png';\r
+                       $image = $root . 'nav-' . $file . '.png';\r
                        $s = imagecreatefrompng($image);\r
                        $w = imagesx($s);\r
                        $h = imagesy($s);\r
                        imagecopy($im, $s , $x , round(($height - $h) / 2) , 0 , 0 , $w , $h);\r
 \r
                        $x += $w;\r
-                       if ($this->isNew()) {\r
-                               $x += 16;\r
-                       }\r
+                       $x += 10;\r
                }\r
 \r
                imagepng($im, $final);\r