if (isset($this->args['book_id'])) {\r
$dao = new wsDAOBook($core->con);\r
$book = $dao->selectById($this->args['book_id']);\r
-\r
}\r
\r
$dao = new wsDAOTheme($core->con);\r
}\r
}\r
\r
+ public function deleteTheme()\r
+ {\r
+ global $core;\r
+\r
+ $dao = new wsDAOTheme($core->con);\r
+ $dao->delete($this->args['theme_id']);\r
+ }\r
+\r
+ public function renameTheme()\r
+ {\r
+ global $core;\r
+\r
+ $dao = new wsDAOTheme($core->con);\r
+ $dao->rename($this->args['theme_id'], $this->args['text']);\r
+ }\r
+\r
public function duplicateTheme()\r
{\r
global $core;\r
return $r->theme_id + 1;\r
}\r
\r
+ public function delete($theme_id)\r
+ {\r
+ if (is_null($theme_id) || $theme_id == '') {\r
+ return;\r
+ }\r
+ $this->con->execute('DELETE FROM themes WHERE theme_id=\'' . $this->con->escape($theme_id) . '\'');\r
+ if (file_exists(ROOT . '/themes/' . $theme_id)) {\r
+ files::deltree(ROOT . '/themes/' . $theme_id);\r
+ unlink(ROOT . '/themes/' . $theme_id . '.jpg');\r
+ }\r
+ }\r
+\r
+ public function rename($theme_id, $newname)\r
+ {\r
+ $c = $this->con->openCursor('themes');\r
+ $c->nom = $newname;\r
+ $c->update('WHERE theme_id=\'' . $this->con->escape($theme_id) . '\'');\r
+ }\r
+\r
public function duplicate($theme_id, $proprietaire)\r
{\r
+ if (is_null($theme_id) || $theme_id == '') {\r
+ return;\r
+ }\r
$theme = $this->selectById($theme_id);\r
// Copie des données\r
$c = $this->con->openCursor('themes');\r
$c->date = TIME;\r
$c->insert();\r
// Copie des fichiers\r
- $from = ROOT . '/themes/' . $theme_id . '/';\r
- $to = ROOT . '/themes/' . $c->theme_id . '/';\r
+ $from = ROOT . '/themes/' . $theme_id ;\r
+ $to = ROOT . '/themes/' . $c->theme_id;\r
$dr = opendir($from);\r
if (!file_exists($to)) {\r
mkdir($to, 0777, true);\r
- } while ($file = readdir($dr)) {\r
+ } else {\r
+ files::deltree($to);\r
+ mkdir($to, 0777, true);\r
+ } //.\r
+ while ($file = readdir($dr)) {\r
if ($file == '.' || $file == '..') {\r
continue;\r
}\r
- copy($from . $file, $to . $file);\r
+ copy($from . '/' . $file, $to . '/' . $file);\r
+ }\r
+ if (file_exists($from . '.jpg')) {\r
+ copy($from . '.jpg', $to . '.jpg');\r
}\r
\r
return $this->selectById($c->theme_id);\r
'label' => __("Afficher le reflet sur la page"), 'extra' => true, 'grade' => 4);\r
$this->fields['usePageEdges'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\r
'label' => __("Afficher la bordure des pages"), 'extra' => true, 'grade' => 4);\r
+ $this->fields['pageEdgeColor'] = array('type' => 'couleur', 'default' => 'cccccc', 'editable' => true,\r
+ 'label' => __('Couleur de la bordure'), 'extra' => true, 'grade' => 4);\r
$this->fields['arrowsColor'] = array('type' => 'couleur', 'default' => 'ffffff', 'editable' => true,\r
'label' => __('Couleur des flèches'), 'extra' => true, 'grade' => 4);\r
$this->fields['displayPageNumber'] = array('type' => 'boolean', 'default' => true, 'editable' => true,\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
- 'fieldsnames' => array('iconSet','iconShadColor','|', 'colorizeIcons', 'couleurI'));\r
+ 'fieldsnames' => array('iconSet', 'iconShadColor', '|', 'colorizeIcons', 'couleurI'));\r
$this->forms['pagesbar'] = array('label' => __('Personnalisation de la barre des pages'),\r
'fieldsnames' => array('pagesBar'));\r
$this->forms['book'] = array('label' => __('Personnalisation du fluidbook'),\r
'fieldsnames' => array('pageReflection', 'shadeAlpha',\r
- '|', 'usePageEdges',\r
+ '|', 'usePageEdges', 'pageEdgeColor',\r
'|', 'bookShadeColor', 'bookShadeAlpha',\r
'|', 'displayPageNumber', 'colorPageNumber',\r
'|', 'linksColor'));\r