copy($r . 'updateall', $d . 'update');
-
-
foreach ($servers as $server) {
- $basePath = trim($server->base_path, '/');
- if ($basePath != '') {
- $basePath = '/' . $basePath;
- }
+ try {
+ $basePath = trim($server->base_path, '/');
+ if ($basePath != '') {
+ $basePath = '/' . $basePath;
+ }
+
+ $phpversion = floatval($server->php);
+ $image = 'php:apache';
+ if ($phpversion > 1) {
+ $image = 'php:' . $phpversion . '-apache';
+ }
+
+ /** @var FluidbookExternalInstallServer $server */
+ $server->updateHtaccess();
+ $s = $d . 'server-' . $server->id;
+ Files::copy($r . 'server', $s);
+ Files::recursiveReplaceStringInDir($s, [
+ '$sid' => $server->id,
+ '$image' => $image,
+ '$dockerpath' => ($image !== 'httpd') ? '/var/www/html' : '/usr/local/apache2/htdocs',
+ '$domains' => implode(',', Text::explodeNewLines($server->subdomains)),
+ '$hosting' => $name,
+ '$path' => $data['basepath'] . $basePath,
+ ]);
+ $updateAll[] = '/docker/fluidbook-' . $name . '/server-' . $server->id . '/update';
+ } catch (\Exception $e) {
- $phpversion=floatval($server->php);
- $image = 'php:apache';
- if ($phpversion > 1) {
- $image = 'php:' . $phpversion . '-apache';
}
-
- /** @var FluidbookExternalInstallServer $server */
- $server->updateHtaccess();
- $s = $d . 'server-' . $server->id;
- Files::copy($r . 'server', $s);
- Files::recursiveReplaceStringInDir($s, [
- '$sid' => $server->id,
- '$image' => $image,
- '$dockerpath' => ($image !== 'httpd') ? '/var/www/html' : '/usr/local/apache2/htdocs',
- '$domains' => implode(',', Text::explodeNewLines($server->subdomains)),
- '$hosting' => $name,
- '$path' => $data['basepath'] . $basePath,
- ]);
- $updateAll[] = '/docker/fluidbook-' . $name . '/server-' . $server->id . '/update';
}
Files::recursiveReplaceStringInDir($d, [
protected function _accessibility()
{
$this->_addSettingField('section_accessibility', FormBigSection::class, $this->__('Accessibilité'));
- $this->_addSettingField('audiodescriptionTexts', FilesOrURL::class, $this->__('Contenus textuels pour l\'audiodescription ou les lecteurs d\'écran'), [
+ $this->_addSettingField('accessible_contents', SelectFromArray::class, $this->__('Contenus alternatifs accessibles'), ['default' => 'disabled', 'options' => ['disabled' => __('Désactivés'), 'docling' => __('Contenus accessibles extraits automatiquement et édités'), 'excel' => __('Fichier excel ou liens "audiodescription"')]]);
+ $this->_addSettingField('audiodescriptionTexts', FilesOrURL::class, $this->__('Contenus textuels'), [
'accept' => self::$acceptXLSX,
- 'hint' => '<a href="/fluidbook-publication/$id/pdftextsforaudiodescription">' . __('Télécharger les contenus extraits du PDF au format audiodescription') . '</a>',
+ 'hint' => '<a href="/fluidbook-publication/$id/pdftextsforaudiodescription">' . $this->__('Télécharger les contenus extraits du PDF au format audiodescription') . '</a>',
+ 'when' => ['accessible_contents' => ['excel']],
]);
- $this->_addSettingField('audiodescriptionVoice', FluidbookTTSVoice::class, $this->__('Voix pour l\'audiodescription'));
+ $this->_addSettingField('audiodescription', Checkbox::class, $this->__('Activer l\'audiodescription'), ['default' => false, 'when' => ['accessible_contents' => ['docling', 'excel']]]);
+ $this->_addSettingField('audiodescriptionVoice', FluidbookTTSVoice::class, $this->__('Voix pour l\'audiodescription'), ['when' => ['audiodescription' => 1]]);
}