forked from ZwiiCMS-Team/ZwiiCMS
Fonction setPage
This commit is contained in:
parent
6f4ebfbbcd
commit
057b915513
@ -481,10 +481,11 @@ class common {
|
||||
* Ecrire les données de la page
|
||||
* @param string pageId
|
||||
* @param string contenu de la page
|
||||
* @param return nombre d'octets écrits ou erreur
|
||||
*/
|
||||
public function setPage($page, $value, $lang) {
|
||||
|
||||
file_put_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']), $value);
|
||||
return file_put_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $page, 'content']), $value);
|
||||
|
||||
}
|
||||
|
||||
@ -577,11 +578,13 @@ class common {
|
||||
if ($sampleSite === true) {
|
||||
foreach(init::$siteContent as $key => $value) {
|
||||
// Creation du contenu de la page
|
||||
file_put_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $key, 'content']), $value);
|
||||
// file_put_contents(self::DATA_DIR . $lang . '/content/' . $this->getData(['page', $key, 'content']), $value);
|
||||
$this->setPage($this->getData(['page', $key, 'content']), $value, $lang);
|
||||
}
|
||||
} else {
|
||||
// Créer la page d'accueil
|
||||
file_put_contents(self::DATA_DIR . $lang . '/content/' . 'accueil.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
// file_put_contents(self::DATA_DIR . $lang . '/content/' . 'accueil.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage('accueil.html', '<p>Contenu de votre nouvelle page.</p>', $lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -632,7 +632,8 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
|
||||
}
|
||||
foreach ($pageList as $parentKey => $parent) {
|
||||
$content = $this->getData(['page', $parent, 'content']);
|
||||
file_put_contents(self::DATA_DIR . self::$i18n . '/content/' . $parent . '.html', $content);
|
||||
// file_put_contents(self::DATA_DIR . self::$i18n . '/content/' . $parent . '.html', $content);
|
||||
$this->setPage($parent, $content, self::$i18n);
|
||||
$this->setData(['page', $parent, 'content', $parent . '.html']);
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,8 @@ class page extends common {
|
||||
if (!is_dir(self::DATA_DIR . self::$i18n . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$i18n . '/content');
|
||||
}
|
||||
file_put_contents(self::DATA_DIR . self::$i18n . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
//file_put_contents(self::DATA_DIR . self::$i18n . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$i18N,);
|
||||
// Met à jour le site map
|
||||
$this->createSitemap('all');
|
||||
// Valeurs en sortie
|
||||
@ -439,7 +440,8 @@ class page extends common {
|
||||
mkdir(self::DATA_DIR . self::$i18n . '/content');
|
||||
}
|
||||
$content = empty($this->getInput('pageEditContent', null)) ? '<p></p>' : str_replace('<p></p>', '<p> </p>', $this->getInput('pageEditContent', null));
|
||||
file_put_contents( self::DATA_DIR . self::$i18n . '/content/' . $pageId . '.html' , $content );
|
||||
// file_put_contents( self::DATA_DIR . self::$i18n . '/content/' . $pageId . '.html' , $content );
|
||||
$this->setPage($pageId, $content, self::$i18n);
|
||||
// Barre renommée : changement le nom de la barre dans les pages mères
|
||||
if ($this->getinput('pageEditBlock') === 'bar') {
|
||||
foreach ($this->getHierarchy() as $eachPageId=>$parentId) {
|
||||
|
Loading…
Reference in New Issue
Block a user