]> _ Git - cubeextranet.git/commitdiff
wait #4216 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Jul 2021 15:58:17 +0000 (15:58 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 26 Jul 2021 15:58:17 +0000 (15:58 +0000)
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.theme.php
inc/ws/Util/class.ws.ws3api.php

index 1a490029e2ed1e3a4c7efa297680782340ec73be..6996daf0fc88f5d45b6833f017545bcaa41a5459 100644 (file)
@@ -309,6 +309,7 @@ class commonCore extends cubeCore
         $db->ws3_themes->nom('varchar', 256, false);\r
         $db->ws3_themes->date('integer', 0, false);\r
         $db->ws3_themes->parametres('text', 0, false);\r
+\r
         // Clés\r
         $db->ws3_themes->primary('ws3_pk_themes', 'theme_id');\r
         $db->ws3_themes->index('ws3_index_themes_nom', 'BTREE', 'nom');\r
index f54d9179c3871542a35a4f1dba8975a6d4a32b75..e91f84b93b7330516bac16f11946bcb64d3690d2 100644 (file)
@@ -513,7 +513,7 @@ class wsFlash extends cubeFlashGateway
     {
         global $core;
         $dao = new wsDAOIcone($core->con);
-        $icones = $dao->selectAll('ORDER BY FIELD(icone_id,13,15) DESC, icone_id DESC');
+        $icones = $dao->selectAll('WHERE icone_id=15 ORDER BY FIELD(icone_id,13,15) DESC, icone_id DESC');
         foreach ($icones as $icone) {
             $i = $this->xml->addChild('icone');
             $i->addAttribute('id', $icone->icone_id);
index 127249a2ef5dafad3eb10eefadfaf611b3db22c8..b10f61ee977142445527885f0e3c570a34322d70 100644 (file)
@@ -117,21 +117,8 @@ class wsDAOTheme extends commonDAO
 \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
-            if (!isset($p->$k)) {\r
-                continue;\r
-            }\r
-            $p->$k = $v;\r
-        }\r
-        $c->parametres = serialize($p);\r
-        $c->update('WHERE theme_id=\'' . $this->con->escape($data['theme_id']) . '\'');\r
-\r
         $api = new ws3API();\r
-        $api->updateTheme($this->selectById($data['theme_id'], 'themes_vue', true));\r
+        $api->updateTheme($data);\r
     }\r
 \r
     protected function getNextId()\r
index dea2a93fd50573a009de2ee53214f44094e80336..f86fb15366928cb116c92d4f5c75023d5d39940c 100644 (file)
@@ -14,16 +14,6 @@ class ws3API extends Zend_Rest_Client
 \r
     }\r
 \r
-    /**\r
-     * @param wsTheme $theme\r
-     * @throws Zend_Http_Client_Exception\r
-     */\r
-    public function createTheme($theme)\r
-    {\r
-        global $core;\r
-        return $this->restPost('/api/fluidbook-theme', ['api_token' => $core->user->api_token, 'theme' => $this->_themeData($theme)]);\r
-    }\r
-\r
     public function renameTheme($theme_id, $newname)\r
     {\r
         global $core;\r
@@ -36,10 +26,10 @@ class ws3API extends Zend_Rest_Client
         return $this->restPost('/api/fluidbook-theme/' . $theme_id . '/clone', ['api_token' => $core->user->api_token]);\r
     }\r
 \r
-    public function updateTheme($theme)\r
+    public function updateTheme($data)\r
     {\r
         global $core;\r
-        return $this->restPut('/api/fluidbook-theme/' . $theme->theme_id, ['api_token' => $core->user->api_token, 'theme' => $this->_themeData($theme)]);\r
+        return $this->restPut('/api/fluidbook-theme/' . $data['theme_id'], ['api_token' => $core->user->api_token, 'data' => $data]);\r
     }\r
 \r
     public function deleteTheme($themeId)\r
@@ -54,20 +44,6 @@ class ws3API extends Zend_Rest_Client
         return $this->restPut('/api/fluidbook-theme/' . $themeId . '/uploadfile/' . $field, ['api_token' => $core->user->api_token, 'path' => $path]);\r
     }\r
 \r
-    /**\r
-     * @param wsTheme $theme\r
-     */\r
-    protected function _themeData($theme)\r
-    {\r
-        $data = [];\r
-        $data['theme_id'] = $theme->theme_id;\r
-        $data['proprietaire'] = $theme->proprietaire;\r
-        $data['nom'] = $theme->nom;\r
-        $data['parametres'] = $theme->parametres->toArray();\r
-\r
-        return $data;\r
-    }\r
-\r
     public static function getResponseBody(Zend_Http_Response $response)\r
     {\r
         return $response->getBody();\r