Durcir update blog et news

This commit is contained in:
Fred Tempez 2020-11-19 08:53:52 +01:00
parent 3136da34ca
commit e414988bee
1 changed files with 16 additions and 10 deletions

View File

@ -1462,22 +1462,28 @@ class common {
} }
// Mettre à jour les données des blogs les articles sont dans posts // Mettre à jour les données des blogs les articles sont dans posts
foreach ($pageList as $parentKey => $parent) { foreach ($pageList as $parentKey => $parent) {
//La page a une galerie //La page a un blog
if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) { if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) {
foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) { if (is_array($this->getData(['module', $parent]))) {
$data = $this->getdata(['module',$parent,$blogKey]); foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) {
$this->deleteData(['module',$parent, $blogKey]); if ($blogKey === 'posts' OR $blogKey === 'config') {continue;}
$this->setData([ 'module', $parent, 'posts', $blogKey, $data ]); $data = $this->getdata(['module',$parent,$blogKey]);
$this->deleteData(['module',$parent, $blogKey]);
$this->setData([ 'module', $parent, 'posts', $blogKey, $data ]);
}
} }
} }
} }
foreach ($pageList as $parentKey => $parent) { foreach ($pageList as $parentKey => $parent) {
//La page a une galerie //La page a une news
if ($this->getData(['page',$parent,'moduleId']) === 'news' ) { if ($this->getData(['page',$parent,'moduleId']) === 'news' ) {
foreach ( $this->getData(['module', $parent]) as $newsKey => $newsItem) { if (is_array($this->getData(['module', $parent]))) {
$data = $this->getdata(['module',$parent,$newsKey]); foreach ( $this->getData(['module', $parent]) as $newsKey => $newsItem) {
$this->deleteData(['module',$parent, $newsKey]); if ($blogKey === 'posts' OR $blogKey === 'config') {continue;}
$this->setData([ 'module', $parent, 'posts', $newsKey, $data ]); $data = $this->getdata(['module',$parent,$newsKey]);
$this->deleteData(['module',$parent, $newsKey]);
$this->setData([ 'module', $parent, 'posts', $newsKey, $data ]);
}
} }
} }
} }