From: vincent@cubedesigners.com Date: Wed, 4 Oct 2017 17:56:50 +0000 (+0000) Subject: wip #1719 @3 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7a8e8483cf5768fe210e9a446adcd7fbcb3893f5;p=cubeextranet.git wip #1719 @3 --- diff --git a/fluidbook/icones/15/interface.svg b/fluidbook/icones/15/interface.svg index a09ec3f6a..c8f3102d6 100644 --- a/fluidbook/icones/15/interface.svg +++ b/fluidbook/icones/15/interface.svg @@ -1,3 +1,4 @@ + @@ -76,4 +77,12 @@ + + + + + + + + diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 9a0f505c6..81c26ce41 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -1322,56 +1322,125 @@ class wsMaintenance { wsDocument::cleanSVG($test, true); } - public function addSearch() { - global $core; - $r = $core->con->select('SELECT book_id, parametres FROM books WHERE book_id'); - $reset = []; - $error = []; - $skip = []; - while ($r->fetch()) { - /** @var wsBookParametres $parametres */ - try { - $former = - $parametres = unserialize($r->parametres); - $order = explode(',', $parametres->navOrder); - $former = $parametres->navOrder; - $order = array_map('trim', $order); - if (in_array('search', $order)) { - $skip[] = $r->book_id; - continue; - } + // public function addSearch() { + // global $core; + // $r = $core->con->select('SELECT book_id, parametres FROM books WHERE book_id'); + // $reset = []; + // $error = []; + // $skip = []; + // while ($r->fetch()) { + // /** @var wsBookParametres $parametres */ + // try { + // $former = + // $parametres = unserialize($r->parametres); + // $order = explode(',', $parametres->navOrder); + // $former = $parametres->navOrder; + // $order = array_map('trim', $order); + // if (in_array('search', $order)) { + // $skip[] = $r->book_id; + // continue; + // } + // + // $searchLocation = 0; + // $chaptersLocation = array_search('chapters', $order); + // if ($chaptersLocation !== false) { + // $searchLocation = $chaptersLocation + 1; + // } else { + // $indexLocation = array_search('index', $order); + // if ($indexLocation !== false) { + // $searchLocation = $indexLocation + 1; + // } + // } + // array_splice($order, $searchLocation, 0, 'search'); + // + // $newOrder = join(', ' , $order); + // + // $c = $core->con->openCursor('books'); + // $parametres->navOrder=$newOrder; + // $c->parametres = serialize($parametres); + // $c->changedate = TIME; + // $c->update('WHERE book_id=' . $r->book_id); + // $reset[] = $r->book_id . ' : ' . $former . ' -> ' . $newOrder; + // } catch (Exception $e) { + // $error[] = $r->book_id; + // } + // } + // + // echo 'reset : ' . implode('
', $reset) . '
'; + // echo 'skip : ' . implode(', ', $skip) . '
'; + // echo 'error : ' . implode(', ', $error) . '
'; + // + // } + + public static function svgToFlash() { + $iconSets = array(15); + $names = array('nav-share' => 'nav-friend', + 'nav-bookmarks' => 'nav-bookmark', + 'nav-chapters' => 'nav-sommaire', + 'nav-download' => 'nav-save', + 'nav-fullscreen' => 'nav-fullscreen', + 'nav-fullscreen-exit' => 'nav-normalscreen', + 'nav-sound-off' => 'nav-soundoff', + 'nav-sound-on' => 'nav-soundon', + ); - $searchLocation = 0; - $chaptersLocation = array_search('chapters', $order); - if ($chaptersLocation !== false) { - $searchLocation = $chaptersLocation + 1; - } else { - $indexLocation = array_search('index', $order); - if ($indexLocation !== false) { - $searchLocation = $indexLocation + 1; - } + + foreach ($iconSets as $iconSet) { + $dom = new DOMDocument(); + $svgFile = WS_ICONS . '/' . $iconSet . '/interface.svg'; + if (!$dom->loadXML(file_get_contents($svgFile))) { + die('Error loading xml : ' . $svgFile); + } + + $symbols = $dom->getElementsByTagName('symbol'); + + foreach ($symbols as $symbol) { + /* @var $symbol DOMElement */ + $id = $symbol->getAttribute('id'); + list($x, $y, $width, $height) = explode(' ', $symbol->getAttribute('viewBox')); + + $svg = ' + +' . CubeIT_Util_Xml::innerXML($symbol) . ' +'; + $dest = $id; + if (isset($names[$id])) { + $dest = $names[$id]; } - array_splice($order, $searchLocation, 0, 'search'); + $tmp = CubeIT_Files::tempnam() . '.svg'; + file_put_contents($tmp, $svg); + $png = WS_ICONS . '/' . $iconSet . '/' . $dest . '.png'; + $tmp1 = CubeIT_Files::tempnam() . '.png'; - $newOrder = join(', ' , $order); + $cmd = "/usr/bin/convert -density 200 -resize 20x20 -background none $tmp $tmp1"; + echo $cmd . "\n"; + echo `$cmd` . "\n"; - $c = $core->con->openCursor('books'); - $parametres->navOrder=$newOrder; - $c->parametres = serialize($parametres); - $c->changedate = TIME; - $c->update('WHERE book_id=' . $r->book_id); - $reset[] = $r->book_id . ' : ' . $former . ' -> ' . $newOrder; - } catch (Exception $e) { - $error[] = $r->book_id; + $cmd = "/usr/bin/convert $tmp1 -alpha extract -background white -alpha shape $png"; + echo $cmd . "\n"; + echo `$cmd` . "\n"; + + unlink($tmp1); + unlink($tmp); } + header('Content-type: text/plain'); + exit; } - - echo 'reset : ' . implode('
', $reset) . '
'; - echo 'skip : ' . implode(', ', $skip) . '
'; - echo 'error : ' . implode(', ', $error) . '
'; - } + public static function iconSetToInterface() { + $iconSets = array(2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14); + + $names = array('nav-share' => 'nav-friend', + 'nav-bookmarks' => 'nav-bookmark', + 'nav-chapters' => 'nav-sommaire', + 'nav-download' => 'nav-save', + 'nav-fullscreen' => 'nav-fullscreen', + 'nav-fullscreen-exit' => 'nav-normalscreen', + 'nav-sound-off' => 'nav-soundoff', + 'nav-sound-on' => 'nav-soundon', + ); + } } diff --git a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php index 5df3a888c..054dea8a6 100644 --- a/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/burgermenu/class.ws.html5.compiler.php @@ -1027,16 +1027,9 @@ class wsHTML5Compiler { $arrowsColor = $this->theme->parametres->arrowsColor; // Set the icon list with the color - $icons = array('nav-bookmark' => $couleurI, 'nav-friend' => $couleurI, 'nav-help' => $couleurI, 'nav-index' => $couleurI, 'nav-sommaire' => $couleurI, - 'nav-zoomin' => $couleurI, 'nav-zoomout' => $couleurI, 'nav-fullscreen' => $couleurI, - 'interface-next' => $arrowsColor, 'interface-previous' => $arrowsColor, - 'interface-sharp-next' => $arrowsColor, 'interface-sharp-previous' => $arrowsColor, - 'interface-search' => $couleurI, - 'interface-down' => $arrowsColor, 'interface-close' => $arrowsColor, + $icons = array('interface-down' => $arrowsColor, 'interface-close' => $arrowsColor, 'interface-audio-description-on' => $arrowsColor, 'interface-audio-description-off' => $arrowsColor, - 'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'nav-home' => $couleurI, 'nav-archives' => $couleurI, 'nav-map' => $couleurI, - 'nav-tag' => $couleurI, 'nav-print' => $couleurI, 'nav-friend' => $couleurI, - 'share-facebook' => $couleurM, 'share-twitter' => $couleurM, 'share-email' => $couleurM, 'share-googleplus' => $couleurM, 'share-linkedin' => $couleurM, 'share-viadeo' => $couleurM, + 'help-fingers' => $couleurI, 'help-mouse' => $couleurI, 'bookmark-left-off' => $bookmarksDisabledColors, 'bookmark-left-on' => $bookmarksEnabledColors, 'bookmark-right-off' => $bookmarksDisabledColors, 'bookmark-right-on' => $bookmarksEnabledColors ); @@ -1312,13 +1305,15 @@ class wsHTML5Compiler { $res[] = 'footer,footer a{color:' . wsHTML5::colorToCSS($this->theme->parametres->creditsColor) . ';}'; // Arrows - $res[] = '#next,#previous{background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurA) . ';}'; + $lessVariables['arrows-background'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA); + $lessVariables['arrows-color'] = wsHTML5::colorToCSS($this->theme->parametres->arrowsColor); // Audio description buttons - $res[] = '.audio-description-button{background-color:' . wsHTML5::colorToCSS($this->theme->parametres->couleurA) . ';}'; - $lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor); + $lessVariables['audiodescription-background'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA); + $lessVariables['audiodescription-color'] = wsHTML5::colorToCSS($this->theme->parametres->couleurA); // Links Styles + $lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor); $res = array_merge($res, $links); // Bookmarks