Differences From Artifact [7a56549b09]:

To Artifact [ad5ed56bcb]:


217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

		$attributes['id'] = 'f_' . $name;
		$attributes['name'] = $name;

		if ($type == 'radio' || $type == 'checkbox') {
			$attributes['id'] .= '_' . $value;

			if (isset($_POST[$name]) && $_POST[$name] == $value) {
				$attributes['checked'] = 'checked';
			}
		}
		elseif ($type == 'file') {
			$help = sprintf('Taille maximale : %s', Utils::format_bytes(Utils::getMaxUploadSize()));
		}
		elseif ($type == 'date') {







|







217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

		$attributes['id'] = 'f_' . $name;
		$attributes['name'] = $name;

		if ($type == 'radio' || $type == 'checkbox') {
			$attributes['id'] .= '_' . $value;

			if ($current_value == $value) {
				$attributes['checked'] = 'checked';
			}
		}
		elseif ($type == 'file') {
			$help = sprintf('Taille maximale : %s', Utils::format_bytes(Utils::getMaxUploadSize()));
		}
		elseif ($type == 'date') {
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331



332
333
334
335




336

337

338
339
340
341
342
343
344
		// No label? then we only want the input without the widget
		if (empty($label)) {
			return $input;
		}

		$required_label = array_key_exists('required', $attributes) ? ' <b title="Champ obligatoire">(obligatoire)</b>' : '';

		$out = '<dt>';

		if ($type == 'radio' || $type == 'checkbox') {
			$out .= $input . ' ';
		}

		if ($type == 'file') {
			$input .= sprintf('<input type="hidden" name="MAX_FILE_SIZE" value="%d" id="f_maxsize" />', Utils::return_bytes(Utils::getMaxUploadSize()));
		}

		$out .= sprintf('<label for="%s">%s</label>%s</dt>', $attributes['id'], $this->escape($label), $required_label);




		if (isset($help)) {
			$out .= sprintf('<dd class="help">%s</dd>', $this->escape($help));
		}





		if ($type != 'radio' && $type != 'checkbox') {

			$out .= sprintf('<dd>%s</dd>', $input);

		}

		return $out;
	}

	protected function formField(array $params, $escape = true)
	{







<
<
<
<
<
<




|

>
>
>
|
|
|

>
>
>
>
|
>
|
>







313
314
315
316
317
318
319






320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
		// No label? then we only want the input without the widget
		if (empty($label)) {
			return $input;
		}

		$required_label = array_key_exists('required', $attributes) ? ' <b title="Champ obligatoire">(obligatoire)</b>' : '';







		if ($type == 'file') {
			$input .= sprintf('<input type="hidden" name="MAX_FILE_SIZE" value="%d" id="f_maxsize" />', Utils::return_bytes(Utils::getMaxUploadSize()));
		}

		$label = sprintf('<label for="%s">%s</label>%s', $attributes['id'], $this->escape($label), $required_label);

		if ($type == 'radio' || $type == 'checkbox') {
			$out = sprintf('<dd>%s %s', $input, $label);

			if (isset($help)) {
				$out .= sprintf(' <em class="help">(%s)</em>', $this->escape($help));
			}

			$out .= '</dd>';
		}
		else {
			$out = sprintf('<dt>%s</dt><dd>%s</dd>', $label, $input);

			if (isset($help)) {
				$out .= sprintf('<dd class="help">%s</dd>', $this->escape($help));
			}
		}

		return $out;
	}

	protected function formField(array $params, $escape = true)
	{