11007 en cours

This commit is contained in:
Fred Tempez 2021-08-17 08:24:12 +02:00
parent 6dce12e621
commit 9f9817aee0
4 changed files with 58 additions and 15 deletions

View File

@ -465,6 +465,39 @@ class common {
} }
} }
/**
* Lire les données de la page
* @param string pageId
* @param return contenu de la page
*/
public function getPage($page) {
return file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $page, 'content']));
}
/**
* Ecrire les données de la page
* @param string pageId
* @param string contenu de la page
*/
public function setPage($page, $value) {
file_put_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']), $value);
}
/**
* Effacer les données de la page
* @param string pageId
* @param return statut de l'effacement
*/
public function deletePage($page) {
return unlink(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']));
}
/** /**
* Sauvegarde des données * Sauvegarde des données
* @param array $keys Clé(s) des données * @param array $keys Clé(s) des données
@ -2337,17 +2370,20 @@ class core extends common {
) { ) {
$this->addOutput([ $this->addOutput([
'title' => $title, 'title' => $title,
'content' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content'])), //'content' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content'])),
'content' => $this->getPage($this->getUrl(0)),
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']), 'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']), 'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']),
'contentRight' => $this->getData(['page',$this->getUrl(0),'barRight']) ? 'contentRight' => $this->getData(['page',$this->getUrl(0),'barRight'])
file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barRight']), 'content'])) //file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barRight']), 'content']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barRight']))
: '', : '',
'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft']) ? 'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft'])
file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content'])) //file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']))
: '', : '',
]); ]);
} }
@ -2367,15 +2403,18 @@ class core extends common {
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']), 'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']), 'iconUrl' => $this->getData(['page', $this->getUrl(0), 'iconUrl']),
'disable' => $this->getData(['page', $this->getUrl(0), 'disable']), 'disable' => $this->getData(['page', $this->getUrl(0), 'disable']),
'contentRight' => $this->getData(['page',$this->getUrl(0),'barRight']) ? 'contentRight' => $this->getData(['page',$this->getUrl(0),'barRight'])
file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barRight']), 'content'])) //file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barRight']), 'content']))
//? $this->getPage($this->getData(['page',$this->getUrl(0),'barRight']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barRight']))
: '', : '',
'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft']) ? 'contentLeft' => $this->getData(['page',$this->getUrl(0),'barLeft'])
file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content'])) // ? file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getData(['page',$this->getUrl(0),'barLeft']), 'content']))
? $this->getPage($this->getData(['page',$this->getUrl(0),'barLeft']))
: '', : '',
]); ]);
$pageContent = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content'])); //$pageContent = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(0), 'content']));
$pageContent = $this->getPage($this->getUrl(0));
} }
else { else {
$moduleId = $this->getUrl(0); $moduleId = $this->getUrl(0);

View File

@ -429,7 +429,8 @@ class addon extends common {
// Export des pages hébergeant le module // Export des pages hébergeant le module
$pageParam[$pageId] = $this->getData(['page',$pageId]); $pageParam[$pageId] = $this->getData(['page',$pageId]);
// Export du contenu de la page // Export du contenu de la page
$pageContent[$pageId] = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $pageId, 'content'])); //$pageContent[$pageId] = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $pageId, 'content']));
$pageContent[$pageId] = $this->getPage($pageId);
// Export de fr/module.json // Export de fr/module.json
$moduleId = 'fr/module.json'; $moduleId = 'fr/module.json';
$moduleDir = str_replace('site/data/','',$infoModules[$this->getUrl(2)]['dataDirectory']); $moduleDir = str_replace('site/data/','',$infoModules[$this->getUrl(2)]['dataDirectory']);

View File

@ -96,7 +96,8 @@ echo template::formOpen('pageEditForm');
<div class="col12"> <div class="col12">
<?php echo template::textarea('pageEditContent', [ <?php echo template::textarea('pageEditContent', [
'class' => 'editorWysiwyg', 'class' => 'editorWysiwyg',
'value' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(2), 'content'])) //'value' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(2), 'content']))
'value' => $this->getPage($this->getUrl(2))
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -266,7 +266,8 @@ class search extends common {
$this->getData(['page', $parentId, 'block']) !== 'bar') { $this->getData(['page', $parentId, 'block']) !== 'bar') {
$url = $parentId; $url = $parentId;
$titre = $this->getData(['page', $parentId, 'title']); $titre = $this->getData(['page', $parentId, 'title']);
$content = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $parentId, 'content'])); //$content = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $parentId, 'content']));
$content = $this->getPage($parentId);
$contenu = $titre . ' ' . $contenu ; $contenu = $titre . ' ' . $contenu ;
// Pages sauf pages filles et articles de blog // Pages sauf pages filles et articles de blog
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier); $tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);
@ -282,7 +283,8 @@ class search extends common {
$this->getData(['page', $parentId, 'block']) !== 'bar') { $this->getData(['page', $parentId, 'block']) !== 'bar') {
$url = $childId; $url = $childId;
$titre = $this->getData(['page', $childId, 'title']); $titre = $this->getData(['page', $childId, 'title']);
$content = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $childId, 'content'])); //$content = file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $childId, 'content']));
$content = $this->getPage($childId);
$contenu = $titre . ' ' . $contenu ; $contenu = $titre . ' ' . $contenu ;
//Pages filles //Pages filles
$tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier); $tempData = $this->occurrence($url, $titre, $contenu, $motclef, self::$motentier);