return $this->factory($r);\r
}\r
\r
+ public function sauve($data)\r
+ {\r
+ $parent=$this->selectById($data['theme_id']);\r
+ $c = $this->con->openCursor('themes');\r
+ $c->date = TIME;\r
+ $p = new wsThemeParametres($parent);\r
+ foreach($data as $k => $v) {\r
+ try {\r
+ $p->$k = $v;\r
+ }\r
+ catch(Exception $e) {\r
+ }\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
+ }\r
+\r
protected function getNextId()\r
{\r
$r = $this->con->select('SELECT MAX(theme_id) AS theme_id FROM themes');\r
break;\r
case 'color':\r
case 'couleur':\r
- $value = substr(trim($value, '#'), 0, 6);\r
+ $value = trim($value, '#');\r
+ if (strlen($value) != 6) {\r
+ $value = dechex($value);\r
+ }\r
+ $value = cubeMath::fill($value, 6);\r
break;\r
case 'date':\r
$value = intval($value);\r
}\r
if (!isset($this->datas[$varname]) || is_null($this->datas[$varname])) {\r
if (substr($this->fields[$varname]['default'], 0, 1) == '$') {\r
- return $this->get(substr($this->fields[$varname]['default'],1));\r
+ return $this->get(substr($this->fields[$varname]['default'], 1));\r
} else {\r
return $this->fields[$varname]['default'];\r
}\r
__("Répéter") => wsTheme::REPEAT,\r
__('Ne pas répéter ni étirer') => wsTheme::NONE),\r
'default' => 0, 'editable' => true, 'label' => __('Affichage du fond'), 'grade' => 3);\r
+ $this->fields['backgroundHAlign'] = array('type' => 'combo',\r
+ 'datas' => array(__('Centré') => wsTheme::CENTER,\r
+ __('Gauche') => wsTheme::LEFT,\r
+ __("Droite") => wsTheme::RIGHT),\r
+ 'default' => wsTheme::CENTER, 'editable' => true, 'label' => __('Alignement Horizontal'), 'grade' => 3);\r
+ $this->fields['backgroundVAlign'] = array('type' => 'combo',\r
+ 'datas' => array(__('Milieu') => wsTheme::MIDDLE,\r
+ __('Haut') => wsTheme::TOP,\r
+ __("Bas") => wsTheme::BOTTOM),\r
+ 'default' => wsTheme::MIDDLE, 'editable' => true, 'label' => __('Alignement Vertical'), 'grade' => 3);\r
$this->fields['menuColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
'label' => __("Couleur du fond"), 'extra' => false, 'grade' => 3);\r
$this->fields['shadeOnMenu'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
/* Regroupement des champs par formulaire */\r
\r
$this->forms['background'] = array('label' => __('Personnalisation du fond'),\r
- 'fieldsnames' => array('backgroundColor', '|', 'useBackgroundImage', 'backgroundImage', 'repeat'));\r
+ 'fieldsnames' => array('backgroundColor', '|', 'useBackgroundImage', 'backgroundImage', '|',\r
+ 'repeat', 'backgroundHAlign', 'backgroundVAlign'));\r
$this->forms['bouton'] = array('label' => __('Personnalisation des boutons'),\r
'fieldsnames' => array('couleurA', 'arrowsColor'));\r
$this->forms['icones'] = array('label' => __('Personnalisation des icônes'),\r