2.0.0 corrige le warning blog vide + transmet tn paramètre sécurisant l'édition des espaces dans plusieurs onglets

This commit is contained in:
Fred Tempez 2024-04-22 15:40:35 +02:00
parent 05e6ff8f9b
commit 0da23149db
16 changed files with 22 additions and 30 deletions

View File

@ -422,14 +422,6 @@ class core extends common
|| $this->getUser('id') !== $this->getData(['course', self::$siteContent, 'author']) || $this->getUser('id') !== $this->getData(['course', self::$siteContent, 'author'])
) )
) { ) {
// Stocke l'historique des pages vues
/*
$data = is_array($this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)]))
? array_merge([time()], $this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)]))
: [time()];
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0), $data]);
*/
// Stocke la dernière page vue et sa date de consultation // Stocke la dernière page vue et sa date de consultation
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)]); $this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)]);
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'datePageView', time()]); $this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'datePageView', time()]);

View File

@ -1105,8 +1105,9 @@ class common
} }
// Articles du blog // Articles du blog
if ( if (
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog' && $this->getData(['page', $parentPageId, 'moduleId']) === 'blog'
!empty($this->getData(['module', $parentPageId])) && !empty($this->getData(['module', $parentPageId]))
&& $this->getData(['module', $parentPageId, 'posts'])
) { ) {
foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) { foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) {
if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) { if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) {

View File

@ -93,8 +93,7 @@ class page extends common
|| $this->getData(['page', $page]) === null || $this->getData(['page', $page]) === null
|| $this->getUrl(3) != self::$siteContent || $this->getUrl(3) != self::$siteContent
) { ) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'access' => false 'access' => false
@ -121,7 +120,7 @@ class page extends common
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId, 'redirect' => helper::baseUrl() . 'page/edit/' . $pageId . '/' . self::$siteContent,
'notification' => $notification, 'notification' => $notification,
'state' => true 'state' => true
]); ]);
@ -271,7 +270,7 @@ class page extends common
elseif ($this->getHierarchy($page, null)) { elseif ($this->getHierarchy($page, null)) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $page, 'redirect' => helper::baseUrl() . 'page/edit/' . $page . '/' . self::$siteContent,
'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants') 'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants')
]); ]);
} }
@ -642,7 +641,7 @@ class page extends common
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'notification' => helper::translate('Modifications enregistrées'), 'notification' => helper::translate('Modifications enregistrées'),
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
'state' => true 'state' => true
]); ]);
} }
@ -677,7 +676,7 @@ class page extends common
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'notification' => helper::translate('Modifications enregistrées'), 'notification' => helper::translate('Modifications enregistrées'),
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), 'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
'state' => true 'state' => true
]); ]);
} }

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('pageCssEditorBack', [ <?php echo template::button('pageCssEditorBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -19,14 +19,14 @@
<div class="col1 offset6"> <div class="col1 offset6">
<?php echo template::button('pageEditDelete', [ <?php echo template::button('pageEditDelete', [
'class' => 'buttonRed', 'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2), 'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
'value' => template::ico('trash'), 'value' => template::ico('trash'),
'help' => 'Effacer la page' 'help' => 'Effacer la page'
]); ?> ]); ?>
</div> </div>
<div class="col1"> <div class="col1">
<?php echo template::button('pageEditDuplicate', [ <?php echo template::button('pageEditDuplicate', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2), 'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '/' . self::$siteContent,
'value' => template::ico('clone'), 'value' => template::ico('clone'),
'help' => 'Dupliquer la page' 'help' => 'Dupliquer la page'
]); ?> ]); ?>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('pageJsEditorBack', [ <?php echo template::button('pageJsEditorBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('blogConfigBack', [ <?php echo template::button('blogConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'posts', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -53,7 +53,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('formConfigBack', [ <?php echo template::button('formConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('galleryConfigBack', [ <?php echo template::button('galleryConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('newsConfigBack', [ <?php echo template::button('newsConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),'posts', 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0). '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('redirectionConfigBack', [ <?php echo template::button('redirectionConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -19,7 +19,7 @@
core.confirm( core.confirm(
message, message,
function() { function() {
$(location).attr("href", "<?php echo helper::baseUrl(); ?>page/edit/<?php echo $this->getUrl(0); ?>"); $(location).attr("href", "<?php echo helper::baseUrl(); ?>page/edit/<?php echo $this->getUrl(0) . '/' . self::$siteContent; ?>");
}, },
function() { function() {
$(location).attr("href", "<?php echo helper::baseUrl() . $this->getUrl(); ?>/force"); $(location).attr("href", "<?php echo helper::baseUrl() . $this->getUrl(); ?>/force");

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('searchConfigBack', [ <?php echo template::button('searchConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('galleryConfigBack', [ <?php echo template::button('galleryConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>

View File

@ -4,7 +4,7 @@
<div class="col2"> <div class="col2">
<?php echo template::button('registrationConfigBack', [ <?php echo template::button('registrationConfigBack', [
'class' => '', 'class' => '',
'href' => helper::baseUrl() .'page/edit/' . $this->getUrl(0) , 'href' => helper::baseUrl() .'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'ico' => 'left', 'ico' => 'left',
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>

View File

@ -3,7 +3,7 @@
<div class="col1"> <div class="col1">
<?php echo template::button('coursesConfigBack', [ <?php echo template::button('coursesConfigBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
'value' => template::ico('left') 'value' => template::ico('left')
]); ?> ]); ?>
</div> </div>