Merge branch '10400' into data_engine

This commit is contained in:
fredtempez 2020-10-28 19:06:08 +01:00
commit 1a97c3b477
41 changed files with 221 additions and 70 deletions

View File

@ -15,8 +15,13 @@
- Approbation des commentaires - Approbation des commentaires
## version 10.3.04 ## version 10.3.04
- Correction : - Corrections :
- Position des entrées de menu sur les écrans de smartphone. - Position des entrées de menu sur les écrans de smartphone.
- Thème : import d'un thème, d'administration impossible.
- Thème : import d'un thème, nettoyage du dossier tmp.
- Thème administration : modification de l'appel du code CSS permettant une mise à jour du thème sans vider le cache.
- Amélioration :
- Mise en page du corps des mails de notification.
## version 10.3.03 ## version 10.3.03
- Correction : - Correction :

View File

@ -49,7 +49,7 @@ class template {
'value' => '', 'value' => '',
'limit' => false 'limit' => false
], $attributes); ], $attributes);
// Génère deux nombres // Génération des nombres et choix de l'opération
$numbers = array(0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20); $numbers = array(0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20);
$letters = array('u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a'); $letters = array('u','t','s','r','q','p','o','n','m','l','k','j','i','h','g','f','e','d','c','b','a');
$limit = $attributes['limit'] ? count($letters)-1 : 10; $limit = $attributes['limit'] ? count($letters)-1 : 10;
@ -57,43 +57,37 @@ class template {
$firstNumber = mt_rand (1, $limit); $firstNumber = mt_rand (1, $limit);
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
$secondNumber = mt_rand (1, $limit); $secondNumber = mt_rand (1, $limit);
// Choisit l'opération
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
$operator = mt_rand (0, 3); $operator = mt_rand (0, 3);
switch ($operator) { switch ($operator) {
case 0: case 0:
$operator = '+'; $operator = template::ico('plus');
if ($firstNumber < $secondNumber) { if ($firstNumber < $secondNumber) {
$temp = $firstNumber; $temp = $firstNumber;
$firstNumber = $secondNumber; $firstNumber = $secondNumber;
$secondNumber = $temp; $secondNumber = $temp;
// [$firstNumber, $secondNumber] = [$secondNumber, $firstNumber]; // ---> A partir de PHP 7.1
} }
$result = $firstNumber + $secondNumber; $result = $firstNumber + $secondNumber;
$operator = template::ico('plus');
break; break;
case 1: case 1:
$operator = '-'; $operator = template::ico('minus');
if ($firstNumber < $secondNumber) { if ($firstNumber < $secondNumber) {
$temp = $firstNumber; $temp = $firstNumber;
$firstNumber = $secondNumber; $firstNumber = $secondNumber;
$secondNumber = $temp; $secondNumber = $temp;
// [$firstNumber, $secondNumber] = [$secondNumber, $firstNumber]; // ---> A partir de PHP 7.1
} }
$result = $firstNumber - $secondNumber; $result = $firstNumber - $secondNumber;
$operator = template::ico('minus');
break; break;
case 2: case 2:
$operator = 'x'; $operator = template::ico('cancel');
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
$firstNumber = mt_rand (1, 10); $firstNumber = mt_rand (1, 10);
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
$secondNumber = mt_rand (1, 10); $secondNumber = mt_rand (1, 10);
$result = $firstNumber * $secondNumber; $result = $firstNumber * $secondNumber;
$operator = template::ico('cancel');
break; break;
case 3: case 3:
$operator = ':'; $operator = template::ico('divide');
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
$firstNumber = mt_rand (1, 10); $firstNumber = mt_rand (1, 10);
mt_srand((float) microtime()*1000000); mt_srand((float) microtime()*1000000);
@ -117,7 +111,6 @@ class template {
} }
$firstNumber = $firstNumber * $secondNumber; $firstNumber = $firstNumber * $secondNumber;
$result = $firstNumber / $secondNumber; $result = $firstNumber / $secondNumber;
$operator = template::ico('divide');
break; break;
} }
$result = password_hash($result, PASSWORD_BCRYPT); $result = password_hash($result, PASSWORD_BCRYPT);
@ -145,7 +138,7 @@ class template {
'<input type="text" %s>', '<input type="text" %s>',
helper::sprintAttributes($attributes) helper::sprintAttributes($attributes)
); );
// Champ résultat caché // Champ résultat codé
$html .= self::hidden($attributes['id'] . 'Result', [ $html .= self::hidden($attributes['id'] . 'Result', [
'value' => $result, 'value' => $result,
'before' => false 'before' => false

View File

@ -983,6 +983,17 @@ class common {
$db->save; $db->save;
} }
/**
* Effacer un dossier non vide.
* @param string URL du dossier à supprimer
*/
public function removeDir ( $path ) {
foreach ( new DirectoryIterator($path) as $item ):
if ( $item->isFile() ) unlink($item->getRealPath());
if ( !$item->isDot() && $item->isDir() ) $this->removeDir($item->getRealPath());
endforeach;
rmdir($path);
}
/** /**
* Mises à jour * Mises à jour
@ -1667,7 +1678,7 @@ class core extends common {
$colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonRed'])); $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonRed']));
$css .= '.button.buttonRed {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonRed:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonRed:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}'; $css .= '.button.buttonRed {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonRed:hover {background-color:' . $colors['darken'] . ';color:' . $colors['text'] . ';}.button.buttonRed:active {background-color:' . $colors['veryDarken'] . ';color:' . $colors['text'] . ';}';
$colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonGreen'])); $colors = helper::colorVariants($this->getData(['admin','backgroundColorButtonGreen']));
$css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . '}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] .';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' .$colors['text'] .';}'; $css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] .';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' .$colors['text'] .';}';
$colors = helper::colorVariants($this->getData(['admin','backgroundBlockColor'])); $colors = helper::colorVariants($this->getData(['admin','backgroundBlockColor']));
$css .= '.block {border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}.block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}'; $css .= '.block {border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}.block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}';
$css .= 'table tr,input[type=email],input[type=text],input[type=password],select:not(#barSelectPage),textarea:not(.editorWysiwyg),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}'; $css .= 'table tr,input[type=email],input[type=text],input[type=password],select:not(#barSelectPage),textarea:not(.editorWysiwyg),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin','borderBlockColor']) . ';}';
@ -2762,6 +2773,9 @@ class layout extends common {
public function showStyle() { public function showStyle() {
if($this->core->output['style']) { if($this->core->output['style']) {
echo '<base href="' . helper::baseUrl(true) .'">'; echo '<base href="' . helper::baseUrl(true) .'">';
if (strpos($this->core->output['style'], 'admin.css') >= 1 ) {
echo '<link rel="stylesheet" href="' . self::DATA_DIR . 'admin.css?' . md5_file(self::DATA_DIR .'admin.css') . '">';
}
echo '<style type="text/css">' . helper::minifyCss($this->core->output['style']) . '</style>'; echo '<style type="text/css">' . helper::minifyCss($this->core->output['style']) . '</style>';
} }
} }

View File

@ -71,7 +71,7 @@
<div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;"> <div style="display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;mso-hide:all;font-family: sans-serif;">
<?php echo $subject; ?> <?php echo $subject; ?>
</div> </div>
<div style="max-width: 500px; margin: auto;" class="email-container"> <div style="max-width: 500px; margin: auto; margin-top: 30px; border: #aaa 1px solid;" class="email-container">
<!--[if mso]> <!--[if mso]>
<table role="presentation" cellspacing="0" cellpadding="0" border="0" width="500" align="center"> <table role="presentation" cellspacing="0" cellpadding="0" border="0" width="500" align="center">
<tr> <tr>

View File

@ -12,7 +12,15 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/ */
/** NE PAS EFFACER
* admin.css
*/
/** /**
* Effet d'animation * Effet d'animation

View File

@ -12,7 +12,15 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/ */
/** NE PAS EFFACER
* admin.css
*/
.blockContainer { .blockContainer {
display : none; display : none;

View File

@ -12,4 +12,8 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,4 +12,8 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -18,8 +18,7 @@ class install extends common {
public static $actions = [ public static $actions = [
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'steps' => self::GROUP_ADMIN, 'steps' => self::GROUP_ADMIN,
'update' => self::GROUP_ADMIN, 'update' => self::GROUP_ADMIN
'removeAll' => self::GROUP_ADMIN
]; ];
@ -253,16 +252,5 @@ class install extends common {
]); ]);
} }
/**
* Effacer un dossier non vide.
*/
private function removeAll ( $path ) {
foreach ( new DirectoryIterator($path) as $item ):
if ( $item->isFile() ) unlink($item->getRealPath());
if ( !$item->isDot() && $item->isDir() ) $this->removeAll($item->getRealPath());
endforeach;
rmdir($path);
}
} }

View File

@ -14,5 +14,9 @@
/* /*
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
*/ */

View File

@ -13,7 +13,11 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
#ceo > .blockContainer, #ceo > .blockContainer,
#advanced > .blockContainer { #advanced > .blockContainer {

View File

@ -616,16 +616,19 @@ class theme extends common {
mkdir (self::TEMP_DIR . $tempFolder); mkdir (self::TEMP_DIR . $tempFolder);
$zip->extractTo(self::TEMP_DIR . $tempFolder ); $zip->extractTo(self::TEMP_DIR . $tempFolder );
// Archive de thème ? // Archive de thème ?
if ( file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css') if (( file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css')
AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css') AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css')
AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json') ) { AND file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json')
) OR (
file_exists(self::TEMP_DIR . $tempFolder . '/site/data/admin.json')
)
) {
// traiter l'archive // traiter l'archive
$success = $zip->extractTo('.'); $success = $zip->extractTo('.');
// traitement de l'erreur // traitement de l'erreur
$notification = $success ? 'Le thème a été importé' : 'Erreur lors de l\'extraction, vérifiez les permissions.'; $notification = $success ? 'Le thème a été importé' : 'Erreur lors de l\'extraction, vérifiez les permissions.';
// Supprimmer le dossier temporaire // Supprimmer le dossier temporaire
$install = new install; $this->removeDir(self::TEMP_DIR . $tempFolder);
$install->removeAll(self::TEMP_DIR . $tempFolder);
} else { } else {
// pas une archive de thème // pas une archive de thème
$success = false; $success = false;

View File

@ -13,4 +13,8 @@
*/ */
/* Thème administration */ /* Thème administration */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
/* Thème administration */ /* Thème administration */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -11,7 +11,11 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
#backToTop { #backToTop {
display: block; display: block;

View File

@ -13,4 +13,8 @@
*/ */
/* Thème administration */ /* Thème administration */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,4 +12,8 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,7 +12,11 @@
/* Thème administration */ /* Thème administration */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
#bar, #bar,
#site, #site,

View File

@ -13,4 +13,8 @@
*/ */
/* Thème administration */ /* Thème administration */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,4 +12,8 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -12,4 +12,8 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,5 +13,9 @@
*/ */
/* /*
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
*/ */

View File

@ -12,4 +12,8 @@
* @link http://zwiicms.fr/ * @link http://zwiicms.fr/
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -1,4 +1,8 @@
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
/* /*
.formConfigInput { .formConfigInput {

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,7 +13,11 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/
.galleryConfigError { .galleryConfigError {
color: #F3674A; color: #F3674A;

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/

View File

@ -13,4 +13,8 @@
*/ */
@import url("site/data/admin.css"); /** @import url("site/data/admin.css"); */
/** NE PAS EFFACER
* admin.css
*/