\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
}\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
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
}\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
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