From: vincent@cubedesigners.com Date: Fri, 27 Aug 2010 17:39:00 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6c4389da91e06740a855a2407d4328c9b23ba810;p=cubeextranet.git --- diff --git a/inc/ws/DAO/class.ws.dao.theme.php b/inc/ws/DAO/class.ws.dao.theme.php index 82a30d1ff..5f1283747 100644 --- a/inc/ws/DAO/class.ws.dao.theme.php +++ b/inc/ws/DAO/class.ws.dao.theme.php @@ -50,7 +50,7 @@ class wsDAOTheme extends extranetDAO { public function sauve($data) { - $parent=$this->selectById($data['theme_id']); + $parent = $this->selectById($data['theme_id']); $c = $this->con->openCursor('themes'); $c->date = TIME; $p = new wsThemeParametres($parent); @@ -63,7 +63,9 @@ class wsDAOTheme extends extranetDAO { } $c->parametres = serialize($p); $c->update('WHERE theme_id=\'' . $this->con->escape($data['theme_id']) . '\''); - unlink(ROOT . '/themes/' . $this->args['theme_id'] . '.jpg'); + if (file_exists(ROOT . '/themes/' . $data['theme_id'] . '.jpg')) { + unlink(ROOT . '/themes/' . $data['theme_id'] . '.jpg'); + } } protected function getNextId() diff --git a/inc/ws/Metier/class.ws.icone.php b/inc/ws/Metier/class.ws.icone.php index 84b83199b..86e0f5fd3 100644 --- a/inc/ws/Metier/class.ws.icone.php +++ b/inc/ws/Metier/class.ws.icone.php @@ -4,10 +4,7 @@ class wsIcone extends cubeMetier { public $nom; public $date; - protected $_is_new = null; - - public static $files = array('index', 'normal', 'sommaire', 'print', 'send', 'bookmark', 'fullscreen', 'normalscreen', 'save','archives', 'help'); - + public static $files = array('index', 'normal', 'sommaire', 'print', 'send', 'bookmark', 'fullscreen', 'normalscreen', 'save', 'archives', 'help'); public function makeImage() { @@ -19,23 +16,19 @@ class wsIcone extends cubeMetier { } $h = 39; - $w = 0; - if($this->isNew()){ - $w=8; - } + $w = 5; $mod = 0; - $liste = ($this->isNew())?wsIcone::$files_new:wsIcones::$files; + $liste = self::$files; foreach($liste as $file) { - $image = $this->isNew()?$root . 'nav-' . $file . '.png':$root . 'nav-' . $file . '-off.png'; + $image =$root . 'nav-' . $file . '.png'; $dim = getimagesize($image); $mod = max(filemtime($image), $mod); $h = max($h, $dim[1]); $w += $dim[0]; - if($this->isNew()){ - $w+=16; - } + $w += 10; + } $height = $h; @@ -46,21 +39,16 @@ class wsIcone extends cubeMetier { imagefill($im, 0 , 0 , $color); imagesavealpha($im, true); imagealphablending($im, true); - $x = 0; - if($this->isNew()){ - $x=8; - } + $x = 5; foreach($liste as $file) { - $image = $this->isNew()?$root . 'nav-' . $file . '.png':$root . 'nav-' . $file . '-off.png'; + $image = $root . 'nav-' . $file . '.png'; $s = imagecreatefrompng($image); $w = imagesx($s); $h = imagesy($s); imagecopy($im, $s , $x , round(($height - $h) / 2) , 0 , 0 , $w , $h); $x += $w; - if ($this->isNew()) { - $x += 16; - } + $x += 10; } imagepng($im, $final);