news layout -> option

This commit is contained in:
fredtempez 2022-01-20 10:37:00 +01:00
parent 3aa29f8fa2
commit a7e287b74c
4 changed files with 22 additions and 24 deletions

View File

@ -24,7 +24,7 @@ class news extends common {
public static $actions = [ public static $actions = [
'add' => self::GROUP_MODERATOR, 'add' => self::GROUP_MODERATOR,
'config' => self::GROUP_MODERATOR, // Edition des news 'config' => self::GROUP_MODERATOR, // Edition des news
'layout' => self::GROUP_MODERATOR, // paramétrage des news 'option' => self::GROUP_MODERATOR, // paramétrage des news
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_MODERATOR,
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
@ -244,7 +244,7 @@ class news extends common {
]); ]);
} }
public function layout() { public function option() {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
@ -272,18 +272,18 @@ class news extends common {
]]); ]]);
$this->setData(['module', $this->getUrl(0), 'config',[ $this->setData(['module', $this->getUrl(0), 'config',[
'feeds' => $this->getInput('newsLayoutShowFeeds',helper::FILTER_BOOLEAN), 'feeds' => $this->getInput('newsOptionShowFeeds',helper::FILTER_BOOLEAN),
'feedsLabel' => $this->getInput('newsLayoutFeedslabel',helper::FILTER_STRING_SHORT), 'feedsLabel' => $this->getInput('newsOptionFeedslabel',helper::FILTER_STRING_SHORT),
'itemsperPage' => $this->getInput('newsLayoutItemsperPage', helper::FILTER_INT,true), 'itemsperPage' => $this->getInput('newsOptionItemsperPage', helper::FILTER_INT,true),
'itemsperCol' => $this->getInput('newsLayoutItemsperCol', helper::FILTER_INT,true), 'itemsperCol' => $this->getInput('newsOptionItemsperCol', helper::FILTER_INT,true),
'height' => $this->getInput('newsLayoutHeight', helper::FILTER_INT,true), 'height' => $this->getInput('newsOptionHeight', helper::FILTER_INT,true),
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData'])
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/layout', 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/option',
'notification' => 'Modifications enregistrées', 'notification' => 'Modifications enregistrées',
'state' => true 'state' => true
]); ]);
@ -291,7 +291,7 @@ class news extends common {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Mise en page', 'title' => 'Mise en page',
'view' => 'layout', 'view' => 'option',
'vendor' => [ 'vendor' => [
'tinycolorpicker' 'tinycolorpicker'
] ]

View File

@ -8,18 +8,16 @@
'value' => 'Retour' 'value' => 'Retour'
]); ?> ]); ?>
</div> </div>
<div class="col2 offset6"> <div class="col1 offset8">
<?php echo template::button('newsConfigAdd', [ <?php echo template::button('newsConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add', 'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'ico' => 'plus', 'value' => template::ico('plus')
'value' => 'News'
]); ?> ]); ?>
</div> </div>
<div class="col2"> <div class="col1">
<?php echo template::button('newsConfigLayout', [ <?php echo template::button('newsConfigLayout', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/layout', 'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
'ico' => 'brush', 'value' => template::ico('brush')
'value' => 'Mise en page'
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('newsLayout'); ?> <?php echo template::formOpen('newsOption'); ?>
<div class="row"> <div class="row">
<div class="col2"> <div class="col2">
<?php echo template::button('newsLayoutBack', [ <?php echo template::button('newsOptionBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config', 'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left', 'ico' => 'left',
@ -9,7 +9,7 @@
]); ?> ]); ?>
</div> </div>
<div class="col2 offset8"> <div class="col2 offset8">
<?php echo template::submit('newsLayoutSubmit'); ?> <?php echo template::submit('newsOptionSubmit'); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -18,13 +18,13 @@
<h4>Paramètres du module</h4> <h4>Paramètres du module</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::checkbox('newsLayoutShowFeeds', true, 'Lien du flux RSS', [ <?php echo template::checkbox('newsOptionShowFeeds', true, 'Lien du flux RSS', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), 'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
'help' => 'Flux limité aux articles de la première page.' 'help' => 'Flux limité aux articles de la première page.'
]); ?> ]); ?>
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::text('newsLayoutFeedslabel', [ <?php echo template::text('newsOptionFeedslabel', [
'label' => 'Etiquette RSS', 'label' => 'Etiquette RSS',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
]); ?> ]); ?>
@ -32,19 +32,19 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<?php echo template::select('newsLayoutItemsperCol', $module::$columns, [ <?php echo template::select('newsOptionItemsperCol', $module::$columns, [
'label' => 'Nombre de colonnes', 'label' => 'Nombre de colonnes',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']) 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('newsLayoutItemsperPage', $module::$itemsList, [ <?php echo template::select('newsOptionItemsperPage', $module::$itemsList, [
'label' => 'Articles par page', 'label' => 'Articles par page',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">
<?php echo template::select('newsLayoutHeight', $module::$height, [ <?php echo template::select('newsOptionHeight', $module::$height, [
'label' => 'Abrégé de l\'article', 'label' => 'Abrégé de l\'article',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height']) 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height'])
]); ?> ]); ?>