|
|
|
@ -192,16 +192,16 @@ class news extends common {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Dossier de l'instance
|
|
|
|
|
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0))) {
|
|
|
|
|
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css', 0777, true);
|
|
|
|
|
if (!is_dir(self::DATADIRECTORY . $this->getUrl(0))) {
|
|
|
|
|
mkdir (self::DATADIRECTORY . $this->getUrl(0) . '/theme.css', 0777, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$success = file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css', $style );
|
|
|
|
|
$success = file_put_contents(self::DATADIRECTORY . $this->getUrl(0) . '/theme.css', $style );
|
|
|
|
|
|
|
|
|
|
// Fin feuille de style
|
|
|
|
|
|
|
|
|
|
$this->setData(['module', $this->getUrl(0), 'theme',[
|
|
|
|
|
'style' => $success ? self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' : '',
|
|
|
|
|
'style' => $success ? self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' : '',
|
|
|
|
|
'itemsHeight' => $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT),
|
|
|
|
|
'itemsBlur' => $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT)
|
|
|
|
|
]]);
|
|
|
|
@ -412,7 +412,7 @@ class news extends common {
|
|
|
|
|
$newsIds = [];
|
|
|
|
|
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
|
|
|
|
|
$newsIdsPublishedOff = $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOff']);
|
|
|
|
|
if( $newsPublishedOn <= time() AND
|
|
|
|
|
if( $newsPublishedOn <= time() AND
|
|
|
|
|
$newsIdsStates[$newsId] AND
|
|
|
|
|
// date de péremption tenant des champs non définis
|
|
|
|
|
(!is_integer($newsIdsPublishedOff) OR
|
|
|
|
@ -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 . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
|
|
|
|
|
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $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 . 'pages/' . $this->getUrl(0) . '/theme.css';
|
|
|
|
|
$fileCSS = self::DATADIRECTORY . $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 . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
|
|
|
|
|
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Dossier de l'instance
|
|
|
|
|
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) )) {
|
|
|
|
|
mkdir (self::DATADIRECTORY . 'pages/' . $this->getUrl(0) , 0777, true);
|
|
|
|
|
if (!is_dir(self::DATADIRECTORY . $this->getUrl(0) )) {
|
|
|
|
|
mkdir (self::DATADIRECTORY . $this->getUrl(0) , 0777, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check la présence de la feuille de style
|
|
|
|
|
if ( !file_exists(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css')) {
|
|
|
|
|
if ( !file_exists(self::DATADIRECTORY . $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 . 'pages/' . $this->getUrl(0) . '/theme.css' , $style );
|
|
|
|
|
file_put_contents(self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' , $style );
|
|
|
|
|
// Stocker le nom de la feuille de style
|
|
|
|
|
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css']);
|
|
|
|
|
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $this->getUrl(0) . '/theme.css']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|