- helper::baseUrl() . 'config/configOpenGraph',
'value' => $texte
diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php
index 5ac604a..2de3d40 100644
--- a/core/module/install/ressource/defaultdata.php
+++ b/core/module/install/ressource/defaultdata.php
@@ -70,7 +70,7 @@ class init extends common {
]
],
'core' => [
- 'dataVersion' => 4105,
+ 'dataVersion' => 4201,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
diff --git a/core/module/translate/translate.php b/core/module/translate/translate.php
index 945e478..6f99b18 100644
--- a/core/module/translate/translate.php
+++ b/core/module/translate/translate.php
@@ -82,7 +82,8 @@ class translate extends common {
// Enregistrer la langue
if ($success) {
$this->setData(['config', 'i18n', $toCreate, 'site' ]);
- $notification = $text[3] . self::$i18nList[$copyFrom] . $text[4] . self::$i18nList[$toCreate];
+ $i18nListBase = array_merge(['base' => $text[5] ],self::$i18nList);
+ $notification = $text[3] . $i18nListBase[$copyFrom] . $text[4] . self::$i18nList[$toCreate];
} else {
$notification = $text[0];
}
diff --git a/core/vendor/filemanager/UploadHandler.php b/core/vendor/filemanager/UploadHandler.php
index a45ea14..b9874fa 100644
--- a/core/vendor/filemanager/UploadHandler.php
+++ b/core/vendor/filemanager/UploadHandler.php
@@ -493,7 +493,7 @@ class UploadHandler
$name = $this->upcount_name($name);
}
// Keep an existing filename if this is part of a chunked upload:
- $uploaded_bytes = $this->fix_integer_overflow((int)$content_range[1]);
+ $uploaded_bytes =!empty($content_range[1]) ? $this->fix_integer_overflow((int)$content_range[1]) : 0;
while (is_file($this->get_upload_path($name))) {
if ($uploaded_bytes === $this->get_file_size(
$this->get_upload_path($name))) {
@@ -1426,7 +1426,7 @@ class UploadHandler
$name = $file_name ? $file_name : $upload['name'][0];
$res = $this->generate_response($response, $print_response);
if(is_file($this->get_upload_path($name))){
- $uploaded_bytes = $this->fix_integer_overflow((int)$content_range[1]);
+ $uploaded_bytes =!empty($content_range[1]) ? $this->fix_integer_overflow((int)$content_range[1]) : 0;
$totalSize = $this->get_file_size($this->get_upload_path($name));
if ($totalSize - $uploaded_bytes - $this->options['readfile_chunk_size'] < 0) {
$this->onUploadEnd($res);
@@ -1589,6 +1589,7 @@ class UploadHandler
}
protected function basename($filepath, $suffix = null) {
+ $suffix = $suffix === null ? '':$suffix;
$splited = preg_split('/\//', rtrim ($filepath, '/ '));
return substr(basename('X'.$splited[count($splited)-1], $suffix), 1);
}
diff --git a/core/vendor/filemanager/config/config.php b/core/vendor/filemanager/config/config.php
index 603bb49..7da0bcb 100644
--- a/core/vendor/filemanager/config/config.php
+++ b/core/vendor/filemanager/config/config.php
@@ -3,8 +3,8 @@ $version = "9.14.0";
if (session_id() == '') session_start();
mb_internal_encoding('UTF-8');
-mb_http_output();
-mb_http_input();
+mb_http_output('UTF-8');
+//mb_http_input();
mb_language('uni');
if (function_exists('mb_regex_encoding')) {
mb_regex_encoding('UTF-8');
diff --git a/core/vendor/filemanager/dialog.php b/core/vendor/filemanager/dialog.php
index 3ebde34..2736a63 100644
--- a/core/vendor/filemanager/dialog.php
+++ b/core/vendor/filemanager/dialog.php
@@ -693,12 +693,13 @@ function filenameSort($x, $y)
global $descending;
if ($x['is_dir'] !== $y['is_dir']) {
- return $y['is_dir'];
+ $greater = $y['is_dir'];
} else {
- return ($descending)
+ $greater = ($descending)
? $x['file_lcase'] < $y['file_lcase']
: $x['file_lcase'] >= $y['file_lcase'];
}
+ return $greater ? 1 : -1;
}
function dateSort($x, $y)
@@ -706,12 +707,13 @@ function dateSort($x, $y)
global $descending;
if ($x['is_dir'] !== $y['is_dir']) {
- return $y['is_dir'];
+ $greater = $y['is_dir'];
} else {
- return ($descending)
+ $greater = ($descending)
? $x['date'] < $y['date']
: $x['date'] >= $y['date'];
}
+ return $greater ? 1 : -1;
}
function sizeSort($x, $y)
@@ -719,12 +721,13 @@ function sizeSort($x, $y)
global $descending;
if ($x['is_dir'] !== $y['is_dir']) {
- return $y['is_dir'];
+ $greater = $y['is_dir'];
} else {
- return ($descending)
+ $greater = ($descending)
? $x['size'] < $y['size']
: $x['size'] >= $y['size'];
}
+ return $greater ? 1 : -1;
}
function extensionSort($x, $y)
@@ -732,12 +735,13 @@ function extensionSort($x, $y)
global $descending;
if ($x['is_dir'] !== $y['is_dir']) {
- return $y['is_dir'];
+ $greater = $y['is_dir'];
} else {
- return ($descending)
+ $greater = ($descending)
? $x['extension'] < $y['extension']
: $x['extension'] >= $y['extension'];
}
+ return $greater ? 1 : -1;
}
switch ($sort_by) {
diff --git a/core/vendor/filemanager/include/Response.php b/core/vendor/filemanager/include/Response.php
index ae9f10c..24dfaf9 100644
--- a/core/vendor/filemanager/include/Response.php
+++ b/core/vendor/filemanager/include/Response.php
@@ -196,7 +196,7 @@ class Response {
{
$this->headers['Content-Type'] = array('application/json');
- $content = json_encode($content);
+ $content = json_encode(utf8_encode($content));
}
$this->content = $content;
diff --git a/core/vendor/filemanager/include/php_image_magician.php b/core/vendor/filemanager/include/php_image_magician.php
index 8dbc5e7..5bdb9d6 100644
--- a/core/vendor/filemanager/include/php_image_magician.php
+++ b/core/vendor/filemanager/include/php_image_magician.php
@@ -358,9 +358,9 @@ class imageLib {
$optimalHeight = $dimensionsArray['optimalHeight'];
// *** Resample - create image canvas of x, y size
- $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);
+ $this->imageResized = imagecreatetruecolor((int)$optimalWidth, (int)$optimalHeight);
$this->keepTransparancy($optimalWidth, $optimalHeight, $this->imageResized);
- imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);
+ imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, (int)$optimalWidth, (int)$optimalHeight, (int)$this->width, (int)$this->height);
// *** If '4', then crop too
@@ -459,12 +459,12 @@ class imageLib {
imagealphablending($im, false);
imagesavealpha($im, true);
$transparent = imagecolorallocatealpha($im, 255, 255, 255, 127);
- imagefilledrectangle($im, 0, 0, $width, $height, $transparent);
+ imagefilledrectangle($im, 0, 0, (int)$width, (int)$height, (int)$transparent);
}
else
{
$color = imagecolorallocate($im, $this->fillColorArray['r'], $this->fillColorArray['g'], $this->fillColorArray['b']);
- imagefilledrectangle($im, 0, 0, $width, $height, $color);
+ imagefilledrectangle($im, 0, 0, (int)$width, (int)$height, (int)$color);
}
}
@@ -490,7 +490,7 @@ class imageLib {
// *** Crop this bad boy
$crop = imagecreatetruecolor($newWidth, $newHeight);
$this->keepTransparancy($optimalWidth, $optimalHeight, $crop);
- imagecopyresampled($crop, $this->imageResized, 0, 0, $cropStartX, $cropStartY, $newWidth, $newHeight, $newWidth, $newHeight);
+ imagecopyresampled($crop, $this->imageResized, 0, 0, (int) $cropStartX,(int) $cropStartY, (int) $newWidth, (int) $newHeight, (int) $newWidth, (int) $newHeight);
$this->imageResized = $crop;
@@ -2788,7 +2788,7 @@ class imageLib {
{
// *** Perform a check or two.
- if ( ! is_resource($this->imageResized))
+ if ( ! is_resource($this->imageResized) && !($this->imageResized instanceof \GdImage))
{
if ($this->debug)
{
@@ -2899,7 +2899,7 @@ class imageLib {
#
{
- if ( ! is_resource($this->imageResized))
+ if ( ! is_resource($this->imageResized) && ! $this->imageResized instanceof \GdImage)
{
if ($this->debug)
{
@@ -3469,7 +3469,7 @@ class imageLib {
# Notes:
#
{
- if ( ! is_resource($img))
+ if ( ! is_resource($img) && ! $img instanceof \GdImage)
{
return false;
}
@@ -3718,7 +3718,7 @@ class imageLib {
public function __destruct()
{
- if (is_resource($this->imageResized))
+ if (is_resource($this->imageResized) || $this->imageResized instanceof \GdImage)
{
imagedestroy($this->imageResized);
}
diff --git a/core/vendor/filemanager/include/utils.php b/core/vendor/filemanager/include/utils.php
index 8cda960..0bc694d 100644
--- a/core/vendor/filemanager/include/utils.php
+++ b/core/vendor/filemanager/include/utils.php
@@ -879,8 +879,13 @@ function image_check_memory_usage($img, $max_breedte, $max_hoogte)
if (strpos($mem, 'G') !== false) $memory_limit = abs(intval(str_replace(array('G'), '', $mem) * 1024 * 1024 * 1024));
$image_properties = getimagesize($img);
- $image_width = $image_properties[0];
- $image_height = $image_properties[1];
+ if( is_array($image_properties)){
+ $image_width = $image_properties[0];
+ $image_height = $image_properties[1];
+ } else {
+ $image_width = 0;
+ $image_height = 0;
+ }
if (isset($image_properties['bits']))
$image_bits = $image_properties['bits'];
else
diff --git a/module/blog/blog.php b/module/blog/blog.php
index 3da490c..fcfa7ed 100644
--- a/module/blog/blog.php
+++ b/module/blog/blog.php
@@ -604,11 +604,13 @@ class blog extends common {
case 'fr' :
$text[0] = 'Modifications enregistrées';
$text[1] = 'Configuration du module';
+ $text[2] = ' à ';
$states = self::$states;
break;
case 'en' :
$text[0] = 'Saved changes';
- $text[1] = 'Module configuration';
+ $text[1] = 'Module configuration';
+ $text[2] = ' at ';
$states = self::$states_en;
break;
}
@@ -685,7 +687,7 @@ class blog extends common {
'
' .
$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) .
'',
- $date .' à '. $heure,
+ $date .$text[2]. $heure,
$states[$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])],
// Bouton pour afficher les commentaires de l'article
template::button('blogConfigComment' . $articleIds[$i], [
diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php
index 98eb8a5..6af2068 100644
--- a/module/blog/view/article/article.php
+++ b/module/blog/view/article/article.php
@@ -35,15 +35,10 @@ echo '';
echo '';
-// Pour les dates suivant la langue d'administration
-$lang = 'fr_FR';
+// Pour les dates suivant la langue de rédaction du site
$zone = 'Europe/Paris';
-if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
- $lang = 'en_GB';
- $zone = 'Europe/London';
-}
$fmt = datefmt_create(
- $lang,
+ $this->getData(['config', 'i18n', 'langBase']),
IntlDateFormatter::LONG,
IntlDateFormatter::SHORT,
$zone,
diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php
index 3588929..24d1010 100644
--- a/module/blog/view/index/index.php
+++ b/module/blog/view/index/index.php
@@ -10,15 +10,10 @@ switch ($val) {
$text[0] = 'Read more';
break;
}
-// Pour les dates suivant la langue d'administration
-$lang = 'fr_FR';
+// Pour les dates suivant la langue de rédaction du site
$zone = 'Europe/Paris';
-if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
- $lang = 'en_GB';
- $zone = 'Europe/London';
-}
$fmt = datefmt_create(
- $lang,
+ $this->getData(['config', 'i18n', 'langBase']),
IntlDateFormatter::LONG,
IntlDateFormatter::SHORT,
$zone,
diff --git a/module/news/news.php b/module/news/news.php
index 6d59ffe..453d87b 100644
--- a/module/news/news.php
+++ b/module/news/news.php
@@ -316,18 +316,33 @@ class news extends common {
// Liste des pages
self::$pages = $pagination['pages'];
// News en fonction de la pagination
- setlocale(LC_TIME, 'fr_FR');
- if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME, 'en_GB');
+ // Pour les dates suivant la langue d'administration
+ $lang = 'fr_FR';
+ $zone = 'Europe/Paris';
+ if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){
+ $lang = 'en_GB';
+ $zone = 'Europe/London';
+ }
+ $fmt = datefmt_create(
+ $lang,
+ IntlDateFormatter::LONG,
+ IntlDateFormatter::SHORT,
+ $zone,
+ IntlDateFormatter::GREGORIAN
+ );
for($i = $pagination['first']; $i < $pagination['last']; $i++) {
// Met en forme le tableau
- $dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true)
+ /*$dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true)
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])));
$dateOn .= $text[3];
$dateOn .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true)
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])));
+ */
+ $dateOn = datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))));
if ($this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) {
+ /*
$dateOff = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true)
? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))
: utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])));
@@ -335,6 +350,8 @@ class news extends common {
$dateOff .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true)
? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))
: utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])));
+ */
+ $dateOff = datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))));
} else {
$dateOff = $text[1];
}
@@ -618,10 +635,11 @@ class news extends common {
$versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
// le module n'est pas initialisé
- if ($versionData === NULL) {
+ if ($versionData === null) {
$this->init();
}
-
+ $versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
+
// Mise à jour 4.0
if (version_compare($versionData, '4.0', '<') ) {
// Mettre à jour la version
diff --git a/module/news/ressource/defaultdata.php b/module/news/ressource/defaultdata.php
index 2c7e75a..4bd336f 100644
--- a/module/news/ressource/defaultdata.php
+++ b/module/news/ressource/defaultdata.php
@@ -1,5 +1,5 @@
false,
'feedsLabel' => '',
diff --git a/module/news/view/article/article.php b/module/news/view/article/article.php
index 5602dd7..79c4715 100644
--- a/module/news/view/article/article.php
+++ b/module/news/view/article/article.php
@@ -6,16 +6,19 @@
-
+ getData(['config', 'i18n', 'langBase']),
+ IntlDateFormatter::LONG,
+ IntlDateFormatter::SHORT,
+ $zone,
+ IntlDateFormatter::GREGORIAN
+ );
+ echo $module::$articleSignature . ' - ';?>
- getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
- ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))
- : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])));
- $heure = mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
- ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))
- : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])));
- echo $date . ' à ' . $heure;
- ?>
+ getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); ?>
getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php
index e318d0c..4000c9c 100644
--- a/module/news/view/index/index.php
+++ b/module/news/view/index/index.php
@@ -15,7 +15,15 @@ switch ($val) {
break;
}
?>
-
+getData(['config', 'i18n', 'langBase']),
+ IntlDateFormatter::LONG,
+ IntlDateFormatter::SHORT,
+ 'Europe/Paris',
+ IntlDateFormatter::GREGORIAN
+ ); ?>
$news): ?>
@@ -31,9 +39,7 @@ switch ($val) {
-
+
-
isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
- self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), $galleryId,'legend', str_replace('.','',$fileInfos->getFilename())]);
+ if( isset($gallery['config']['directory'])){
+ $directory = $gallery['config']['directory'];
+ // Images de la galerie
+ if(is_dir($directory)) {
+ $iterator = new DirectoryIterator($directory);
+ foreach($iterator as $fileInfos) {
+ if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
+ self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), $galleryId,'legend', str_replace('.','',$fileInfos->getFilename())]);
+ }
}
- }
- // Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas
- switch ($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'tri'])) {
- case 'SORT_DSC':
- krsort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE);
- break;
- case 'SORT_ASC':
- ksort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE);
- break;
- case 'RAND':
- $tab1 = self::$pictures;
- // si absence de légende on en place une provisoire
- foreach($tab1 as $key1=>$value1){
- if($value1 == ''){
- $tab1[$key1] = $key1;
+ // Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas
+ switch ($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'tri'])) {
+ case 'SORT_DSC':
+ krsort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE);
+ break;
+ case 'SORT_ASC':
+ ksort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE);
+ break;
+ case 'RAND':
+ $tab1 = self::$pictures;
+ // si absence de légende on en place une provisoire
+ foreach($tab1 as $key1=>$value1){
+ if($value1 == ''){
+ $tab1[$key1] = $key1;
+ }
}
- }
- $tab2 = array_flip($tab1);
- shuffle($tab2);
- $tab1 = array_flip($tab2);
- foreach($tab1 as $key1=>$value1){
- $tab1[$key1] = self::$pictures[$key1];
- }
- self::$pictures = $tab1;
- break;
- case 'NONE':
- break;
- default:
- break;
+ $tab2 = array_flip($tab1);
+ shuffle($tab2);
+ $tab1 = array_flip($tab2);
+ foreach($tab1 as $key1=>$value1){
+ $tab1[$key1] = self::$pictures[$key1];
+ }
+ self::$pictures = $tab1;
+ break;
+ case 'NONE':
+ break;
+ default:
+ break;
+ }
+ // Information sur la visibilité des boutons
+ self::$view_boutons = $this->getData(['module', $this->getUrl(0), $galleryId, 'config','boutonsVisibles']);
}
- // Information sur la visibilité des boutons
- self::$view_boutons = $this->getData(['module', $this->getUrl(0), $galleryId, 'config','boutonsVisibles']);
}
-
// Valeurs en sortie
$this->addOutput([
'showBarEditButton' => true,