Deltacms/module/form/view/config/config.php

333 lines
12 KiB
PHP

<?php
// Lexique
$text = [];
$val = $this->getData(['config', 'i18n', 'langAdmin']);
switch ($val) {
case 'fr' :
$text[0] = 'Intitulé';
$text[1] = 'Aucune option pour ce champ';
$text[2] = 'Liste des valeurs séparées par des virgules (valeur1,valeur2,...)';
$text[3] = 'Champ obligatoire';
$text[4] = 'Retour';
$text[5] = 'Gérer les données';
$text[6] = 'Configuration';
$text[7] = 'Laissez vide afin de conserver le texte par défaut.';
$text[8] = 'Texte du bouton de soumission';
$text[9] = 'Envoyer par mail les données saisies :';
$text[10] = 'Sélectionnez au moins un groupe, un utilisateur ou saississez un email. Votre serveur doit autoriser les envois de mail.';
$text[11] = 'Laissez vide afin de conserver le texte par défaut.';
$text[12] = 'Sujet du mail';
$text[13] = 'Aux groupes à partir de ';
$text[14] = 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs';
$text[15] = 'A un membre';
$text[16] = 'A une adresse email';
$text[17] = 'Un email ou une liste de diffusion';
$text[18] = 'Répondre à l\'expéditeur depuis le mail de notification';
$text[19] = 'Cette option permet de répondre directement à l\'expéditeur du message si celui-ci a indiqué un email valide.';
$text[20] = 'Sélectionner le type de signature';
$text[21] = 'Sélectionnez le logo du site';
$text[22] = 'Logo';
$text[23] = 'Sélectionner la largeur du logo';
$text[24] = 'Redirection après soumission du formulaire';
$text[25] = 'Sélectionner une page du site :';
$text[26] = 'Valider un captcha afin de soumettre le formulaire.';
$text[27] = 'Liste des champs';
$text[28] = 'Le formulaire ne contient aucun champ.';
$text[29] = 'Version n°';
$text[30] = 'Enregistrer';
$text[31] = 'Taille maximale de la pièce jointe';
$text[32] = 'Types de fichiers autorisés';
$text[33] = 'jpg';
$text[34] = 'png';
$text[35] = 'pdf';
$text[36] = 'zip';
$text[37] = 'txt';
$text[38] = 'Notez dans le label du champ file le type et la taille des fichiers autorisés. Des contrôles sont effectués sur les fichiers jpg, png, pdf et zip mais pas sur les fichiers txt. Prudence !';
$types = $module::$types;
$signature = $module::$signature;
break;
case 'en' :
$text[0] = 'Heading';
$text[1] = 'No option for this field';
$text[2] = 'Comma separated list of values (value1,value2,...)';
$text[3] = 'Required field';
$text[4] = 'Back';
$text[5] = 'Manage data';
$text[6] = 'Configuration';
$text[7] = 'Leave blank to keep default text';
$text[8] = 'Submit button text';
$text[9] = 'Send entered data by email :';
$text[10] = 'Select at least one group, user or enter an email. Your server must allow mail to be sent.';
$text[11] = 'Leave blank to keep the default text';
$text[12] = 'Mail subject';
$text[13] = 'To groups from ';
$text[14] = 'Publishers = publishers + administrators<br/> Members = members + editors + administrators';
$text[15] = 'To a member';
$text[16] = 'To an email address';
$text[17] = 'An email or mailing list';
$text[18] = 'Reply to the sender from the notification email';
$text[19] = 'This option allows the sender of the message to be replied to directly if he/she has given a valid email address';
$text[20] = 'Select signature type';
$text[21] = 'Select the site logo';
$text[22] = 'Logo';
$text[23] = 'Select logo width';
$text[24] = 'Redirect after form submission';
$text[25] = 'Select a page from the site:';
$text[26] = 'Validate a captcha in order to submit the form';
$text[27] = 'List of fields';
$text[28] = 'The form contains no fields';
$text[29] = 'Version no.';
$text[30] = 'Register';
$text[31] = 'Maximum size of the attachment';
$text[32] = 'Permitted file types';
$text[33] = 'jpg';
$text[34] = 'png';
$text[35] = 'pdf';
$text[36] = 'zip';
$text[37] = 'txt';
$text[38] = 'Note in the label of the file field the type and size of files allowed. Checks are performed on jpg, png, pdf and zip files but not on txt files. Be careful!';
$types = $module::$types_en;
$signature = $module::$signature_en;
break;
}
?>
<div id="formConfigCopy" class="displayNone">
<div class="formConfigInput">
<?php echo template::hidden('formConfigPosition[]', [
'class' => 'formConfigPosition'
]); ?>
<div class="row">
<div class="col1">
<?php echo template::button('formConfigMove[]', [
'value' => template::ico('sort'),
'class' => 'formConfigMove'
]); ?>
</div>
<div class="col5">
<?php echo template::text('formConfigName[]', [
'placeholder' => $text[0]
]); ?>
</div>
<div class="col4">
<?php echo template::select('formConfigType[]', $types, [
'class' => 'formConfigType'
]); ?>
</div>
<div class="col1">
<?php echo template::button('formConfigMoreToggle[]', [
'value' => template::ico('gear'),
'class' => 'formConfigMoreToggle'
]); ?>
</div>
<div class="col1">
<?php echo template::button('formConfigDelete[]', [
'value' => template::ico('minus'),
'class' => 'formConfigDelete'
]); ?>
</div>
</div>
<div class="formConfigMoreLabel displayNone">
<?php echo template::label('formConfigLabel', $text[1], [
'class' => 'displayNone formConfigLabelWrapper'
]); ?>
</div>
<div class="formConfigMore displayNone">
<?php echo template::text('formConfigValues[]', [
'placeholder' => $text[2],
'class' => 'formConfigValues',
'classWrapper' => 'displayNone formConfigValuesWrapper'
]); ?>
<?php echo template::checkbox('formConfigRequired[]', true, $text[3]); ?>
</div>
</div>
</div>
<?php echo template::formOpen('formConfigForm'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('formConfigBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'ico' => 'left',
'value' => $text[4]
]); ?>
</div>
<div class="col3 offset5">
<?php echo template::button('formConfigData', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/data',
'value' => $text[5]
]); ?>
</div>
<div class="col2">
<?php echo template::submit('formConfigSubmit',[
'value' => $text[30]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo $text[6]; ?></h4>
<?php echo template::text('formConfigButton', [
'help' => $text[7],
'label' => $text[8],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button'])
]); ?>
<?php echo template::checkbox('formConfigMailOptionsToggle', true, $text[9], [
'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' => $text[10]
]); ?>
<div id="formConfigMailOptions" class="displayNone">
<div class="row">
<div class="col11 offset1">
<?php echo template::text('formConfigSubject', [
'help' => $text[11],
'label' => $text[12],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'subject'])
]); ?>
</div>
</div>
<?php
// Element 0 quand aucun membre a été sélectionné
$groupMembers = [''] + $module::$groupNews;
?>
<div class="row">
<div class="col3 offset1">
<?php echo template::select('formConfigGroup', $groupMembers, [
'label' => $text[13],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
'help' => $text[14]
]); ?>
</div>
<div class="col3">
<?php echo template::select('formConfigUser', $module::$listUsers, [
'label' => $text[15],
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'user']),$module::$listUsers)
]); ?>
</div>
<div class="col4">
<?php echo template::text('formConfigMail', [
'label' => $text[16],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'mail']),
'help' => $text[17]
]); ?>
</div>
</div>
<div class="row">
<div class="col6 offset1">
<?php echo template::checkbox('formConfigMailReplyTo', true, $text[18], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'replyto']),
'help' => $text[19]
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('formConfigSignature', $signature, [
'label' => $text[20],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'signature'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('formConfigLogo', [
'help' => $text[21],
'label' => $text[22],
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('formConfigLogoWidth', $module::$logoWidth, [
'label' => $text[23],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'logoWidth'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('formConfigPageIdToggle', true, $text[24], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
]); ?>
</div>
<div class="col5">
<?php echo template::select('formConfigPageId', $module::$pages, [
'classWrapper' => 'displayNone',
'label' => $text[25],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pageId'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('formConfigCaptcha', true, $text[26], [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'captcha'])
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('formConfigMaxSize', $module::$maxSizeUpload, [
'label' => $text[31],
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'maxSizeUpload'])
]); ?>
</div>
<div class="col8">
<div class="row">
<div class="col12">
<?php echo template::label('formConfigUploadLabel', $text[32],[
'help' => $text[38]
]); ?>
</div>
</div>
<div class="row">
<div class="col2">
<?php echo template::checkbox('formConfigUploadJpg', true, $text[33], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'uploadJpg'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('formConfigUploadPng', true, $text[34], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'uploadPng'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('formConfigUploadPdf', true, $text[35], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'uploadPdf'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('formConfigUploadZip', true, $text[36], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'uploadZip'])
]); ?>
</div>
<div class="col2">
<?php echo template::checkbox('formConfigUploadTxt', true, $text[37], [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'uploadTxt'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="block">
<h4><?php echo $text[27]; ?></h4>
<div id="formConfigNoInput">
<?php echo template::speech($text[28]); ?>
</div>
<div id="formConfigInputs"></div>
<div class="row">
<div class="col1 offset11">
<?php echo template::button('formConfigAdd', [
'value' => template::ico('plus')
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion"><?php echo $text[29]; ?>
<?php echo $module::VERSION; ?>
</div>