From f5456aeb37b0252079a7f66e2797f2e5b263b5a6 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 16 Mar 2011 09:13:54 +0000 Subject: [PATCH] --- inc/ws/Controlleur/class.ws.flash.php | 2 +- inc/ws/Controlleur/class.ws.maintenance.php | 27 ++++++++++++--------- inc/ws/DAO/class.ws.dao.theme.php | 6 ++--- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index c604a5122..ee79600d6 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -284,7 +284,6 @@ class wsFlash extends cubeFlashGateway { } else { $theme = $dao->getThemeOfBook($this->args['book_id']); } - $this->_themeToXML($theme); } @@ -398,6 +397,7 @@ class wsFlash extends cubeFlashGateway { global $core; $dao = new wsDAOTheme($core->con); $theme = $dao->selectById($this->args['theme_id']); + foreach($theme->parametres->getForms() as $name) { $f = $this->xml->addChild('form', json_encode($theme->parametres->getForm($name))); $f->addAttribute('name', $name); diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index d8e938a4a..933e838c3 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -102,7 +102,12 @@ class wsMaintenance { public static function importThemes($oldBooks) { - global $core; + global $core, $signatures; + + $r = $core->con->select('SELECT tid,sigid FROM theme'); + while ($r->fetch()) { + $signatures[$r->tid] = $r->sigid; + } $r = $core->con->select('SELECT MAX(theme_id) AS theme_id FROM themes WHERE theme_id<1000'); $lastImported = $r->theme_id; @@ -120,7 +125,7 @@ class wsMaintenance { $parametres = new wsThemeParametres($theme); $parametres->fromRecord($r); - $c->icones = self::_oldIconesToColor($r->iid, $parametres); + self::_oldIconesToColor($r->iid, $parametres); $c->parametres = serialize($parametres); $c->insert(); @@ -166,7 +171,7 @@ class wsMaintenance { public static function importBooks($oldBooks) { - global $core, $allTrads; + global $core, $allTrads, $signatures; // Importe les fluidbooks $r = $core->con->select('SELECT * FROM ws.book WHERE bid ' . self::_sqlIn($oldBooks) . ' ORDER BY bid'); if (!$r->count()) { @@ -211,7 +216,7 @@ class wsMaintenance { } $c->numerotation = implode(',', $n); - $parametres->signature =/*$signatures[$r->tid]*/ 1; + $parametres->signature = $signatures[$r->tid]; $parametres->title = $r->titre; $parametres->visualisationMode = '0'; $c->parametres = serialize($parametres); @@ -240,15 +245,13 @@ class wsMaintenance { $parametres->menuHeight = 39; $parametres->colorizeIcons = false; $parametres->couleurI = 'ffffff'; - return $line['iid']; + } else { + $parametres->iconSet = 1; + $parametres->colorizeIcons = 1; + $parametres->iconsHMargin = 20; + $parametres->menuHeight = 39; + $parametres->couleurI = $line['color']; } - $parametres->iconSet = 1; - $parametres->colorizeIcons = 1; - $parametres->iconsHMargin = 20; - $parametres->menuHeight = 39; - $parametres->couleurI = $line['color']; - - return 1; } protected static function _getWsUser($oldid) diff --git a/inc/ws/DAO/class.ws.dao.theme.php b/inc/ws/DAO/class.ws.dao.theme.php index ab336a025..82bb9b3ac 100644 --- a/inc/ws/DAO/class.ws.dao.theme.php +++ b/inc/ws/DAO/class.ws.dao.theme.php @@ -29,9 +29,6 @@ class wsDAOTheme extends commonDAO { public function selectById($theme_id, $table = 'themes_vue') { $r = $this->con->select('SELECT * FROM ' . $table . ' WHERE theme_id=\'' . $this->con->escape($theme_id) . '\' LIMIT 1'); - if ($r->theme_id < 1000) { - return 1000; - } return $this->singleton($r); } @@ -79,6 +76,9 @@ class wsDAOTheme extends commonDAO { protected function getNextId() { $r = $this->con->select('SELECT MAX(theme_id) AS theme_id FROM themes'); + if ($r->theme_id < 1000) { + return 1000; + } return $r->theme_id + 1; } -- 2.39.5