$this->fields['indexAutoScroll'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Activer le scroll automatique'));
$this->fields['pdfThumbnails'] = array('type' => 'freefile', 'default' => '', 'editable' => true,
'label' => __('PDF utilisé pour générer les miniatures'), 'grade' => 1, 'fileFilter' => $pdfFilter);
- $this->fields['indexMessage'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Message en haut"), 'grade' => 1, 'hint' => __('Message en haut de la vue index'));
+ $this->fields['indexMessage'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Message en haut"), 'grade' => 1, 'hint' => __('Message en haut de la vue index'));
$this->forms['index'] = array('label' => __('Vue d\'index (vignettes)'), 'fieldsnames' => array('indexAutoScroll', 'pdfThumbnails', 'indexMessage'));
$this->forms['multimedia'] = array('label' => __('Liens et multimédia'),
'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'inlineSlideshowTransitionDuration', 'inlineSlideshowDuration', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret', '|', 'textPopupStylesheet', 'textPopupWidth', '|', 'iframePopupMaxWidth'));
//.
+
+ $voices = [
+ '' => '',
+ __('Festival (en-US)') => 'festival:voice_cmu_us_slt_arctic_hts',
+ ];
+
+ $this->fields['audiodescriptionTexts'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Contenus textuels pour l\'audiodescription'), 'fileFilter' => $seoFilter];
+ $this->fields['audiodescriptionVoice'] = ['type' => 'combo', 'datas' => $voices, 'editable' => true, 'default' => true, 'label' => __('Voix pour l\'audiodescription')];
+ $this->forms['accessibility'] = ['label' => __('Accessibilité'),
+ 'fieldsnames' => ['audiodescriptionTexts', 'audiodescriptionVoice']
+ ];
+
+ //.
$this->fields['externalArchives'] = array('type' => 'freefile', 'default' => '', 'editable' => true,
'label' => __('Archives'), 'grade' => 3, 'fileFilter' => $imageFilter);
$this->fields['externalArchivesBack'] = array('type' => 'freefile', 'default' => '', 'editable' => true,
'Bulle Groupe' => 'bulle',
'Bourbon / Suggestions' => 'bourbon',
'Avery' => 'avery',
- )
+ ),
);
$this->forms['form'] = array('label' => __('Formulaire'),
'fieldsnames' => array('form'));
$lessVariables['z'] = $this->z;
$lessVariables['book-page-width'] = $w;
+ if ($this->book->parametres->correctCenter) {
+ $lessVariables['book-page-correct-width'] = ceil($w + 1);
+ $lessVariables['book-page-correct-height'] = ceil($h + 1);
+ } else {
+ $lessVariables['book-page-correct-width'] = $w;
+ $lessVariables['book-page-correct-height'] = $h;
+ }
$lessVariables['book-page-height'] = $h;
$lessVariables['book-page-ratio'] = floatval($w) / floatval($h);
$res[] = '.doublePage._2d.axis_y.next{' . wsHTML5::writeCSSUA('transform', 'translate3d(0,' . $h . ',0)') . '}';
$res[] = '.doublePage._2d.axis_y.prev{' . wsHTML5::writeCSSUA('transform', 'translate3d(0,-' . $h . ',0)') . '}';
-
$left = $w;
$res[] = '.doublePage._3d{left:' . $left . ';}';
$lessVariables['display-page-number'] = $this->_lessBoolean($this->theme->parametres->displayPageNumber);
$lessVariables['page-transition-duration'] = $this->book->parametres->mobileTransitionDuration . 's';
-
- $res[] = '.background{width:100%;height:100%}';
-
if ($this->cssSVGScale != 1) {
$texts = '.texts{' . wsHTML5::writeCSSUA('transform-origin', 'top left') . ';';
$texts .= wsHTML5::writeCSSUA('transform', 'scale(' . round((1 / $this->multiply) * $cssScale * $this->cssSVGScale, 3) . ')') . ';';
$this->log('Widget written');
$this->writeSounds();
$this->log('Sound written');
+ $this->writeAccessibility();
+ $this->log('Sound accessibility');
$this->writeTexts();
$this->log('Texts written');
$this->writeExtras();
$this->vdir->copyDirectory(WS_SOUNDS . '/' . $this->book->parametres->soundTheme, 'data/sounds');
}
+ protected function writeAccessibility()
+ {
+ if ($this->book->parametres->audiodescriptionTexts == '' || $this->book->parametres->audiodescriptionVoice == '') {
+ return;
+ }
+ $file = $this->wdir . '/' . $this->book->parametres->audiodescriptionTexts;
+ new PHPExcel();
+ $reader = new PHPExcel_Reader_Excel2007();
+ $phpexcel = $reader->load($file);
+
+ $sheet = $phpexcel->getActiveSheet();
+ $maxRow = $sheet->getHighestRow(0);
+
+ for ($i = 0; $i <= $maxRow; $i++) {
+ $page = trim($sheet->getCellByColumnAndRow(0, $i)->getValue());
+ $text = trim($sheet->getCellByColumnAndRow(1, $i)->getValue());
+ if ($page == '' || $text == '') {
+ continue;
+ }
+
+ $replace = ['`' => "'",
+ '“' => '"',
+ '”' => '"',
+ '’'=> "'",
+ '—'=> " - ",
+ ];
+
+ $text = str_replace(array_keys($replace), array_values($replace), $text);
+
+ $hash = hash('sha256', $this->book->parametres->audiodescriptionVoice . '_^_' . $text);
+ $fname = $hash . '.mp3';
+ $dir = WS_BOOKS . '/audiodescription/' . $this->book_id . '/';
+ if (!file_exists($dir)) {
+ mkdir($dir, 0777, true);
+ }
+
+ $file = $dir . $fname;
+ if (!file_exists($file)) {
+ $e = explode(':', $this->book->parametres->audiodescriptionVoice);
+
+ $engine = $e[0];
+ $voice = $e[1];
+
+ if ($engine == 'festival') {
+ $tmp = CubeIT_Files::tempnam() . '.wav';
+ $tmptext = CubeIT_Files::tempnam() . '.txt';
+
+ file_put_contents($tmptext, $text);
+ $cmd = "text2wave -o $tmp $tmptext -eval \"($voice)\"";
+ `$cmd`;
+
+ `lame $tmp $file`;
+ unlink($tmp);
+ unlink($tmptext);
+ }
+ }
+
+ $this->config->audiodescription[$page] = $fname;
+ $this->vdir->copy($file, 'data/audiodescription/' . $fname);
+ }
+ }
+
protected function _writeIndex($page)
{
if (!isset($this->seo->pages[$page])) {