Merge branch '10600' into 11000
This commit is contained in:
commit
dfd6291563
@ -1621,6 +1621,35 @@ class common {
|
||||
$this->setData(['core', 'dataVersion', 10502]);
|
||||
}
|
||||
|
||||
// Version 10.6.00
|
||||
if ($this->getData(['core', 'dataVersion']) < 10600) {
|
||||
|
||||
// Mise à jour des données des modules autonomes
|
||||
|
||||
// Liste des pages dans pageList
|
||||
$pageList = array();
|
||||
foreach ($this->getHierarchy(null,null,null) as $parentKey=>$parentValue) {
|
||||
$pageList [] = $parentKey;
|
||||
foreach ($parentValue as $childKey) {
|
||||
$pageList [] = $childKey;
|
||||
}
|
||||
}
|
||||
// Parcourir pageList et rechercher les modules au CSS autonomes
|
||||
foreach ($pageList as $parentKey => $parent) {
|
||||
if (
|
||||
$this->getData(['page',$parent,'moduleId']) === 'search'
|
||||
|| $this->getData(['page',$parent,'moduleId']) === 'gallery'
|
||||
|| $this->getData(['page',$parent,'moduleId']) === 'news'
|
||||
){
|
||||
if(class_exists($parent)) {
|
||||
$module = new $moduleId;
|
||||
$module->initCSS($parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 10600]);
|
||||
}
|
||||
|
||||
// Version 11.0.00
|
||||
if ($this->getData(['core', 'dataVersion']) < 11000) {
|
||||
|
||||
@ -1644,8 +1673,6 @@ class common {
|
||||
$this->setData(['config','translate','pt', false ]);
|
||||
|
||||
$this->setData(['core', 'dataVersion', 11000]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +461,8 @@ class addon extends common {
|
||||
file_put_contents($tmpFolder . '/' . $moduleId, json_encode($tmpData));
|
||||
}
|
||||
// Export des données localisées dans le dossier de données du module
|
||||
if ($infoModules[$this->getUrl(2)]['dataDirectory'] ) {
|
||||
if ($infoModules[$this->getUrl(2)]['dataDirectory'] &&
|
||||
is_dir($infoModules[$this->getUrl(2)]['dataDirectory'])) {
|
||||
$this->custom_copy ($infoModules[$this->getUrl(2)]['dataDirectory'], $tmpFolder . '/' . $moduleDir);
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,6 @@ class gallery extends common {
|
||||
*/
|
||||
private function update() {
|
||||
|
||||
|
||||
// Mise à jour d'une version inférieure
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '3.0', '<') ) {
|
||||
// Changement de l'arborescence dans module.json
|
||||
@ -175,44 +174,61 @@ class gallery extends common {
|
||||
/**
|
||||
* Initialisation du thème d'un nouveau module
|
||||
*/
|
||||
private function initCSS() {
|
||||
if ( $this->getData(['module', $this->getUrl(0), 'config']) === null ) {
|
||||
private function initCSS($moduleId) {
|
||||
// Variable commune
|
||||
$fileCSS = self::DATADIRECTORY . $moduleId . '.css' ;
|
||||
// Check la présence de la config
|
||||
if ( $this->getData(['module', $moduleId, 'config']) === null ) {
|
||||
require_once('module/gallery/ressource/defaultdata.php');
|
||||
$this->setData(['module', $this->getUrl(0), 'config', theme::$defaultData]);
|
||||
$this->setData(['module', $moduleId, 'config', [
|
||||
'style' => $fileCSS,
|
||||
'thumbAlign' => theme::$defaultData['thumbAlign'],
|
||||
'thumbWidth' => theme::$defaultData['thumbWidth'],
|
||||
'thumbHeight' => theme::$defaultData['thumbHeight'],
|
||||
'thumbMargin' => theme::$defaultData['thumbMargin'],
|
||||
'thumbBorder' => theme::$defaultData['thumbBorder'],
|
||||
'thumbOpacity' => theme::$defaultData['thumbOpacity'],
|
||||
'thumbBorderColor' => theme::$defaultData['thumbBorderColor'],
|
||||
'thumbRadius' => theme::$defaultData['thumbRadius'],
|
||||
'thumbShadows' => theme::$defaultData['thumbShadows'],
|
||||
'thumbShadowsColor'=> theme::$defaultData['thumbShadowsColor'],
|
||||
'legendHeight' => theme::$defaultData['legendHeight'],
|
||||
'legendAlign' => theme::$defaultData['legendAlign'],
|
||||
'legendTextColor' => theme::$defaultData['legendTextColor'],
|
||||
'legendBgColor' => theme::$defaultData['legendBgColor'],
|
||||
'versionData' => theme::$defaultData['versionData']
|
||||
]]);
|
||||
}
|
||||
if ( !file_exists(self::DATADIRECTORY . $this->getUrl(0) . '.css')) {
|
||||
// Variables génériques
|
||||
|
||||
// Check la présence de la feuille de style
|
||||
if ( !file_exists(self::DATADIRECTORY . $moduleId . '.css')) {
|
||||
// Dossier de l'instance
|
||||
if (!is_dir(self::DATADIRECTORY )) {
|
||||
mkdir (self::DATADIRECTORY, 0777, true);
|
||||
}
|
||||
|
||||
// Nom de la feuille de style
|
||||
$fileCSS = self::DATADIRECTORY . $this->getUrl(0) . '.css' ;
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'style', $fileCSS]);
|
||||
$this->setData(['module', $moduleId, 'config', 'style', $fileCSS]);
|
||||
|
||||
// Générer la feuille de CSS
|
||||
$content = file_get_contents('module/gallery/ressource/vartheme.css');
|
||||
$themeCss = file_get_contents('module/gallery/ressource/theme.css');
|
||||
|
||||
// Injection des variables
|
||||
$content = str_replace('#thumbAlign#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbAlign']),$content );
|
||||
$content = str_replace('#thumbWidth#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbWidth']),$content );
|
||||
$content = str_replace('#thumbHeight#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbHeight']),$content );
|
||||
$content = str_replace('#thumbMargin#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbMargin']),$content );
|
||||
$content = str_replace('#thumbBorder#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbBorder']),$content );
|
||||
$content = str_replace('#thumbBorderColor#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbBorderColor']),$content );
|
||||
$content = str_replace('#thumbOpacity#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbOpacity']),$content );
|
||||
$content = str_replace('#thumbShadows#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbShadows']),$content );
|
||||
$content = str_replace('#thumbShadowsColor#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbShadowsColor']),$content );
|
||||
$content = str_replace('#thumbRadius#',$this->getData(['module', $this->getUrl(0), 'config', 'thumbRadius']),$content );
|
||||
$content = str_replace('#legendAlign#',$this->getData(['module', $this->getUrl(0), 'config', 'legendAlign']),$content );
|
||||
$content = str_replace('#legendHeight#',$this->getData(['module', $this->getUrl(0), 'config', 'legendHeight']),$content );
|
||||
$content = str_replace('#legendTextColor#',$this->getData(['module', $this->getUrl(0), 'config', 'legendTextColor']),$content );
|
||||
$content = str_replace('#legendBgColor#',$this->getData(['module', $this->getUrl(0), 'config', 'legendBgColor']),$content );
|
||||
$content = str_replace('#thumbAlign#',$this->getData(['module', $moduleId, 'config', 'thumbAlign']),$content );
|
||||
$content = str_replace('#thumbWidth#',$this->getData(['module', $moduleId, 'config', 'thumbWidth']),$content );
|
||||
$content = str_replace('#thumbHeight#',$this->getData(['module', $moduleId, 'config', 'thumbHeight']),$content );
|
||||
$content = str_replace('#thumbMargin#',$this->getData(['module', $moduleId, 'config', 'thumbMargin']),$content );
|
||||
$content = str_replace('#thumbBorder#',$this->getData(['module', $moduleId, 'config', 'thumbBorder']),$content );
|
||||
$content = str_replace('#thumbBorderColor#',$this->getData(['module', $moduleId, 'config', 'thumbBorderColor']),$content );
|
||||
$content = str_replace('#thumbOpacity#',$this->getData(['module', $moduleId, 'config', 'thumbOpacity']),$content );
|
||||
$content = str_replace('#thumbShadows#',$this->getData(['module', $moduleId, 'config', 'thumbShadows']),$content );
|
||||
$content = str_replace('#thumbShadowsColor#',$this->getData(['module', $moduleId, 'config', 'thumbShadowsColor']),$content );
|
||||
$content = str_replace('#thumbRadius#',$this->getData(['module', $moduleId, 'config', 'thumbRadius']),$content );
|
||||
$content = str_replace('#legendAlign#',$this->getData(['module', $moduleId, 'config', 'legendAlign']),$content );
|
||||
$content = str_replace('#legendHeight#',$this->getData(['module', $moduleId, 'config', 'legendHeight']),$content );
|
||||
$content = str_replace('#legendTextColor#',$this->getData(['module', $moduleId, 'config', 'legendTextColor']),$content );
|
||||
$content = str_replace('#legendBgColor#',$this->getData(['module', $moduleId, 'config', 'legendBgColor']),$content );
|
||||
// Ecriture de la feuille de style
|
||||
file_put_contents(self::DATADIRECTORY . $this->getUrl(0) . '.css' , $content . $themeCss);
|
||||
file_put_contents(self::DATADIRECTORY . $moduleId . '.css' , $content . $themeCss);
|
||||
}
|
||||
}
|
||||
|
||||
@ -276,7 +292,7 @@ class gallery extends common {
|
||||
public function config() {
|
||||
|
||||
// Initialisation du thème d'un nouveau module
|
||||
$this->initCss();
|
||||
$this->initCss($this->getUrl(0));
|
||||
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
@ -560,8 +576,8 @@ class gallery extends common {
|
||||
* Accueil (deux affichages en un pour éviter une url à rallonge)
|
||||
*/
|
||||
public function index() {
|
||||
// Initialisation du thème d'un nouveau module
|
||||
$this->initCss();
|
||||
// Initialisation du thème du nouveau module
|
||||
$this->initCss($this->getUrl(0));
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
// Images d'une galerie
|
||||
|
@ -13,7 +13,7 @@
|
||||
<div class="colPicture">
|
||||
<a
|
||||
href="<?php echo helper::baseUrl(false) . $picture; ?>"
|
||||
<?php if ( stristr($picture,$this->getdata(['module',$this->getUrl(0),$this->getUrl(1),'config','homePicture'])) ) {
|
||||
<?php if ( $picture === $this->getdata(['module',$this->getUrl(0),$this->getUrl(1),'config','homePicture']) ) {
|
||||
echo 'id="homePicture"'; } ?>
|
||||
class="galleryGalleryPicture"
|
||||
style="background-image:url('<?php echo helper::baseUrl(false) . $module::$thumbs[$picture]; ?>')"
|
||||
|
@ -70,20 +70,6 @@ class news extends common {
|
||||
public static $articleSignature = '';
|
||||
|
||||
|
||||
/**
|
||||
* Mise à jour du module
|
||||
* Appelée par les fonctions index et config
|
||||
*/
|
||||
private function update() {
|
||||
// Version 3.0
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '3.0', '<') ) {
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 16]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperCol', 6]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','3.0']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flux RSS
|
||||
*/
|
||||
@ -178,6 +164,10 @@ class news extends common {
|
||||
* Configuration
|
||||
*/
|
||||
public function config() {
|
||||
|
||||
// Initialisation du thème du nouveau module
|
||||
$this->initCss($this->getUrl(0));
|
||||
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
|
||||
@ -347,6 +337,10 @@ class news extends common {
|
||||
* Accueil
|
||||
*/
|
||||
public function index() {
|
||||
|
||||
// Initialisation du thème du nouveau module
|
||||
$this->initCss($this->getUrl(0));
|
||||
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
// Affichage d'un article
|
||||
@ -428,4 +422,46 @@ class news extends common {
|
||||
return $this->getData(['user', $userId, 'firstname']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Mise à jour du module
|
||||
* Appelée par les fonctions index et config
|
||||
*/
|
||||
private function update() {
|
||||
// Version 3.0
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '3.0', '<') ) {
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 16]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'itemsperCol', 6]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','3.0']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisation du thème d'un nouveau module
|
||||
*/
|
||||
private function initCSS($moduleId) {
|
||||
// Variable commune
|
||||
$fileCSS = self::DATADIRECTORY . $moduleId . '.css' ;
|
||||
|
||||
if ( $this->getData(['module', $moduleId, 'config', 'itemsHeight']) === null ) {
|
||||
|
||||
$this->setData(['module', $moduleId, 'config', 'itemsHeight', '200px']);
|
||||
|
||||
// Générer la feuille de CSS
|
||||
$style = '.newsContent {height: 200px;}';
|
||||
|
||||
// Dossier de l'instance
|
||||
if (!is_dir(self::DATADIRECTORY)) {
|
||||
mkdir (self::DATADIRECTORY, 0777, true);
|
||||
}
|
||||
|
||||
// Sauver la feuille de style
|
||||
$success = file_put_contents(self::DATADIRECTORY .$moduleId . '.css' , $style );
|
||||
|
||||
// Nom de la feuille de style
|
||||
$this->setData(['module', $moduleId, 'config', 'style', self::DATADIRECTORY .$moduleId]);
|
||||
// Fin feuille de style
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,24 +78,22 @@ class search extends common {
|
||||
* Initialisation du thème du module
|
||||
* Appelée par les fonctions index et config
|
||||
*/
|
||||
private function initCss(){
|
||||
private function initCss($moduleId){
|
||||
// Création des valeurs de réglage par défaut
|
||||
if ( !is_array($this->getData(['module', $this->getUrl(0), 'config']) ) ) {
|
||||
if ( !is_array($this->getData(['module',$moduleId, 'config']) ) ) {
|
||||
require_once('module/search/ressource/defaultdata.php');
|
||||
|
||||
// Sauver les données par défaut
|
||||
init::$defaultData['style'] = self::DATADIRECTORY . $this->getUrl(0) . '.css';
|
||||
$this->setData(['module', $this->getUrl(0), 'config', init::$defaultData]);
|
||||
init::$defaultData['style'] = self::DATADIRECTORY . $moduleId . '.css';
|
||||
$this->setData(['module', $moduleId, 'config', init::$defaultData]);
|
||||
|
||||
$style = '.searchItem {background:' . $this->getData(['module', $this->getUrl(0), 'config', 'keywordColor']). ';}';
|
||||
$style = '.searchItem {background:' . $this->getData(['module', $moduleId, 'config', 'keywordColor']). ';}';
|
||||
|
||||
// Dossier de l'instance
|
||||
if (!is_dir(self::DATADIRECTORY )) {
|
||||
mkdir (self::DATADIRECTORY , 0777, true);
|
||||
}
|
||||
$success = file_put_contents(self::DATADIRECTORY . $this->getUrl(0) . '.css' , $style );
|
||||
|
||||
|
||||
$success = file_put_contents(self::DATADIRECTORY . $moduleId . '.css' , $style );
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +102,7 @@ class search extends common {
|
||||
public function config() {
|
||||
|
||||
// Initialisation d'un nouveau module
|
||||
$this->initCss();
|
||||
$this->initCss($this->getUrl(0));
|
||||
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
@ -154,7 +152,7 @@ class search extends common {
|
||||
public function index() {
|
||||
|
||||
// Initialisation d'un nouveau module
|
||||
$this->initCss();
|
||||
$this->initCss($this->getUrl(0));
|
||||
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
|
Loading…
Reference in New Issue
Block a user