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

247 lines
8.9 KiB
PHP
Raw Normal View History

2022-05-30 09:05:11 +02:00
<script src="core/vendor/jspdf/jspdf.min.js"></script>
2022-03-06 13:35:21 +01:00
<?php
// Lexique
2022-09-11 09:42:42 +02:00
include('./core/module/config/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_config.php');
2022-03-06 13:35:21 +01:00
?>
2022-01-31 09:10:49 +01:00
<div id="setupContainer">
<div class="row">
<div class="col12">
<div class="block">
2022-09-11 09:42:42 +02:00
<h4><?php echo $text['core_config_view']['setup'][0]; ?>
2022-01-31 09:10:49 +01:00
<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,
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][3],
'label' => $text['core_config_view']['setup'][4],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['config', 'favicon'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('configFaviconDark', [
'type' => 1,
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][5],
'label' => $text['core_config_view']['setup'][6],
2022-01-31 09:10:49 +01:00
'value' => $this->getData(['config', 'faviconDark'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configTimezone', $module::$timezones, [
2022-09-11 09:42:42 +02:00
'label' => $text['core_config_view']['setup'][7],
2022-01-31 09:10:49 +01:00
'selected' => $this->getData(['config', 'timezone']),
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][8]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('configCookieConsent', true, $text['core_config_view']['setup'][9], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['config', 'cookieConsent']),
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][10]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col6">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('configRewrite', true, $text['core_config_view']['setup'][11], [
2022-01-31 09:10:49 +01:00
'checked' => helper::checkRewrite(),
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][12]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
2022-09-11 09:42:42 +02:00
<h4><?php echo $text['core_config_view']['setup'][1]; ?>
2022-01-31 09:10:49 +01:00
<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">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('configAutoUpdate', true, $text['core_config_view']['setup'][13], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['config', 'autoUpdate']),
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][14],
2022-01-31 09:10:49 +01:00
'disabled' => !$updateError
]); ?>
</div>
<div class="col4">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('configAutoUpdateHtaccess', true, $text['core_config_view']['setup'][15], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['config', 'autoUpdateHtaccess']),
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][16],
2022-01-31 09:10:49 +01:00
'disabled' => !$updateError
]); ?>
</div>
<div class="col2 offset1">
<?php echo template::button('configUpdateForced', [
'ico' => 'download-cloud',
'href' => helper::baseUrl() . 'install/update',
2022-09-11 09:42:42 +02:00
'value' => $text['core_config_view']['setup'][17],
2022-01-31 09:10:49 +01:00
'class' => 'buttonRed',
'disabled' => !$updateError
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
2022-09-11 09:42:42 +02:00
<h4><?php echo $text['core_config_view']['setup'][2]; ?>
2022-01-31 09:10:49 +01:00
<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">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('configAutoBackup', true, $text['core_config_view']['setup'][18], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['config', 'autoBackup']),
2022-09-11 09:42:42 +02:00
'help' => $text['core_config_view']['setup'][19]
2022-01-31 09:10:49 +01:00
]); ?>
</div>
<div class="col6">
2022-09-11 09:42:42 +02:00
<?php echo template::checkbox('configMaintenance', true, $text['core_config_view']['setup'][20], [
2022-01-31 09:10:49 +01:00
'checked' => $this->getData(['config', 'maintenance'])
]); ?>
</div>
</div>
<div class="rows textAlignCenter">
<div class="col3">
<?php echo template::button('configBackupButton', [
'href' => helper::baseUrl() . 'config/backup',
2022-09-11 09:42:42 +02:00
'value' => $text['core_config_view']['setup'][21],
2022-01-31 09:10:49 +01:00
'ico' => 'download-cloud'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configRestoreButton', [
'href' => helper::baseUrl() . 'config/restore',
2022-09-11 09:42:42 +02:00
'value' => $text['core_config_view']['setup'][22],
2022-01-31 09:10:49 +01:00
'ico' => 'upload-cloud'
]); ?>
</div>
<div class="col3">
<?php echo template::button('configBackupCopyButton', [
'href' => helper::baseUrl() . 'config/copyBackups',
2022-09-11 09:42:42 +02:00
'value' => $text['core_config_view']['setup'][23],
2022-01-31 09:10:49 +01:00
'ico' => 'download-cloud'
]); ?>
</div>
</div>
</div>
</div>
</div>
2022-05-30 09:05:11 +02:00
<div class="row">
<div class="col12">
<div class="block">
<div id="infotopdf">
2022-09-11 09:42:42 +02:00
<h4><?php echo $text['core_config_view']['setup'][24]; ?></h4>
2022-05-30 09:05:11 +02:00
<div class="row">
<div class="col12">
2022-09-11 09:42:42 +02:00
<?php $textRewrite = $text['core_config_view']['setup'][30];
if( helper::checkRewrite() === true ) $textRewrite = $text['core_config_view']['setup'][29];
$listText = $text['core_config_view']['setup'][25]. common::DELTA_VERSION."\n".$text['core_config_view']['setup'][26]. phpversion()."\n".$text['core_config_view']['setup'][27]. $_SERVER['SERVER_SOFTWARE']."\n".$text['core_config_view']['setup'][28].$textRewrite;
2022-11-05 09:31:32 +01:00
echo template::textarea('modulesPhp1',[
2022-05-30 09:05:11 +02:00
'value' => $listText
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php $listMod = get_loaded_extensions();
natcasesort($listMod);
2022-09-11 09:42:42 +02:00
$listModText = $text['core_config_view']['setup'][31];
2022-05-30 09:05:11 +02:00
$listModSmall = [];
foreach( $listMod as $key=>$value){
$listModText .= $value.' - ';
$listModSmall[$key] = strtolower($value);
}
$listModText = substr( $listModText, 0, strlen($listModText) - 3);
$listModRequired = array('exif', 'gd', 'mbstring', 'xmlwriter', 'zip', 'date', 'fileinfo', 'phar');
$listDiff = array_diff( $listModRequired, $listModSmall );
if( count($listDiff) > 0) {
2022-09-11 09:42:42 +02:00
$listModText .= "\n\n".$text['core_config_view']['setup'][32];
2022-05-30 09:05:11 +02:00
foreach( $listDiff as $key=>$value){
$listModText .= $value.' - ';
}
$listModText = substr( $listModText, 0, strlen($listModText) - 3);
} else{
2022-09-11 09:42:42 +02:00
$listModText .= "\n\n".$text['core_config_view']['setup'][33];
2022-05-30 09:05:11 +02:00
}
2022-11-05 09:31:32 +01:00
echo template::textarea('modulesPhp2',[
2022-05-30 09:05:11 +02:00
'value' => $listModText
]); ?>
</div>
</div>
2022-06-21 07:53:00 +02:00
<div class="row">
<div class="col12">
<?php
$texte ='';
// Tests des directives php
$directives = array( 'allow_url_include', 'allow_url_fopen');
foreach( $directives as $key=>$value){
if( ini_get($value)) {
2022-09-11 09:42:42 +02:00
$texte .= $text['core_config_view']['setup'][36].$value.' ON - ';
2022-06-21 07:53:00 +02:00
}
else{
2022-09-11 09:42:42 +02:00
$texte .= $text['core_config_view']['setup'][36].$value.' OFF - ';
2022-06-21 07:53:00 +02:00
}
}
// Tests des fonctions php
$functions = array( 'fopen', 'file_get_contents', 'curl_version', 'stream_get_contents', 'datefmt_create');
foreach( $functions as $key=>$value){
if(function_exists($value)){
2022-09-11 09:42:42 +02:00
$texte .= $text['core_config_view']['setup'][37].$value.' ON - ';
2022-06-21 07:53:00 +02:00
}
else{
2022-09-11 09:42:42 +02:00
$texte .= $text['core_config_view']['setup'][37].$value.' OFF - ';
2022-06-21 07:53:00 +02:00
}
}
echo template::textarea('directivesFunctionsPhp',[
'value' => substr( $texte, 0, strlen($texte) - 3)
]);
?>
</div>
</div>
2022-05-30 09:05:11 +02:00
<div class="row">
<div class="col12">
<?php // $infoModules[nom_module]['realName'], ['version'], ['update'], ['delete'], ['dataDirectory']
$infoModules = helper::getModules();
2022-09-11 09:42:42 +02:00
$listModDeltaText = $text['core_config_view']['setup'][34];
2022-05-30 09:05:11 +02:00
foreach( $infoModules as $key=>$value){
$listModDeltaText .= $key.' '.$infoModules[$key]['version'].' - ';
}
$listModDeltaText = substr( $listModDeltaText, 0, strlen($listModDeltaText) - 3);
echo template::textarea('modulesDeltacms',[
'value' => $listModDeltaText
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col2 offset5">
<?php echo template::button('buttonHtmlToPdf', [
'class' => 'buttontopdf',
2022-09-11 09:42:42 +02:00
'value' => $text['core_config_view']['setup'][35]
2022-05-30 09:05:11 +02:00
]); ?>
</div>
</div>
</div>
</div>
</div>
2022-01-31 09:10:49 +01:00
</div>