forked from ZwiiCMS-Team/ZwiiCMS
Durcir update blog et news
This commit is contained in:
parent
3136da34ca
commit
e414988bee
@ -1462,25 +1462,31 @@ 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' ) {
|
||||||
|
if (is_array($this->getData(['module', $parent]))) {
|
||||||
foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) {
|
foreach ( $this->getData(['module', $parent]) as $blogKey => $blogItem) {
|
||||||
|
if ($blogKey === 'posts' OR $blogKey === 'config') {continue;}
|
||||||
$data = $this->getdata(['module',$parent,$blogKey]);
|
$data = $this->getdata(['module',$parent,$blogKey]);
|
||||||
$this->deleteData(['module',$parent, $blogKey]);
|
$this->deleteData(['module',$parent, $blogKey]);
|
||||||
$this->setData([ 'module', $parent, 'posts', $blogKey, $data ]);
|
$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' ) {
|
||||||
|
if (is_array($this->getData(['module', $parent]))) {
|
||||||
foreach ( $this->getData(['module', $parent]) as $newsKey => $newsItem) {
|
foreach ( $this->getData(['module', $parent]) as $newsKey => $newsItem) {
|
||||||
|
if ($blogKey === 'posts' OR $blogKey === 'config') {continue;}
|
||||||
$data = $this->getdata(['module',$parent,$newsKey]);
|
$data = $this->getdata(['module',$parent,$newsKey]);
|
||||||
$this->deleteData(['module',$parent, $newsKey]);
|
$this->deleteData(['module',$parent, $newsKey]);
|
||||||
$this->setData([ 'module', $parent, 'posts', $newsKey, $data ]);
|
$this->setData([ 'module', $parent, 'posts', $newsKey, $data ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$this->setData(['core', 'dataVersion', 10306]);
|
$this->setData(['core', 'dataVersion', 10306]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user