{\r
global $core;\r
$dao = new wsDAOTheme($core->con);\r
- $theme = $dao->getThemeOfBook($this->args['book_id']);\r
+ if (isset($this->args['theme_id'])) {\r
+ $theme = $dao->selectById($this->args['theme_id']);\r
+ } else {\r
+ $theme = $dao->getThemeOfBook($this->args['book_id']);\r
+ }\r
\r
$this->_themeToXML($theme);\r
}\r
$dao = new wsDAOTheme($core->con);\r
$themes = $dao->getAllThemes();\r
foreach($themes as $theme) {\r
- $this->_themeToXML($theme);\r
+ $t = $this->xml->addChild('theme');\r
+ $t->addAttribute('id', $theme->theme_id);\r
+ $t->addAttribute('nom', $theme->nom);\r
}\r
}\r
\r
+ public function postThemeShot()\r
+ {\r
+ file_put_contents(ROOT . '/themes/' . $this->args['theme_id'] . '.jpg', base64_decode($this->args['data']));\r
+ }\r
+\r
public function getAllIcones()\r
{\r
global $core;\r
$i = $this->xml->addChild('icone');\r
$i->addAttribute('id', $icone->icone_id);\r
$i->addAttribute('nom', $icone->nom);\r
- $i->addAttribute('path', ICONS . $icone->icone_id . '.png');\r
+ $i->addAttribute('path', ICONS . $icone->icone_id . '.png');\r
}\r
}\r
\r