news layout -> option

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

View File

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

View File

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

View File

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