// Définition des variables dans l'environnement de production\r
//define('DB_HOST', ':/var/run/mysqld/mysqld.sock');\r
\r
-$amacord = false;\r
-if ($_SERVER['SERVER_ADDR'] == '91.121.74.76') {\r
- $amacord = true;\r
- define('DB_HOST', '127.0.0.1');\r
-} else {\r
- define('DB_HOST', 'amarcord.cubedesigners.com');\r
-}\r
-define('AMARCORD', $amacord);\r
-define('SERVER', 'avanger');\r
\r
+define('AMARCORD', true);\r
+define('SERVER', 'avanger');\r
+define('DB_HOST', 'localhost');\r
define('DB_NAME', 'extranet');\r
define('DB_USER', 'extranet');\r
define('DB_PASSWORD', 'WvcAeYBDnrB93RXa');\r
global $core;
-
$ctrl = isset($_GET['ctrl']) && $_GET['ctrl'] == 'true';
$alt = isset($_GET['alt']) && $_GET['alt'] == 'true';
public function export($book_id, &$x, $action = 'download', $version = 'online', $destinationDir = null, $destinationFile = null) {
global $core;
+ set_time_limit(0);
if (is_null($destinationDir)) {
$destinationDir = '';
}
protected function _install() {
- $p = wsPackager::package($this->book_id, $this->version, $this->_haveToZip(),false);
+ $p = wsPackager::package($this->book_id, $this->version, $this->_haveToZip(), false);
if (strpos($p, '/fluidbook') == 0) {
$p = ROOT . $p;
}
protected function _lftp($src, $dest, $passive = false, $erase = false) {
+ set_time_limit(0);
$u = parse_url($dest);
$file = is_file($src);
}
protected function _rsync($src, $dest, $erase = false, $chown = null) {
+ set_time_limit(0);
/*if (is_file($src)) {
$dir = dirname($dest);
if (!file_exists($dir)) {
$webvideo->execute();
}
- public static function colorizeAndRasterizeIcon($iconSet, $icon, $colors, $dest, $scale, &$w, &$h, $makepng = true) {
+ public static function colorizeAndRasterizeIcon($iconSet, $icon, $colors, $dest, &$w, &$h) {
// Init directory
if (is_string($colors)) {
$colors = array('colorize' => $colors);
foreach ($colors as $k => $v) {
$replace = "#" . $v['hex'];
if ($v['opacity'] < 1) {
- $replace.='" stroke-opacity="' . $v['opacity'];
+ $replace .= '" stroke-opacity="' . $v['opacity'];
}
$svg = str_replace('$s' . $k, $replace, $svg);
$replace = "#" . $v['hex'];
if ($v['opacity'] < 1) {
- $replace.='" fill-opacity="' . $v['opacity'];
+ $replace .= '" fill-opacity="' . $v['opacity'];
}
$svg = str_replace('$' . $k, $replace, $svg);
}
}
self::copy($svgColorized, $dest . '/' . $icon . '.svg');
- // PNG
- $png = $dirColorized . '/' . $icon . '.png';
- if (!file_exists($png) || filemtime($png) <= filemtime($svgColorized)) {
- $svg = simplexml_load_file($svgColorized);
- $w = (string) $svg['width'];
- $h = (string) $svg['height'];
- $w = rtrim($w, 'px');
- $h = rtrim($h, 'px');
- // Finally rasterize it
- $batik = new cubeCommandLine('batik-rasterizer');
- $batik->setArg('d', $dirColorized);
- $batik->setArg('m', 'image/png');
- if ($scale != 1) {
- $batik->setArg('w', $w * $scale);
- $batik->setArg('h', $h * $scale);
- }
- $batik->setManualArg($svgColorized);
- $batik->execute();
- }
-
- $dim = getimagesize($png);
- $w = $dim[0] / $scale;
- $h = $dim[1] / $scale;
-
- if ($makepng) {
- self::copy($png, $dest . '/' . $icon . '.png');
- }
+ $svg = simplexml_load_file($svgColorized);
+ $w = (string)$svg['width'];
+ $h = (string)$svg['height'];
+ $w = rtrim($w, 'px');
+ $h = rtrim($h, 'px');
}
public static function copy($source, $dest) {
}
public function chiffres() {
-
+
}
}
foreach ($this->collection->datas as $group) {
foreach ($group['publications'] as $p) {
- if($p['id']) {
+ if ($p['id']) {
$this->books[] = $p['id'];
}
}
$svg = array('interface-back-arrow');
foreach ($svg as $icon) {
- wsTools::colorizeAndRasterizeIcon(1, $icon, $text, $this->vdir . '/images/', 4, $w, $h, true);
+ wsTools::colorizeAndRasterizeIcon(1, $icon, $text, $this->vdir . '/images/', $w, $h);
}
'next' => $arrowsColor, 'previous' => $arrowsColor, 'search' => $couleurI);\r
\r
foreach ($icons as $icon => $color) {\r
- wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);\r
+ wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', $w, $h);\r
$res[] = '#icon-' . $icon . '{width:' . $w . 'px;height:' . $h . 'px;background-image:url(data/images/' . $icon . '.svg), url(data/images/' . $icon . '.png);background-repeat:no-repeat;background-size:' . $w . 'px ' . $h . 'px}';\r
}\r
return $res;\r
'help-fingers' => $couleurI, 'help-mouse' => $couleurI);\r
\r
foreach ($icons as $icon => $color) {\r
- wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', 4, $w, $h);\r
+ wsTools::colorizeAndRasterizeIcon($this->theme->parametres->iconSet, $icon, $color, $this->vdir . '/data/images/', $w, $h);\r
}\r
return $res;\r
}\r