}\r
\r
$dao = new wsDAOTheme($core->con);\r
- $themes = $dao->getAllThemes($core->user, 'ORDER BY theme_id DESC');\r
+ $themes = $dao->getAllThemes($core->user, 'ORDER BY FIELD (theme_id,1) DESC, theme_id DESC');\r
foreach($themes as $theme) {\r
$t = $this->xml->addChild('theme');\r
$t->addAttribute('id', $theme->theme_id);\r
\r
if ($book_id == 'new') {\r
$dao = new wsDAOBook($core->con);\r
- $book = $dao->creeEmpty($core->user->utilisateur_id);\r
+ $book = $dao->creeEmpty($core->user->utilisateur_id,$core->user->lang);\r
http::redirect(SITE_PATH . 'editbook/' . $book->book_id);\r
}\r
\r
return $this->selectById($book_id);\r
}\r
\r
- public function creeEmpty($createur)\r
+ public function creeEmpty($createur,$lang)\r
{\r
$c = $this->con->openCursor('books');\r
$c->proprietaire = $createur;\r
$c->date_status = TIME;\r
$c->parametres = serialize(new wsParametres());\r
$c->theme = 1;\r
- $c->lang = 1;\r
+ $c->lang = $lang;\r
$book_id = $c->book_id = $this->getNextId();\r
$c->insert();\r
return $this->selectById($book_id);\r