forked from ZwiiCMS-Team/ZwiiCMS
layout -> option
This commit is contained in:
parent
18a17e5576
commit
5be1f4641f
@ -24,7 +24,7 @@ class form extends common {
|
||||
|
||||
public static $actions = [
|
||||
'config' => self::GROUP_MODERATOR,
|
||||
'layout' => self::GROUP_MODERATOR,
|
||||
'option' => self::GROUP_MODERATOR,
|
||||
'data' => self::GROUP_MODERATOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'deleteall' => self::GROUP_MODERATOR,
|
||||
@ -146,7 +146,7 @@ class form extends common {
|
||||
}
|
||||
|
||||
|
||||
public function layout() {
|
||||
public function option() {
|
||||
// Liste des utilisateurs
|
||||
$userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname');
|
||||
ksort($userIdsFirstnames);
|
||||
@ -162,17 +162,17 @@ class form extends common {
|
||||
$this->getUrl(0),
|
||||
'config',
|
||||
[
|
||||
'button' => $this->getInput('formLayoutButton'),
|
||||
'captcha' => $this->getInput('formLayoutCaptcha', helper::FILTER_BOOLEAN),
|
||||
'group' => $this->getInput('formLayoutGroup', helper::FILTER_INT),
|
||||
'user' => self::$listUsers [$this->getInput('formLayoutUser', helper::FILTER_INT)],
|
||||
'mail' => $this->getInput('formLayoutMail') ,
|
||||
'pageId' => $this->getInput('formLayoutPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formLayoutPageId', helper::FILTER_ID) : '',
|
||||
'subject' => $this->getInput('formLayoutSubject'),
|
||||
'replyto' => $this->getInput('formLayoutMailReplyTo', helper::FILTER_BOOLEAN),
|
||||
'signature' => $this->getInput('formLayoutSignature'),
|
||||
'logoUrl' => $this->getInput('formLayoutLogo'),
|
||||
'logoWidth' => $this->getInput('formLayoutLogoWidth')
|
||||
'button' => $this->getInput('formOptionButton'),
|
||||
'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN),
|
||||
'group' => $this->getInput('formOptionGroup', helper::FILTER_INT),
|
||||
'user' => self::$listUsers [$this->getInput('formOptionUser', helper::FILTER_INT)],
|
||||
'mail' => $this->getInput('formOptionMail') ,
|
||||
'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '',
|
||||
'subject' => $this->getInput('formOptionSubject'),
|
||||
'replyto' => $this->getInput('formOptionMailReplyTo', helper::FILTER_BOOLEAN),
|
||||
'signature' => $this->getInput('formOptionSignature'),
|
||||
'logoUrl' => $this->getInput('formOptionLogo'),
|
||||
'logoWidth' => $this->getInput('formOptionLogoWidth')
|
||||
]
|
||||
]);
|
||||
// Génération des données vides
|
||||
@ -200,7 +200,7 @@ class form extends common {
|
||||
'html-sortable',
|
||||
'flatpickr'
|
||||
],
|
||||
'view' => 'layout'
|
||||
'view' => 'option'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -66,8 +66,8 @@
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::button('formConfigLayout', [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/layout',
|
||||
'value' => 'Paramètres',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
|
||||
'value' => 'Options',
|
||||
'ico' => 'cog-alt'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,72 +0,0 @@
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Affiche/cache les options de la case à cocher du mail
|
||||
*/
|
||||
$("#formLayoutMailOptionsToggle").on("change", function() {
|
||||
if($(this).is(":checked")) {
|
||||
$("#formLayoutMailOptions").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#formLayoutMailOptions").slideUp(function() {
|
||||
$("#formLayoutGroup").val("");
|
||||
$("#formLayoutSubject").val("");
|
||||
$("#formLayoutMail").val("");
|
||||
$("#formLayoutUser").val("");
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
/**
|
||||
* Affiche/cache les options de la case à cocher de la redirection
|
||||
*/
|
||||
$("#formLayoutPageIdToggle").on("change", function() {
|
||||
if($(this).is(":checked")) {
|
||||
$("#formLayoutPageIdWrapper").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#formLayoutPageIdWrapper").slideUp(function() {
|
||||
$("#formLayoutPageId").val("");
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
/**
|
||||
* Paramètres par défaut au chargement
|
||||
*/
|
||||
$( document ).ready(function() {
|
||||
|
||||
/**
|
||||
* Masquer ou afficher la sélection du logo
|
||||
*/
|
||||
if ($("#formLayoutSignature").val() !== "text") {
|
||||
$("#formLayoutLogoWrapper").addClass("disabled");
|
||||
$("#formLayoutLogoWrapper").slideDown();
|
||||
$("#formLayoutLogoWidthWrapper").addClass("disabled");
|
||||
$("#formLayoutLogoWidthWrapper").slideDown();
|
||||
} else {
|
||||
$("#formLayoutLogoWrapper").removeClass("disabled");
|
||||
$("#formLayoutLogoWrapper").slideUp();
|
||||
$("#formLayoutLogoWidthWrapper").removeClass("disabled");
|
||||
$("#formLayoutLogoWidthWrapper").slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Masquer ou afficher la sélection du logo
|
||||
*/
|
||||
var formLayoutSignatureDOM = $("#formLayoutSignature");
|
||||
formLayoutSignatureDOM.on("change", function() {
|
||||
if ($(this).val() !== "text") {
|
||||
$("#formLayoutLogoWrapper").addClass("disabled");
|
||||
$("#formLayoutLogoWrapper").slideDown();
|
||||
$("#formLayoutLogoWidthWrapper").addClass("disabled");
|
||||
$("#formLayoutLogoWidthWrapper").slideDown();
|
||||
} else {
|
||||
$("#formLayoutLogoWrapper").removeClass("disabled");
|
||||
$("#formLayoutLogoWrapper").slideUp();
|
||||
$("#formLayoutLogoWidthWrapper").removeClass("disabled");
|
||||
$("#formLayoutLogoWidthWrapper").slideUp();
|
||||
}
|
||||
});
|
72
module/form/view/option/option.js.php
Normal file
72
module/form/view/option/option.js.php
Normal file
@ -0,0 +1,72 @@
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Affiche/cache les options de la case à cocher du mail
|
||||
*/
|
||||
$("#formOptionMailOptionsToggle").on("change", function() {
|
||||
if($(this).is(":checked")) {
|
||||
$("#formOptionMailOptions").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#formOptionMailOptions").slideUp(function() {
|
||||
$("#formOptionGroup").val("");
|
||||
$("#formOptionSubject").val("");
|
||||
$("#formOptionMail").val("");
|
||||
$("#formOptionUser").val("");
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
/**
|
||||
* Affiche/cache les options de la case à cocher de la redirection
|
||||
*/
|
||||
$("#formOptionPageIdToggle").on("change", function() {
|
||||
if($(this).is(":checked")) {
|
||||
$("#formOptionPageIdWrapper").slideDown();
|
||||
}
|
||||
else {
|
||||
$("#formOptionPageIdWrapper").slideUp(function() {
|
||||
$("#formOptionPageId").val("");
|
||||
});
|
||||
}
|
||||
}).trigger("change");
|
||||
|
||||
/**
|
||||
* Paramètres par défaut au chargement
|
||||
*/
|
||||
$( document ).ready(function() {
|
||||
|
||||
/**
|
||||
* Masquer ou afficher la sélection du logo
|
||||
*/
|
||||
if ($("#formOptionSignature").val() !== "text") {
|
||||
$("#formOptionLogoWrapper").addClass("disabled");
|
||||
$("#formOptionLogoWrapper").slideDown();
|
||||
$("#formOptionLogoWidthWrapper").addClass("disabled");
|
||||
$("#formOptionLogoWidthWrapper").slideDown();
|
||||
} else {
|
||||
$("#formOptionLogoWrapper").removeClass("disabled");
|
||||
$("#formOptionLogoWrapper").slideUp();
|
||||
$("#formOptionLogoWidthWrapper").removeClass("disabled");
|
||||
$("#formOptionLogoWidthWrapper").slideUp();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Masquer ou afficher la sélection du logo
|
||||
*/
|
||||
var formOptionSignatureDOM = $("#formOptionSignature");
|
||||
formOptionSignatureDOM.on("change", function() {
|
||||
if ($(this).val() !== "text") {
|
||||
$("#formOptionLogoWrapper").addClass("disabled");
|
||||
$("#formOptionLogoWrapper").slideDown();
|
||||
$("#formOptionLogoWidthWrapper").addClass("disabled");
|
||||
$("#formOptionLogoWidthWrapper").slideDown();
|
||||
} else {
|
||||
$("#formOptionLogoWrapper").removeClass("disabled");
|
||||
$("#formOptionLogoWrapper").slideUp();
|
||||
$("#formOptionLogoWidthWrapper").removeClass("disabled");
|
||||
$("#formOptionLogoWidthWrapper").slideUp();
|
||||
}
|
||||
});
|
@ -1,7 +1,7 @@
|
||||
<?php echo template::formOpen('formLayoutForm'); ?>
|
||||
<?php echo template::formOpen('formOptionForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('formLayoutBack', [
|
||||
<?php echo template::button('formOptionBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'ico' => 'left',
|
||||
@ -9,7 +9,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('formLayoutSubmit'); ?>
|
||||
<?php echo template::submit('formOptionSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -18,12 +18,12 @@
|
||||
<h4>Validation du formulaire</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('formLayoutCaptcha', true, 'Captcha', [
|
||||
<?php echo template::checkbox('formOptionCaptcha', true, 'Captcha', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('formLayoutButton', [
|
||||
<?php echo template::text('formOptionButton', [
|
||||
'help' => 'Laissez vide afin de conserver le texte par défaut.',
|
||||
'label' => 'Etiquette du bouton de soumission',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button'])
|
||||
@ -32,12 +32,12 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('formLayoutPageIdToggle', true, 'Redirection après soumission du formulaire', [
|
||||
<?php echo template::checkbox('formOptionPageIdToggle', true, 'Redirection après soumission du formulaire', [
|
||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('formLayoutPageId', $module::$pages, [
|
||||
<?php echo template::select('formOptionPageId', $module::$pages, [
|
||||
'classWrapper' => 'displayNone',
|
||||
'label' => 'Page du site :',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
|
||||
@ -51,16 +51,16 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Courriel</h4>
|
||||
<?php echo template::checkbox('formLayoutMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
|
||||
<?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
|
||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
|
||||
'help' => 'Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.'
|
||||
]); ?>
|
||||
<div id="formLayoutMailOptions" class="displayNone">
|
||||
<div id="formOptionMailOptions" class="displayNone">
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::text('formLayoutSubject', [
|
||||
<?php echo template::text('formOptionSubject', [
|
||||
'help' => 'Laissez vide afin de conserver le texte par défaut.',
|
||||
'label' => 'Sujet du mail',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject'])
|
||||
@ -73,20 +73,20 @@
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('formLayoutGroup', $groupMembers, [
|
||||
<?php echo template::select('formOptionGroup', $groupMembers, [
|
||||
'label' => 'Aux groupes à partir de',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
|
||||
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('formLayoutUser', $module::$listUsers, [
|
||||
<?php echo template::select('formOptionUser', $module::$listUsers, [
|
||||
'label' => 'A un membre',
|
||||
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers)
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::text('formLayoutMail', [
|
||||
<?php echo template::text('formOptionMail', [
|
||||
'label' => 'A une adresse email',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'mail']),
|
||||
'help' => 'Un email ou une liste de diffusion'
|
||||
@ -95,20 +95,20 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('formLayoutSignature', $module::$signature, [
|
||||
<?php echo template::select('formOptionSignature', $module::$signature, [
|
||||
'label' => 'Sélectionner le type de signature',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::file('formLayoutLogo', [
|
||||
<?php echo template::file('formOptionLogo', [
|
||||
'help' => 'Sélectionnez le logo du site',
|
||||
'label' => 'Logo',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('formLayoutLogoWidth', $module::$logoWidth, [
|
||||
<?php echo template::select('formOptionLogoWidth', $module::$logoWidth, [
|
||||
'label' => 'Sélectionner la largeur du logo',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth'])
|
||||
]); ?>
|
||||
@ -116,7 +116,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('formLayoutMailReplyTo', true, 'Répondre à l\'expéditeur depuis le mail de notification', [
|
||||
<?php echo template::checkbox('formOptionMailReplyTo', true, 'Répondre à l\'expéditeur depuis le mail de notification', [
|
||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']),
|
||||
'help' => 'Cette option permet de réponse directement à l\'expéditeur du message si celui-ci a indiqué un email valide.'
|
||||
]); ?>
|
Loading…
Reference in New Issue
Block a user