13d36581fd95db36152eafe93c2344e9e648ac38
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / View / Mail / Plain / Element / Fileupload.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2011 Rens Admiraal (r.admiraal@drecomm.nl)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * View object for the fieldset element
27 *
28 * @author Rens Admiraal <r.admiraal@drecomm.nl>
29 * @package TYPO3
30 * @subpackage form
31 */
32 class tx_form_View_Mail_Plain_Element_Fileupload extends tx_form_View_Mail_Plain_Element_Container {
33
34 /**
35 * Constructor
36 *
37 * @param tx_form_Domain_Model_Element_Fileupload $model Model for this element
38 * @param integer $spaces
39 */
40 public function __construct(tx_form_Domain_Model_Element_Fileupload $model, $spaces) {
41 parent::__construct($model, $spaces);
42 }
43
44 /**
45 * @return string
46 */
47 public function render() {
48 $content = $this->getLabel() . ': ' . $this->getValue();
49
50 return str_repeat(chr(32), $this->spaces) . $content;
51 }
52
53 /**
54 * @return mixed
55 */
56 protected function getLabel() {
57 if ($this->model->additionalIsSet('label')) {
58 $label = $this->model->getAdditionalValue('label');
59 } else {
60 $label = $this->model->getAttributeValue('name');
61 }
62
63 return $label;
64 }
65
66 /**
67 * @return mixed
68 */
69 protected function getValue() {
70 $value = $this->model->getAttributeValue('value');
71
72 return $value;
73 }
74 }
75 ?>