$res .= commonPage::bh();
$res.='<form action="' . SITE_PATH . 'tools/makeFavicon" method="post" class="notajax" enctype="multipart/form-data">';
$res.='<table class="liste">';
- $res.='<tr><th colspan="2"><strong>' . __('Générer un favicon') . '</strong></th></tr>';
+ $res.='<tr><th colspan="3"><strong>' . __('Générer un favicon') . '</strong></th></tr>';
$res.='<tr><td>' . __('Veuillez charger une image carrée (dimensions optimales : 256x256 px)') . '</td>';
- $res.='<td><input type="file" name="file" /></td></tr>';
+ $res.='<td colspan="2"><input type="file" name="file" /></td></tr>';
$res.='<tr class="odd"><td>' . __('Bord arrondi') . '</td>';
- $res.='<td><input type="number" name="round" value="0" size="5" />%</td><td>Valeur</td></tr>';
- $res.='<tr><td class="right" colspan="2"><a href="#" class="submit">' . $core->typo->BoutonOK(__('Générer le favicon')) . '</a></td></td>';
+ $res.='<td><input type="number" name="round" value="0" size="5" />%</td><td>' . __('Valeurs typiques') . ' : <br>iOS : 17.54%<br />' . __('Aucun arrondi') . ' : 0%</td></tr>';
+ $res.='<tr><td colspan="3">' . __("L'arrondi ne sera pas appliqué aux icônes iOS, le système lui même se chargeant d'y appliquer les arrondis et les reflets") . '</td></tr>';
+ $res.='<tr class="odd"><td class="right" colspan="3"><a href="#" class="submit">' . $core->typo->BoutonOK(__('Générer le favicon')) . '</a></td></td>';
$res.='</table>';
$res.='</form>';
$res .= '</div>';
$openssl->setArg('-outform', 'PEM');
$openssl->execute();
-
// Generate p12 file
$openssl = new cubeCommandLine('openssl');
$openssl->setPath(CONVERTER_PATH);
$dao->setLinksAndRulers($book_id, json_encode($links), json_encode($rulers), 'Import from excel', $core->user->utilisateur_id);\r
}\r
\r
+ public static function offsetLinks($args, &$x) {\r
+ global $core;\r
+ $book_id = $args[1];\r
+ $offset = $_POST['offset'];\r
+ $from = $_POST['from'];\r
+ $internal = isset($_POST['internal']);\r
+\r
+ if ($internal) {\r
+ $daoBook = new wsDAOBook($core->con);\r
+ $book = $daoBook->selectById($book_id);\r
+ $numerotation = explode(',', $book->numerotation);\r
+ }\r
+\r
+\r
+ $dao = new wsDAODocument($core->con);\r
+ $dao->getLinksAndRulers($book_id, $links, $rulers);\r
+ $rlinks = array();\r
+ foreach ($links as $k => $link) {\r
+ if ($link['page'] >= $from) {\r
+ $link['page']+=$offset;\r
+ }\r
+ if ($internal && $link['type'] == 5) {\r
+ if ($link['numerotation'] == 'physical') {\r
+ if ($link['to'] >= $from) {\r
+ $link['to']+=$offset;\r
+ }\r
+ } else {\r
+ $ph = array_search($link['to'], $numerotation) + 1;\r
+ if ($ph >= $from) {\r
+ $ph+=$offset;\r
+ $vi = $numerotation[($ph-1)];\r
+ $link['to'] = $vi;\r
+ }\r
+ }\r
+ }\r
+\r
+ $rlinks[$k] = $link;\r
+ }\r
+\r
+ $rrulers = array();\r
+ foreach ($rulers as $k => $ruler) {\r
+ if ($ruler['page'] > $from) {\r
+ $ruler['page']+=$offset;\r
+ }\r
+ $rrulers[$k] = $ruler;\r
+ }\r
+\r
+ $dao->setLinksAndRulers($book_id, $rlinks, $rrulers, 'Offset ' . $offset . ' pages from page # ' . $from, $core->user->utilisateur_id);\r
+ $x->addReload();\r
+ }\r
+\r
}\r
\r
?>
\ No newline at end of file
}\r
\r
$bookmarks = json_decode(base64_decode($this->args['bookmarks']), true);\r
+ fb($bookmarks);\r
$files = array();\r
foreach ($bookmarks as $b) {\r
- $file = $this->getPDFComplex($this->args['id'], $b['page'] . '-' . $b['page'] + $b['nb']);\r
+ $range = $b['page'];\r
+ if ($b['nb'] > 1) {\r
+ $range.='-' . ($b['page'] + $b['nb'] - 1);\r
+ }\r
+\r
+ $file = $this->getPDFComplex($this->args['id'], $range);\r
$files[] = array('name' => $b['name'], 'file' => $file['file']);\r
}\r
\r
$mail->to = 'chequieravantages@gmail.com';\r
$body = '';\r
\r
-\r
-\r
foreach ($fields as $k => $f) {\r
$body.=$k . ' : ' . $this->args[$f] . "\r\n";\r
$datas[$f] = $this->args[$f];\r
$res .= '</head>';\r
$res .= '<body onload="this.focus();">';\r
$res .= '<div id="restoreLinks">';\r
- $res.='<div class="center" style="padding:15px;">';\r
+ $res.='<div>';\r
+ $res.='<h2>' . __('Import') . '</h2>';\r
+ $res.='<div class="center">';\r
$res.='<form action="importLinksAsExcel/' . $book_id . '" method="post" enctype="multipart/form-data" class="notajax" id="importLinksAsExcel">';\r
$res.=__("Importer des liens à partir d'un fichier Excel") . ' : <input type="file" name="file" accept="*.xlsx" />';\r
$res.='<input type="submit" value="' . __('Importer') . '" />';\r
$res.='</form>';\r
$res.='</div>';\r
+ $res.='</div>';\r
+ $res.='<hr />';\r
+\r
+ $res.='<div id="linksOffset">';\r
+ $res.='<h2>' . __('Décalage de pages') . '</h2>';\r
+ $res.='<form action="offsetLinks/' . $book_id . '" method="post" id="offsetLinks">';\r
+ $offset = form::field('offset', 3, 5);\r
+ $from = form::field('from', 3, 5);\r
+ $res.=sprintf(__('Décaler les liens de %s pages à partir de la page %s'), $offset, $from) . '<br />';\r
+ $res.='<label>' . form::checkbox('internal', 1, true) . ' ' . __('Appliquer le décalages sur les numéros de pages dans les liens internes') . '</label><br />';\r
+ $res.='<input type="submit" value="' . __('Procéder au décalage') . '" />';\r
+ $res.='</form>';\r
+ $res.='</div>';\r
+ $res.='<hr />';\r
+\r
+ $res.='<h2>' . __('Historique') . '</h2>';\r
$res .= '<table class="liste" style="width:100%;min-width:0;">';\r
$res .= '<tr>';\r
$res .= '<th>' . __('Date') . '</th>';\r
\r
$dao = new wsDAOBook($core->con);\r
\r
+ $dir = '';\r
if ($version == 'a') {\r
$version = '';\r
$dir = 'a';\r
commonDroits::error();\r
}\r
\r
+\r
echo file_get_contents(WS_BOOKS . '/html5' . $dir . '/' . $book_id . '/index' . $version . '.html');\r
exit;\r
}\r
}\r
} else if ($version == 'html5') {\r
// HTML5\r
- $checks = array($book->changedate, cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));\r
+ $checks = array($book->changedate, cubeFiles::filemtimeRecursive(WS_BOOKS . '/working/' . $book->book_id), cubeFiles::filemtimeRecursive(WS_COMPILE_ASSETS . '/_html5'), cubeFiles::filemtimeRecursive(ROOT . '/inc/ws/Util/html5'));\r
foreach ($checks as $check) {\r
if ($check > $book->compilehtml5date) {\r
return false;\r
);
public $pluginCSS = array();
public $pluginJs = array();
+ public $htmlmultimedia = array();
protected $cssX = array();
protected $cssY = array();
protected $cssWidths = array();
protected $numerotation;
protected $fontDocs = array();
protected $dir;
- protected $vdir;
+ public $vdir;
+ public $wdir;
/**
*
$this->dir = $dir;
}
$this->vdir = $this->dir;
+ $this->wdir = WS_BOOKS . '/working/' . $this->book_id . '/';
// Clean the folder
`rm -rf $this->vdir`;
}
protected function writePrint() {
- $res='';
- /*$res .= '<div id="printpages">';
- for ($i = 1; $i <= $this->book->parametres->pages; $i++) {
- $res.='<div class="printpage"><img src="data/background/150/t' . $i . '.jpg" alt="" /></div>';
- }
- $res.='</div>';*/
+ $res = '';
+ /* $res .= '<div id="printpages">';
+ for ($i = 1; $i <= $this->book->parametres->pages; $i++) {
+ $res.='<div class="printpage"><img src="data/background/150/t' . $i . '.jpg" alt="" /></div>';
+ }
+ $res.='</div>'; */
return $res;
}
$allpages = range(0, $this->book->parametres->pages + 1);
$allpages[] = 'aftersearch';
+ $allpages[] = 'background';
$this->config->links = array();
$this->config->coquilletteBack = $this->colorToCSS($this->theme->parametres->couleurA);
$this->config->coquilletteFront = $this->colorToCSS($this->theme->parametres->arrowsColor);
$this->config->videoFormats = $this->getVideosFormats(false);
+ $this->config->htmlmultimedia = $this->htmlmultimedia;
foreach ($this->additionalConfig as $k => $v) {
$this->config->$k = $v;
}
return;
}
- $origDir = WS_BOOKS . '/working/' . $this->book_id . '/';
+ $origDir = $this->wdir;
$types = $this->getVideosFormats();
if ($video) {
wsTools::encodeWebVideos($origDir . $source, null, true);
return new imageLink($id, $init, $compiler);
case 16:
return new fileLink($id, $init, $compiler);
+ case 17:
+ //return new audioLink($id,$init,$compiler);
+ break;
+ case 18:
+ case 19:
+ break;
+ case 20:
+ break;
+ case 21:
+ return new htmlMultimediaLink($id, $init, $compiler);
default:
return null;
}
$this->compiler->copyLinkFile($file, 'data/links/', $video);
}
+ public function unzipFile($file) {
+ $fdir = 'data/links/' . $this->id;
+ $dir = $this->compiler->vdir . '/' . $fdir;
+ if (!file_exists($dir)) {
+ mkdir($dir, 0777, true);
+ }
+ $unzip = new cubeCommandLine('unzip');
+ $unzip->setArg(null, $this->compiler->wdir . '/' . $file);
+ $unzip->setArg('d', $dir);
+ $unzip->execute();
+ return array('dir' => $dir, 'fdir' => $fdir);
+ }
+
public function getCSSContainer() {
}
+class htmlMultimediaLink extends wsHTML5Link {
+
+ public function getHTMLContent() {
+ $d = $this->unzipFile($this->to);
+ $w = $this->width * $this->compiler->getCssScale();
+ $h = $this->height * $this->compiler->getCssScale();
+
+ $dr = opendir($d['dir']);
+ while ($file = readdir($dr)) {
+ if ($file == '.' || $file == '..') {
+ continue;
+ }
+
+ $ext = files::getExtension($file);
+
+ if ($ext == 'js') {
+ $this->compiler->pluginJs[] = $d['fdir'] . '/' . $file;
+ $e = explode('.', $file);
+ $name = $e[0];
+ $code = '$("#l_' . $this->id . '").' . $name . '();';
+ $this->compiler->htmlmultimedia[] = $code;
+ } else if ($ext == 'css') {
+ $this->compiler->pluginCSS[] = $d['fdir'] . '/' . $file;
+ } else if ($ext == 'html') {
+ $res = file_get_contents($d['dir'] . '/' . $file);
+ unlink($d['dir'] . '/' . $file);
+ }
+ }
+
+ return $res;
+ }
+
+}
+
class webVideoPopupLink extends videoPopupLink {
public function getURL() {
});\r
}\r
\r
- $("#importLinksAsExcel").submit(function(){\r
+ $("#importLinksAsExcel,#offsetLinks").submit(function(){\r
$(this).ajaxSubmit({\r
url : SITE_PATH+'ajax/'+$(this).attr('action'),\r
success : function(data){\r
return false;\r
});\r
\r
+\r
+\r
$(".restoreLink").click(restoreLink);\r
\r
$(".hide_new_value").change(function(){\r
\r
#accepteDemandes{\r
padding:10px;\r
+}\r
+\r
+#restoreLinks{\r
+ margin:10px;\r
+}\r
+\r
+#restoreLinks hr{\r
+ margin:10px 0;\r
+}\r
+\r
+#restoreLinks h2{\r
+ margin:5px 0 10px 0;\r
}
\ No newline at end of file