forked from ZwiiCMS-Team/ZwiiCMS
Duplication du module de page
This commit is contained in:
parent
fef55731be
commit
b746700d0c
@ -93,17 +93,30 @@ class page extends common {
|
|||||||
'notification' => 'Suppression non autorisée'
|
'notification' => 'Suppression non autorisée'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
// Duplication de la page
|
||||||
$pageTitle = $this->getData(['page',$url[0],'title']);
|
$pageTitle = $this->getData(['page',$url[0],'title']);
|
||||||
$pageId = helper::increment(helper::filter($pageTitle, helper::FILTER_ID), $this->getData(['page']));
|
$pageId = helper::increment(helper::filter($pageTitle, helper::FILTER_ID), $this->getData(['page']));
|
||||||
$data = $this->getData([
|
$data = $this->getData([
|
||||||
'page',
|
'page',
|
||||||
$url[0]
|
$url[0]
|
||||||
]);
|
]);
|
||||||
|
// Ecriture
|
||||||
$this->setData (['page',$pageId,$data]);
|
$this->setData (['page',$pageId,$data]);
|
||||||
|
$notification = 'La page a été dupliquée';
|
||||||
|
// Duplication du module présent
|
||||||
|
if ($this->getData(['page',$url[0],'moduleId'])) {
|
||||||
|
$data = $this->getData([
|
||||||
|
'module',
|
||||||
|
$url[0]
|
||||||
|
]);
|
||||||
|
// Ecriture
|
||||||
|
$this->setData (['module',$pageId,$data]);
|
||||||
|
$notification = 'La page et son module ont été dupliqués';
|
||||||
|
}
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId,
|
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId,
|
||||||
'notification' => 'Page dupliquée',
|
'notification' => $notification,
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user