Deltacms/core/module/config/view/setup/setup.php

202 lines
7.4 KiB
PHP

<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Paramètres';
$text[1] = 'Mise à jour automatisée';
$text[2] = 'Maintenance';
$text[3] = 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.';
$text[4] = 'Favicon';
$text[5] = 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.';
$text[6] = 'Favicon thème sombre';
$text[7] = 'Fuseau horaire';
$text[8] = 'Le fuseau horaire est utile au bon référencement';
$text[9] = 'Message de consentement aux cookies';
$text[10] = 'Activation obligatoire selon les lois françaises sauf si vous utilisez votre propre système de consentement.';
$text[11] = 'URL intelligentes';
$text[12] = 'Vérifiez d\'abord que votre serveur autorise l\'URL rewriting (ce qui n\'est pas le cas chez Free).';
$text[13] = 'Rechercher une mise à jour en ligne';
$text[14] = 'La vérification est quotidienne. Option désactivée si la configuration du serveur ne le permet pas.';
$text[15] = 'Préserver le fichier htaccess racine';
$text[16] = 'Lors d\'une mise à jour automatique, conserve le fichier htaccess de la racine du site.';
$text[17] = 'Réinstaller';
$text[18] = 'Sauvegarde automatique quotidienne du site';
$text[19] = 'Une archive contenant le dossier /site/data est copiée dans le dossier \'site/backup\'. La sauvegarde est conservée pendant 30 jours.</p><p>Les fichiers du site ne sont pas sauvegardés automatiquement. Activation recommandée.';
$text[20] = 'Site en maintenance';
$text[21] = 'Sauvegarder';
$text[22] = 'Restaurer';
$text[23] = 'Copie sauvegardes auto';
break;
case 'en' :
$text[0] = 'Parameters';
$text[1] = 'Automated update';
$text[2] = 'Maintenance';
$text[3] = 'Remember to clear your browser\'s cache if the favicon does not change';
$text[4] = 'Favicon';
$text[5] = 'Select a suitable icon for a dark theme.<br>Remember to clear your browser\'s cache if the favicon does not change.';
$text[6] = 'Favicon dark theme';
$text[7] = 'Time zone';
$text[8] = 'The time zone is useful for good referencing';
$text[9] = 'Cookie consent message';
$text[10] = 'Mandatory activation under French law unless you use your own consent system';
$text[11] = 'Smart URLs';
$text[12] = 'First check that your server allows URL rewriting (which is not the case with Free)';
$text[13] = 'Search for an online update';
$text[14] = 'The check is daily. Option disabled if server configuration does not allow it.';
$text[15] = 'Preserve the root htaccess file';
$text[16] = 'On auto-update, keep the root htaccess file';
$text[17] = 'Reinstall';
$text[18] = 'Automatic daily site backup';
$text[19] = 'An archive containing the folder /site/data is copied to the folder \'site/backup\'. The backup is kept for 30 days.</p><p>Site files are not backed up automatically. Activation recommended.';
$text[20] = 'Site under maintenance';
$text[21] = 'Save';
$text[22] = 'Restore';
$text[23] = 'Auto backup copy';
break;
}
?>
<div id="setupContainer">
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[0]; ?>
<span id="setupHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/configuration" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="row">
<div class="col4">
<?php echo template::file('configFavicon', [
'type' => 1,
'help' => $text[3],
'label' => $text[4],
'value' => $this->getData(['config', 'favicon'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('configFaviconDark', [
'type' => 1,
'help' => $text[5],
'label' => $text[6],
'value' => $this->getData(['config', 'faviconDark'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configTimezone', $module::$timezones, [
'label' => $text[7],
'selected' => $this->getData(['config', 'timezone']),
'help' => $text[8]
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configCookieConsent', true, $text[9], [
'checked' => $this->getData(['config', 'cookieConsent']),
'help' => $text[10]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('configRewrite', true, $text[11], [
'checked' => helper::checkRewrite(),
'help' => $text[12]
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[1]; ?>
<span id="updateHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/configuration#mise-a-jour" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<?php $updateError = helper::urlGetContents(common::DELTA_UPDATE_URL . common::DELTA_UPDATE_CHANNEL . '/version');?>
<div class="row">
<div class="col4">
<?php echo template::checkbox('configAutoUpdate', true, $text[13], [
'checked' => $this->getData(['config', 'autoUpdate']),
'help' => $text[14],
'disabled' => !$updateError
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('configAutoUpdateHtaccess', true, $text[15], [
'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
'help' => $text[16],
'disabled' => !$updateError
]); ?>
</div>
<div class="col2 offset1">
<?php echo template::button('configUpdateForced', [
'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update',
'value' => $text[17],
'class' => 'buttonRed',
'disabled' => !$updateError
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[2]; ?>
<span id="maintenanceHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/configuration#maintenance" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('configAutoBackup', true, $text[18], [
'checked' => $this->getData(['config', 'autoBackup']),
'help' => $text[19]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('configMaintenance', true, $text[20], [
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
</div>
<div class="rows textAlignCenter">
<div class="col3">
<?php echo template::button('configBackupButton', [
'href' => helper::baseUrl() . 'config/backup',
'value' => $text[21],
'ico' => 'download-cloud'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configRestoreButton', [
'href' => helper::baseUrl() . 'config/restore',
'value' => $text[22],
'ico' => 'upload-cloud'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configBackupCopyButton', [
'href' => helper::baseUrl() . 'config/copyBackups',
'value' => $text[23],
'ico' => 'download-cloud'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>