[!!!][TASK] Drop TYPO3_CONF_VARS['SYS]['form_enctype']
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / Domain / Model / Attribute / EnctypeAttribute.php
1 <?php
2 namespace TYPO3\CMS\Form\Domain\Model\Attribute;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Attribute 'enctype'
19 */
20 class EnctypeAttribute extends \TYPO3\CMS\Form\Domain\Model\Attribute\AbstractAttribute {
21
22 /**
23 * Gets the attribute 'enctype'.
24 * Used with the element 'form'
25 * Case Insensitive
26 *
27 * This attribute specifies the content type used to submit the form to the
28 * server (when the value of method is "post"). The default value for this
29 * attribute is "application/x-www-form-urlencoded".
30 * The value "multipart/form-data" should be used in combination with the
31 * INPUT element, type="file".
32 *
33 * @return string Attribute value
34 */
35 public function getValue() {
36 $value = trim(strtolower((string)$this->value));
37 if ($value === 'application/x-www-form-urlencoded') {
38 $attribute = $value;
39 } else {
40 $attribute = 'multipart/form-data';
41 }
42 return $attribute;
43 }
44
45 }