mise à jour de form 5.1
This commit is contained in:
parent
26a6d16dae
commit
2b82f5c4a5
|
@ -6,7 +6,8 @@
|
||||||
- News 4.8 : en configuration paramétrage des couleurs pour le texte, les titres, les liens et la signature,
|
- News 4.8 : en configuration paramétrage des couleurs pour le texte, les titres, les liens et la signature,
|
||||||
- Captcha : polices truetype pour compatibilité avec d'anciennes compilations d'une librairie PHP
|
- Captcha : polices truetype pour compatibilité avec d'anciennes compilations d'une librairie PHP
|
||||||
- Corrections :
|
- Corrections :
|
||||||
- News 4.8 : en édition des news les couleurs paramétrées sont visibles dans l'éditeur Tinymce.
|
- News 4.8 : en édition des news les couleurs paramétrées sont visibles dans l'éditeur Tinymce,
|
||||||
|
- Form 5.1 : le brouillon peut mémoriser et restituer plusieurs champs texte et sélection.
|
||||||
- Sur le site :
|
- Sur le site :
|
||||||
- Bonus / Module : livre d'or (guestbook) nouveau module.
|
- Bonus / Module : livre d'or (guestbook) nouveau module.
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
"logoUrl": "",
|
"logoUrl": "",
|
||||||
"logoWidth": "40",
|
"logoWidth": "40",
|
||||||
"maxSizeUpload": "500000",
|
"maxSizeUpload": "500000",
|
||||||
"versionData": "5.0",
|
"versionData": "5.1",
|
||||||
"uploadJpg": true,
|
"uploadJpg": true,
|
||||||
"uploadPng": true,
|
"uploadPng": true,
|
||||||
"uploadPdf": false,
|
"uploadPdf": false,
|
||||||
|
|
|
@ -118,7 +118,7 @@
|
||||||
"logoUrl": "",
|
"logoUrl": "",
|
||||||
"logoWidth": "40",
|
"logoWidth": "40",
|
||||||
"maxSizeUpload": "500000",
|
"maxSizeUpload": "500000",
|
||||||
"versionData": "5.0",
|
"versionData": "5.1",
|
||||||
"uploadJpg": true,
|
"uploadJpg": true,
|
||||||
"uploadPng": true,
|
"uploadPng": true,
|
||||||
"uploadPdf": false,
|
"uploadPdf": false,
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
"logoUrl": "",
|
"logoUrl": "",
|
||||||
"logoWidth": "40",
|
"logoWidth": "40",
|
||||||
"maxSizeUpload": "1000000",
|
"maxSizeUpload": "1000000",
|
||||||
"versionData": "5.0",
|
"versionData": "5.1",
|
||||||
"uploadJpg": true,
|
"uploadJpg": true,
|
||||||
"uploadPng": true,
|
"uploadPng": true,
|
||||||
"uploadPdf": false,
|
"uploadPdf": false,
|
||||||
|
|
|
@ -93,7 +93,7 @@ class init extends common {
|
||||||
'administratorLabel' => 'Administrateur',
|
'administratorLabel' => 'Administrateur',
|
||||||
'metaDescription' => 'DeltaCMS est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
|
'metaDescription' => 'DeltaCMS est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.',
|
||||||
'title' => 'DeltaCMS',
|
'title' => 'DeltaCMS',
|
||||||
'captchaSimpleText' => 'Je ne suis pas un robot',
|
'captchaSimpleText' => 'Je suis un humain',
|
||||||
'captchaSimpleHelp' => 'Cochez cette case pour prouver que vous êtes humain',
|
'captchaSimpleHelp' => 'Cochez cette case pour prouver que vous êtes humain',
|
||||||
'cookies' => [
|
'cookies' => [
|
||||||
'cookiesDeltaText' => 'Ce site utilise des cookies nécessaires à son fonctionnement, ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie ou la validation de ce message.',
|
'cookiesDeltaText' => 'Ce site utilise des cookies nécessaires à son fonctionnement, ils permettent de fluidifier son fonctionnement par exemple en mémorisant les données de connexion, la langue que vous avez choisie ou la validation de ce message.',
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
class form extends common {
|
class form extends common {
|
||||||
|
|
||||||
const VERSION = '5.0';
|
const VERSION = '5.1';
|
||||||
const REALNAME = 'Formulaire';
|
const REALNAME = 'Formulaire';
|
||||||
const DELETE = true;
|
const DELETE = true;
|
||||||
const UPDATE = '0.0';
|
const UPDATE = '0.0';
|
||||||
|
@ -84,8 +84,8 @@ class form extends common {
|
||||||
$this->setData(['module', $this->getUrl(0), 'config', 'uploadTxt',false]);
|
$this->setData(['module', $this->getUrl(0), 'config', 'uploadTxt',false]);
|
||||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']);
|
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']);
|
||||||
}
|
}
|
||||||
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.0', '<') ){
|
if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.1', '<') ){
|
||||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '5.0']);
|
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '5.1']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,6 +439,7 @@ class form extends common {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Mise à jour du brouillon
|
// Mise à jour du brouillon
|
||||||
|
$textIndex = 0; $selectIndex=0; $checkboxIndex=0;
|
||||||
for( $index = 0; $index <= count($this->getData(['module', $this->getUrl(0), 'input'])); $index++){
|
for( $index = 0; $index <= count($this->getData(['module', $this->getUrl(0), 'input'])); $index++){
|
||||||
switch ($this->getData(['module', $this->getUrl(0), 'input', $index, 'type'])){
|
switch ($this->getData(['module', $this->getUrl(0), 'input', $index, 'type'])){
|
||||||
case self::TYPE_MAIL:
|
case self::TYPE_MAIL:
|
||||||
|
@ -453,13 +454,16 @@ class form extends common {
|
||||||
$this->setData(['module', $this->getUrl(0), 'draft', 'datetime', $dateTime]);
|
$this->setData(['module', $this->getUrl(0), 'draft', 'datetime', $dateTime]);
|
||||||
break;
|
break;
|
||||||
case self::TYPE_CHECKBOX:
|
case self::TYPE_CHECKBOX:
|
||||||
//$this->setData(['module', $this->getUrl(0), 'draft', 'checkbox', $this->getInput('formInput[' . $index . ']',helper::FILTER_BOOLEAN)]);
|
$this->setData(['module', $this->getUrl(0), 'draft', 'checkbox', $checkboxIndex, $this->getInput('formInput[' . $index . ']',helper::FILTER_BOOLEAN)]);
|
||||||
|
$checkboxIndex++;
|
||||||
break;
|
break;
|
||||||
case self::TYPE_SELECT:
|
case self::TYPE_SELECT:
|
||||||
$this->setData(['module', $this->getUrl(0), 'draft', 'select', $this->getInput('formInput[' . $index . ']')]);
|
$this->setData(['module', $this->getUrl(0), 'draft', 'select', $selectIndex, $this->getInput('formInput[' . $index . ']')]);
|
||||||
|
$selectIndex++;
|
||||||
break;
|
break;
|
||||||
case self::TYPE_TEXT:
|
case self::TYPE_TEXT:
|
||||||
$this->setData(['module', $this->getUrl(0), 'draft', 'text', $this->getInput('formInput[' . $index . ']')]);
|
$this->setData(['module', $this->getUrl(0), 'draft', 'text', $textIndex, $this->getInput('formInput[' . $index . ']')]);
|
||||||
|
$textIndex++;
|
||||||
break;
|
break;
|
||||||
case self::TYPE_FILE:
|
case self::TYPE_FILE:
|
||||||
$this->setData(['module', $this->getUrl(0), 'draft', 'file', basename($_FILES["fileToUpload"]["name"]) ]);
|
$this->setData(['module', $this->getUrl(0), 'draft', 'file', basename($_FILES["fileToUpload"]["name"]) ]);
|
||||||
|
|
|
@ -42,7 +42,8 @@ echo '<script> var lang_admin = "'.$lang_page.'"; </script>';
|
||||||
if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
||||||
<?php echo template::formOpenFile('formForm'); ?>
|
<?php echo template::formOpenFile('formForm'); ?>
|
||||||
<div class="humanBot">
|
<div class="humanBot">
|
||||||
<?php foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
|
<?php $textIndex=0; $selectIndex=0; $checkboxIndex=0;
|
||||||
|
foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
|
||||||
<?php if($input['type'] === $module::TYPE_MAIL): ?>
|
<?php if($input['type'] === $module::TYPE_MAIL): ?>
|
||||||
<?php echo template::mail('formInput[' . $index . ']', [
|
<?php echo template::mail('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
|
@ -59,14 +60,16 @@ if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
||||||
<?php echo template::select('formInput[' . $index . ']', $values, [
|
<?php echo template::select('formInput[' . $index . ']', $values, [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name'],
|
'label' => $input['name'],
|
||||||
'selected' => $values[$this->getData([ 'module', $this->getUrl(0), 'draft', 'select'])]
|
'selected' => $values[$this->getData([ 'module', $this->getUrl(0), 'draft', 'select', $selectIndex])]
|
||||||
]); ?>
|
]);
|
||||||
|
$selectIndex++; ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_TEXT): ?>
|
<?php elseif($input['type'] === $module::TYPE_TEXT): ?>
|
||||||
<?php echo template::text('formInput[' . $index . ']', [
|
<?php echo template::text('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
'label' => $input['name'],
|
'label' => $input['name'],
|
||||||
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'text'])
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'text', $textIndex])
|
||||||
]); ?>
|
]);
|
||||||
|
$textIndex++; ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_TEXTAREA): ?>
|
<?php elseif($input['type'] === $module::TYPE_TEXTAREA): ?>
|
||||||
<?php echo template::textarea('formInput[' . $index . ']', [
|
<?php echo template::textarea('formInput[' . $index . ']', [
|
||||||
'id' => 'formInput_' . $index,
|
'id' => 'formInput_' . $index,
|
||||||
|
@ -81,10 +84,12 @@ if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
||||||
'label' => $input['name'],
|
'label' => $input['name'],
|
||||||
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'datetime'])
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'datetime'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_CHECKBOX): ?>
|
<?php elseif($input['type'] === $module::TYPE_CHECKBOX):
|
||||||
<?php echo template::checkbox('formInput[' . $index . ']', true, $input['name'], [
|
echo template::checkbox('formInput[' . $index . ']', true, $input['name'], [
|
||||||
'checked' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'checkbox'])
|
'before' => false,
|
||||||
]); ?>
|
'checked' => false // Problème non solutionné avec $this->getData([ 'module', $this->getUrl(0), 'draft', 'checkbox', $checkboxIndex])
|
||||||
|
]);
|
||||||
|
$checkboxIndex++; ?>
|
||||||
<?php elseif($input['type'] === $module::TYPE_FILE): ?>
|
<?php elseif($input['type'] === $module::TYPE_FILE): ?>
|
||||||
<label class='formLabel'> <?php echo $input['name']; ?> </label>
|
<label class='formLabel'> <?php echo $input['name']; ?> </label>
|
||||||
<div class="formInputFile">
|
<div class="formInputFile">
|
||||||
|
|
Loading…
Reference in New Issue