\r
public static function exportbookExe($args, &$x) {\r
$exporter = new wsExporter();\r
- $exporter->export($_POST['book_id'], $x, $_POST['action'], $_POST['version'], $_POST['destination']);\r
+ $exporter->export($_POST['book_id'], $x, $_POST['action'], $_POST['version'], $_POST['destination']['dir'], $_POST['destination']['file']);\r
\r
$x->addClosePopup();\r
}\r
$defaultVersion = '';\r
}\r
\r
+ $format = false;\r
+ if ($defaultVersion != '') {\r
+ $format = $formatInstall[$defaultVersion];\r
+ }\r
+ $displayFile = ($format !== false);\r
+\r
if ($defaultAction != 'download') {\r
$daoBook = new wsDAOBook($core->con);\r
$book = $daoBook->selectById($book_id);\r
$defaultDestination['dir'] = cubeText::str2URL($book->nom);\r
}\r
\r
+ if ($defaultDestination['file'] == '') {\r
+ $defaultDestination['file'] = cubeText::str2URL($book->nom) . '.' . $format;\r
+ }\r
+\r
\r
switch ($defaultAction) {\r
case 'install_hosting':\r
\r
$destinationFile = '';\r
if ($displayFile) {\r
- $destinationFile = form::field(array('destination[file]', 'destination'), 30, 128, $defaultDestination['file']);\r
+ $destinationFile = form::field(array('destination[file]', 'destination'), 50, 128, $defaultDestination['file']);\r
}\r
\r
- $res .= '<tr><td class="right"><em>' . $s . '</em></td><td>' . form::field(array('destination[dir]', 'destination'), 40, 128, $defaultDestination['dir']) . ' / ' . $destinationFile . '</td></tr>';\r
+ $res .= '<tr><td class="right"><em>' . $s . '</em></td><td>' . form::field(array('destination[dir]', 'destination'), 50, 128, $defaultDestination['dir']) . ' / ' . $destinationFile . '</td></tr>';\r
} else {\r
$res.=$version;\r
}\r
}\r
$res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '_' . $book->hash . '" class="normallink">' . $btStats . '</a></td>';\r
if ($book->version > 1) {\r
- if ($core->user->utilisateur_id == 5) {\r
+ if ($droits->admin) {\r
$res .= '<td class="bouton"><a href="#" rel="exportbook/' . $book->book_id . '" class="popup">' . $btDownload . '</a></td>';\r
} else {\r
$res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_download_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';\r
}
protected function _haveToZip() {
- $yes = array('win-exe', 'mac-exe');
+ $yes = array('win-exe', 'mac-exe', 'win-cd');
return in_array($this->version, $yes);
}
protected function _install() {
$package = wsPackager::package($this->book_id, $this->version, $this->_haveToZip());
+ if (strpos($package, '/fluidbook') == 0) {
+ $package = ROOT . $package;
+ }
+
+
if ($this->action == 'references') {
$root = '/home/fluidbook/www/references/';
$rootURL = 'http://www.fluidbook.com/references/';
}
if (stristr($path, 'ftp://')) {
- $this->_lftp($package, $path, true);
+ $this->_lftp($package, $path, false);
} else {
$this->_rsync($package, $path);
}
}
}
- protected function _lftp($src, $dest, $passive = true, $erase = false) {
+ protected function _lftp($src, $dest, $passive = false, $erase = false) {
$u = parse_url($dest);
$file = is_file($src);
}
}
+
$lftp = new cubeCommandLine('lftp');
$lftp->setArg('u', $u['user'] . ',' . $u['pass']);
$lftp->setArg('p', $u['port']);
}
protected function _rsync($src, $dest, $erase = false) {
- if (!file_exists($dest)) {
- mkdir($dest, 0777, true);
- }
if (is_file($src)) {
+ $dir = dirname($dest);
+ if (!file_exists($dir)) {
+ mkdir($dir, 0777, true);
+ }
copy($src, $dest);
return;
}
+ if (!file_exists($dest)) {
+ mkdir($dest, 0777, true);
+ }
+
+ $cp = new cubeCommandLine('rsync');
+ $cp->setPath(CONVERTER_PATH);
if ($erase) {
- /** --del -r -z -v * */
- $cp = new cubeCommandLine('rsync');
- $cp->setPath(CONVERTER_PATH);
$cp->setArg('del');
}
$cp->setArg('t');
$res[] = '.link a.displayArea{-webkit-tap-highlight-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.4) . ';background-color:' . self::colorToCSS($this->theme->parametres->linksColor, 0.0001) . ';}';
// Bookmarks
- fb($this->book->parametres->bookmarkCornerSize);
if (!isset($this->book->parametres->bookmarkCornerSize)) {
$this->book->parametres->bookmarkCornerSize = 10;
}
$size = round($this->width * $this->book->parametres->bookmarkCornerSize * 0.0075);
- fb($size);
$res[] = '#links .bookmark{width:' . $size . 'px;height:' . $size . 'px;}';
// Menus
+ $menuColor = new CubeIT_Graphics_Color($this->theme->parametres->couleurB);
+ $menuColor->setAlpha(1);
+
+ $menuMultiply = $menuColor->multiply($menuColor);
+ $menuMultiply2 = $menuMultiply->multiply($menuColor);
+
# View
$res[] = '.portrait .mview{width:' . $w . ';min-height:' . $h . '}';
$res[] = '.landscape .mview{width:' . $w2 . ';min-height:' . $h . '}';
- $res[] = '.mview{background-color:' . self::colorToCSS($this->theme->parametres->couleurB, 1) . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';
+ $res[] = '.mview{background-color:' . $menuColor->toCSS() . ';color:' . self::colorToCSS($this->theme->parametres->subTextColor) . ';}';
+ # Topbar
+
+
+ $top = $menuColor->toCSS();
+ $bottom = $menuMultiply->setAlpha(0.3)->toCSS();
+ $border = $menuMultiply2->setAlpha(0.5)->toCSS();
+
+ $caption = ".mview .caption{
+ background: -moz-linear-gradient(top, $top 0%, $bottom 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, $top 0%,$bottom 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, $top 0%,rgba(0,0,0,0.5) 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, $top 0%,$bottom 100%); /* IE10+ */
+ background: linear-gradient(top bottom, $top 0%,$bottom 100%); /* W3C */
+ border-bottom:2px solid $border;
+ box-shadow:0 2px rgba(255,255,255,0.3);
+}
+.mview .caption:after{
+ content:'';
+ border-top:2px solid rgba(255,255,255,0.3);
+}";
+ fb($caption);
+ $res[] = $caption;
# Index
$ratio = $this->width / $this->height;
$thumbh = round(100 / $ratio);
}
public static function colorToCSS($color, $forceAlpha = null) {
- if (!is_null($forceAlpha)) {
- if ($forceAlpha <= 0) {
- $a = '00';
- } elseif ($forceAlpha < 1) {
- $a = ceil($forceAlpha * 255);
- $a = base_convert($a, 10, 16);
- if (strlen($a) == 1) {
- $a = '0' . $a;
- }
- } else {
- $a = 'FF';
- }
-
- if (strlen($color) == 6) {
- $color = $a . $color;
- } else {
- $color = $a . substr($color, 2, 6);
- }
- }
-
- if (strlen($color) == 6) {
- return '#' . $color;
- } else {
- $alpha = substr($color, 0, 2);
- $red = substr($color, 2, 2);
- $green = substr($color, 4, 2);
- $blue = substr($color, 6, 2);
-
- $components = array('alpha', 'red', 'green', 'blue');
- foreach ($components as $k => $name) {
- $hex = substr($color, $k * 2, 2);
- $$name = intval($hex, 16);
- }
- $alpha/=255;
- if ($alpha == 0) {
- return 'transparent';
- } elseif ($alpha == 1) {
- return '#' . substr($color, 2, 6);
- }
- return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha
- . ')';
- }
+ return CubeIT_Graphics_Color::colorToCSS($color, $forceAlpha);
}
}