forked from ZwiiCMS-Team/ZwiiCMS
protection changement module
This commit is contained in:
parent
96041f1842
commit
ef71b79225
|
@ -76,7 +76,8 @@ class page extends common {
|
|||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
// Adresse sans le token
|
||||
$url = explode('&',$this->getUrl(2));
|
||||
// La page n'existe pas
|
||||
|
@ -127,7 +128,6 @@ class page extends common {
|
|||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -349,7 +349,8 @@ class page extends common {
|
|||
}
|
||||
}
|
||||
// Supprime les données du module en cas de changement de module
|
||||
if($this->getInput('pageEditModuleId') !== $this->getData(['page', $this->getUrl(2), 'moduleId'])) {
|
||||
if( !empty($this->getInput('pageEditModuleId') )
|
||||
AND $this->getInput('pageEditModuleId') !== $this->getData(['page', $this->getUrl(2), 'moduleId'])) {
|
||||
$this->deleteData(['module', $pageId]);
|
||||
}
|
||||
// Supprime l'ancienne page si l'id a changée
|
||||
|
|
|
@ -51,12 +51,12 @@ echo template::formOpen('pageEditForm');
|
|||
<div class="row">
|
||||
<div class="col9">
|
||||
<?php echo template::hidden('pageEditModuleRedirect'); ?>
|
||||
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
|
||||
<?php echo template::select('pageEditModuleId', $listModules, [
|
||||
'help' => 'En cas de changement de module, les données du module précédent seront supprimées.',
|
||||
'label' => 'Module',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId']),
|
||||
'disabled' => !($module::$actions['delete'] < $this->getUser('group'))
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
|
||||
]); ?>
|
||||
<!-- Confirmation de suppression e ca sd'annulation -->
|
||||
<?php echo template::hidden('pageEditModuleIdOld',['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
|
||||
<?php echo template::hidden('pageEditModuleIdOldText',[
|
||||
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']),$module::$moduleNames)? $module::$moduleNames[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
|
|
Loading…
Reference in New Issue