Revert "Dans modules 'pages/' devient '/'"

This reverts commit 8c3b161b15.
This commit is contained in:
Fred Tempez 2021-06-05 17:14:15 +02:00
parent 8c3b161b15
commit c1938b3b2b
4 changed files with 40 additions and 40 deletions

View File

@ -268,8 +268,8 @@ class page extends common {
// Effacer le dossier du module
$moduleId = $this->getData(['page',$url[0],'moduleId']);
$modulesData = helper::getModules();
if (is_dir($modulesData[$moduleId]['dataDirectory'].'/'.$url[0])) {
$this->removeDir( $modulesData[$moduleId]['dataDirectory'].'/'.$url[0] );
if (is_dir($modulesData[$moduleId]['dataDirectory'].'pages/'.$url[0])) {
$this->removeDir( $modulesData[$moduleId]['dataDirectory'].'pages/'.$url[0] );
}
// Effacer la page
$this->deleteData(['page', $url[0]]);
@ -331,13 +331,13 @@ class page extends common {
// Renommer le dossier du module
$moduleId = $this->getData(['page',$this->getUrl(2),'moduleId']);
$modulesData = helper::getModules();
if (is_dir($modulesData[$moduleId]['dataDirectory'].'/'.$this->getUrl(2))) {
if (is_dir($modulesData[$moduleId]['dataDirectory'].'pages/'.$this->getUrl(2))) {
// Placer la feuille de style dans un dossier au nom de la nouvelle instance
mkdir( $modulesData[$moduleId]['dataDirectory'].'/'.$pageId );
copy( $modulesData[$moduleId]['dataDirectory'].'/'.$this->getUrl(2), $modulesData[$moduleId]['dataDirectory'].'/'.$pageId);
$this->removeDir($modulesData[$moduleId]['dataDirectory'].'/'.$this->getUrl(2));
mkdir( $modulesData[$moduleId]['dataDirectory'].'pages/'.$pageId );
copy( $modulesData[$moduleId]['dataDirectory'].'pages/'.$this->getUrl(2), $modulesData[$moduleId]['dataDirectory'].'pages/'.$pageId);
$this->removeDir($modulesData[$moduleId]['dataDirectory'].'pages/'.$this->getUrl(2));
// Mettre à jour le nom de la feuille de style
$this->setData(['module',$pageId,'theme','style', $modulesData[$moduleId]['dataDirectory'].'/'.$pageId]);
$this->setData(['module',$pageId,'theme','style', $modulesData[$moduleId]['dataDirectory'].'pages/'.$pageId]);
}
}
// Si la page correspond à la page d'accueil, change l'id dans la configuration du site

View File

@ -171,7 +171,7 @@ class gallery extends common {
$this->deleteData(['theme','gallery']);
$this->setData(['module', $this->getUrl(0), 'theme', $data]);
// Nom de la feuille de style
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css']);
}
// Nouvelle version
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '3.0']);
@ -186,7 +186,7 @@ class gallery extends common {
*/
private function init() {
// Variable commune
$fileCSS = self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' ;
$fileCSS = self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ;
// Check la présence du thème
if ( $this->getData(['module', $this->getUrl(0), 'theme']) === null ) {
require_once('module/gallery/ressource/defaultdata.php');
@ -195,10 +195,10 @@ class gallery extends common {
$this->setData(['module', $this->getUrl(0), 'theme', 'style', $fileCSS]);
}
// Check la présence de la feuille de style
if ( !file_exists(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css')) {
if ( !file_exists(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css')) {
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . '/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . '/' . $this->getUrl(0), 0777, true);
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0), 0777, true);
}
// Générer la feuille de CSS
$content = file_get_contents('module/gallery/ressource/vartheme.css');
@ -220,7 +220,7 @@ class gallery extends common {
$content = str_replace('#legendTextColor#',$this->getData(['module', $this->getUrl(0), 'theme', 'legendTextColor']),$content );
$content = str_replace('#legendBgColor#',$this->getData(['module', $this->getUrl(0), 'theme', 'legendBgColor']),$content );
// Ecriture de la feuille de style
file_put_contents(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' , $content . $themeCss);
file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' , $content . $themeCss);
// Nom de la feuille de style
$this->setData(['module', $this->getUrl(0), 'theme', 'style', $fileCSS]);
}
@ -728,8 +728,8 @@ class gallery extends common {
// Soumission du formulaire
if($this->isPost()) {
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . '/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . '/' . $this->getUrl(0), 0777, true);
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0), 0777, true);
}
$this->setData(['module', $this->getUrl(0), 'theme', [
'thumbAlign' => $this->getinput('galleryThemeThumbAlign', helper::FILTER_STRING_SHORT),
@ -746,7 +746,7 @@ class gallery extends common {
'legendAlign' => $this->getinput('galleryThemeLegendAlign', helper::FILTER_STRING_SHORT),
'legendTextColor' => $this->getinput('galleryThemeLegendTextColor', helper::FILTER_STRING_SHORT),
'legendBgColor' => $this->getinput('galleryThemeLegendBgColor', helper::FILTER_STRING_SHORT),
'style' => self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css'
'style' => self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css'
]]);
// Création des fichiers CSS
$content = file_get_contents('module/gallery/ressource/vartheme.css');
@ -766,7 +766,7 @@ class gallery extends common {
$content = str_replace('#legendHeight#',$this->getinput('galleryThemeLegendHeight'),$content );
$content = str_replace('#legendTextColor#',$this->getinput('galleryThemeLegendTextColor'),$content );
$content = str_replace('#legendBgColor#',$this->getinput('galleryThemeLegendBgColor'),$content );
$success = file_put_contents(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css', $content . $themeCss);
$success = file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css', $content . $themeCss);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl() . '/theme',

View File

@ -192,16 +192,16 @@ class news extends common {
}
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . '/' . $this->getUrl(0))) {
mkdir (self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css', 0777, true);
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0))) {
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css', 0777, true);
}
$success = file_put_contents(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css', $style );
$success = file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css', $style );
// Fin feuille de style
$this->setData(['module', $this->getUrl(0), 'theme',[
'style' => $success ? self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' : '',
'style' => $success ? self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' : '',
'itemsHeight' => $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT),
'itemsBlur' => $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT)
]]);
@ -481,7 +481,7 @@ class news extends common {
$this->setData(['module', $this->getUrl(0), 'config', init::$defaultData]);
// Données de thème
$this->setData(['module', $this->getUrl(0), 'theme', init::$defaultTheme]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' ]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
}
$versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
@ -500,7 +500,7 @@ class news extends common {
private function init() {
$fileCSS = self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css';
$fileCSS = self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css';
// Données du module absentes
if ($this->getData(['module', $this->getUrl(0), 'config' ]) === null) {
@ -508,25 +508,25 @@ class news extends common {
$this->setData(['module', $this->getUrl(0), 'config', init::$defaultData]);
// Données de thème
$this->setData(['module', $this->getUrl(0), 'theme', init::$defaultTheme]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' ]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
}
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . '/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . '/' . $this->getUrl(0) , 0777, true);
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0) , 0777, true);
}
// Check la présence de la feuille de style
if ( !file_exists(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css')) {
if ( !file_exists(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css')) {
// Générer la feuille de CSS
$style = '.newsContent {height: ' . $this->getData([ 'module', $this->getUrl(0), 'theme', 'itemsHeight' ]) .';}';
// Pas d'effet flou à l'initialisation
//$style .= '.newsBlur {background: linear-gradient(' . $this->getData(['theme', 'text', 'textColor']) . ' ' . $this->getData([ 'module', $this->getUrl(0), 'theme', 'itemsBlur' ]) . ',rgba(255,255,255,0) );';
//$style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}';
// Sauver la feuille de style
file_put_contents(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' , $style );
file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' , $style );
// Stocker le nom de la feuille de style
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css']);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css']);
}
}
}

View File

@ -57,7 +57,7 @@ class search extends common {
if ($this->getData(['module', $this->getUrl(0), 'previewLength']) ) {
$data = $this->getData(['module', $this->getUrl(0)]);
// Feuille de style
$fileCSS = self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' ;
$fileCSS = self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ;
$this->setData(['module', $this->getUrl(0), 'config', [
'submitText' => $this->getData(['module', $this->getUrl(0), 'submitText']),
'placeHolder' => $this->getData(['module', $this->getUrl(0), 'placeHolder']),
@ -71,8 +71,8 @@ class search extends common {
]]);
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . '/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . '/' . $this->getUrl(0), 0777, true);
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) )) {
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0), 0777, true);
}
// Générer la feuille de CSS
$style = '.keywordColor {background: ' . $this->getData(['module', $this->getUrl(0), 'theme', 'keywordColor']) . ';}';
@ -95,7 +95,7 @@ class search extends common {
private function init(){
$fileCSS = self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' ;
$fileCSS = self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ;
if ($this->getData(['module', $this->getUrl(0)]) === null) {
// Données du module
@ -103,22 +103,22 @@ class search extends common {
$this->setData(['module', $this->getUrl(0), 'config',init::$defaultConfig ]);
// Données de thème
$this->setData(['module', $this->getUrl(0), 'theme',init::$defaultTheme ]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' ]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
// Recharger la page pour éviter une config vide
header("Refresh:0");
}
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . '/' . $this->getUrl(0))) {
mkdir (self::DATADIRECTORY . '/' . $this->getUrl(0), 0777, true);
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0))) {
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0), 0777, true);
}
// Check la présence de la feuille de style
if ( !file_exists(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css')) {
if ( !file_exists(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css')) {
// Générer la feuille de CSS
$style = '.keywordColor {background: ' . $this->getData([ 'module', $this->getUrl(0), 'theme', 'keywordColor' ]) . ';}';
// Sauver la feuille de style
file_put_contents(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css', $style );
file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css', $style );
// Stocker le nom de la feuille de style
$this->setData(['module', $this->getUrl(0) , 'theme', 'style', $fileCSS]);
}
@ -141,7 +141,7 @@ class search extends common {
// Générer la feuille de CSS
$style = '.keywordColor {background:' . $this->getInput('searchKeywordColor') . ';}';
$success = file_put_contents(self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' , $style );
$success = file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' , $style );
// Fin feuille de style
// Soumission du formulaire
@ -154,7 +154,7 @@ class search extends common {
]]);
$this->setData(['module', $this->getUrl(0), 'theme',[
'keywordColor' => $this->getInput('searchKeywordColor'),
'style' => $success ? self::DATADIRECTORY . '/' . $this->getUrl(0) . '/theme.css' : '',
'style' => $success ? self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' : '',
]]);