2022-03-06 13:35:21 +01:00
|
|
|
<?php
|
|
|
|
// Lexique
|
2022-09-11 09:42:42 +02:00
|
|
|
$param = '';
|
|
|
|
include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_form.php');
|
|
|
|
|
|
|
|
if($this->getData(['module', $this->getUrl(0), 'input'])): ?>
|
2022-05-01 11:45:17 +02:00
|
|
|
<?php echo template::formOpenFile('formForm'); ?>
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php foreach($this->getData(['module', $this->getUrl(0), 'input']) as $index => $input): ?>
|
|
|
|
<?php if($input['type'] === $module::TYPE_MAIL): ?>
|
|
|
|
<?php echo template::mail('formInput[' . $index . ']', [
|
|
|
|
'id' => 'formInput_' . $index,
|
2022-05-01 11:45:17 +02:00
|
|
|
'label' => $input['name'],
|
|
|
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'mail'])
|
2022-01-31 09:10:49 +01:00
|
|
|
]); ?>
|
|
|
|
<?php elseif($input['type'] === $module::TYPE_SELECT): ?>
|
|
|
|
<?php
|
|
|
|
$values = array_flip(explode(',', $input['values']));
|
|
|
|
foreach($values as $value => $key) {
|
|
|
|
$values[$value] = trim($value);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<?php echo template::select('formInput[' . $index . ']', $values, [
|
|
|
|
'id' => 'formInput_' . $index,
|
2022-05-01 11:45:17 +02:00
|
|
|
'label' => $input['name'],
|
|
|
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'select'])
|
2022-01-31 09:10:49 +01:00
|
|
|
]); ?>
|
|
|
|
<?php elseif($input['type'] === $module::TYPE_TEXT): ?>
|
|
|
|
<?php echo template::text('formInput[' . $index . ']', [
|
|
|
|
'id' => 'formInput_' . $index,
|
2022-05-01 11:45:17 +02:00
|
|
|
'label' => $input['name'],
|
|
|
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'text'])
|
2022-01-31 09:10:49 +01:00
|
|
|
]); ?>
|
|
|
|
<?php elseif($input['type'] === $module::TYPE_TEXTAREA): ?>
|
|
|
|
<?php echo template::textarea('formInput[' . $index . ']', [
|
|
|
|
'id' => 'formInput_' . $index,
|
2022-05-01 11:45:17 +02:00
|
|
|
'label' => $input['name'],
|
|
|
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'textarea'])
|
2022-01-31 09:10:49 +01:00
|
|
|
]); ?>
|
|
|
|
<?php elseif($input['type'] === $module::TYPE_DATETIME): ?>
|
|
|
|
<?php echo template::date('formInput[' . $index . ']', [
|
|
|
|
'id' => 'formInput_' . $index,
|
|
|
|
'label' => $input['name'],
|
2022-05-01 11:45:17 +02:00
|
|
|
'vendor' => 'flatpickr',
|
|
|
|
'value' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'datetime'])
|
2022-01-31 09:10:49 +01:00
|
|
|
]); ?>
|
|
|
|
<?php elseif($input['type'] === $module::TYPE_CHECKBOX): ?>
|
2022-05-01 11:45:17 +02:00
|
|
|
<?php echo template::checkbox('formInput[' . $index . ']', true, $input['name'], [
|
|
|
|
'checked' => $this->getData([ 'module', $this->getUrl(0), 'draft', 'checkbox'])
|
|
|
|
]); ?>
|
|
|
|
<?php elseif($input['type'] === $module::TYPE_FILE): ?>
|
|
|
|
<label class='formLabel'> <?php echo $input['name']; ?> </label>
|
|
|
|
<div class="formInputFile">
|
|
|
|
<input type="hidden" name="MAX_FILE_SIZE" value="5000000">
|
|
|
|
<input type="file" name="fileToUpload" id="fileToUpload">
|
|
|
|
<input type="button" id="formFileReset" value="X">
|
2022-09-02 08:44:18 +02:00
|
|
|
</div>
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php elseif($input['type'] === $module::TYPE_LABEL): ?>
|
2022-05-01 11:45:17 +02:00
|
|
|
<p class='formLabel'> <?php echo $input['name']; ?> </p>
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php endif; ?>
|
2022-09-02 08:44:18 +02:00
|
|
|
|
2022-01-31 09:10:49 +01:00
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php if($this->getData(['module', $this->getUrl(0), 'config', 'captcha'])): ?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col12 textAlignCenter">
|
|
|
|
<?php echo template::captcha('formCaptcha', [
|
|
|
|
'limit' => $this->getData(['config','connect', 'captchaStrong']),
|
|
|
|
'type' => $this->getData(['config','connect', 'captchaType'])
|
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col2 offset10">
|
|
|
|
<?php echo template::submit('formSubmit', [
|
2022-09-11 09:42:42 +02:00
|
|
|
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'button']) ? $this->getData(['module', $this->getUrl(0), 'config', 'button']) : $text['form_view']['index'][0],
|
2022-01-31 09:10:49 +01:00
|
|
|
'ico' => ''
|
|
|
|
]); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php echo template::formClose(); ?>
|
|
|
|
<?php else: ?>
|
2022-09-11 09:42:42 +02:00
|
|
|
<?php echo template::speech($text['form_view']['index'][1]); ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
<script>
|
|
|
|
var lang_flatpickr = "<?php echo $lang_flatpickr; ?>";
|
|
|
|
</script>
|