$api = new ws3API();
$api->uploadThemeFile($this->args['theme_id'], $this->args['fieldname'], $tmp);
-
$dir = WS_FILES . '/themes3/' . $this->args['theme_id'];
$dest = $dir . '/' . $fname;
-
- if (isset($this->args['type']) && $this->args['type'] == 'favicon') {
- $icotool = new cubeCommandLine('icotool');
- $icotool->setArg('c');
- $icotool->setArg('o', $dir . '/fluidbook.ico');
-
- $sizes = array(256, 128, 64, 32, 16);
-
- foreach ($sizes as $s) {
- $r = $dir . '/ico-' . $s . '.png';
- $it = new cubeImageTools();
- $it->loadImage($dest);
- $it->resize($s, $s, 'crop', true, 'C', 'M', 'transparent');
- $it->output('png', $r);
- $icotool->setArg(null, $r);
- }
-
- $icotool->execute();
- }
-
- if (in_array(strtolower(files::getExtension($dest)), array('svg'))) {
- // Optimize & rasterize SVG
- $orig = str_replace('.svg', '.o.svg', $dest);
- rename($dest, $orig);
- $png = str_replace('.svg', '.png', $dest);
-
- `/usr/local/bin/svgcleaner $orig $dest`;
- if (!file_exists($dest)) {
- copy($orig, $dest);
- }
- `convert -background none $dest $png`;
- }
-
$this->xml->addChild('file', $fname);
return;
}
}\r
}\r
\r
- return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme,$hybrid);\r
+ return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme, $hybrid);\r
}\r
\r
public static function getPhonegapVersion($v = 'latest')\r
return CubeIT_Graphics_Color::colorToCSS($color, $forceAlpha);\r
}\r
\r
- public static function getSourcesPath($version)\r
+ public static function getSourcesPath($version, $dir = null)\r
{\r
- if ($version === 'stable') {\r
- return WS_COMPILE_ASSETS . '/player/branches/master';\r
+ $res = WS_COMPILE_ASSETS . '/player/';\r
+ if (null !== $dir) {\r
+ $res .= $dir . '/';\r
}\r
- if ($version === 'dev') {\r
- return WS_COMPILE_ASSETS . '/player/local/master';\r
+ if ($version === 'stable') {\r
+ $res .= 'branches/master';\r
+ } else if ($version === 'dev') {\r
+ $res .= 'local/master';\r
+ } else {\r
+ list($branch, $location) = explode('|', $version);\r
+ $res .= ($location === 'git' ? 'branches' : $location) . '/' . $branch;\r
}\r
- list($branch, $location) = explode('|', $version);\r
- return WS_COMPILE_ASSETS . '/player/' . ($location === 'git' ? 'branches' : $location) . '/' . $branch;\r
+ return $res;\r
+ }\r
+\r
+ public static function getCompiledSourcesPath($version)\r
+ {\r
+ return self::getSourcesPath($version, 'compiled');\r
}\r
\r
\r
public $svg = true;
public $config = array();
public $assets = '';
+ public $compiledAssets = '';
public $phonegap = false;
public $phonegapVersion;
public $standalone = false;
$this->hybrid = $hybrid;
$this->assets = wsHTML5::getSourcesPath($this->version);
+ $this->compiledAssets = wsHTML5::getCompiledSourcesPath($this->version);
$this->phonegap = $phonegap;
$this->standalone = $standalone || $this->phonegap;
$finals['widget'] = $this->widgetJsFiles;
}
- $dirminimized = $this->assets . '/js/min/';
+ $dirminimized = $this->compiledAssets . '/js/min/';
if (!file_exists($dirminimized)) {
mkdir($dirminimized, 0777, true);
}