[FEATURE] Make CSS for sysext form configurable
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / View / Form / Form.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2008 Patrick Broens (patrick@patrickbroens.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 * Main view layer for Forms.
27 *
28 * @author Patrick Broens <patrick@patrickbroens.nl>
29 * @package TYPO3
30 * @subpackage form
31 */
32 class tx_form_View_Form extends tx_form_View_Form_Element_Container {
33 /**
34 * @var string
35 */
36 protected $expectedModelName = 'tx_form_Domain_Model_Form';
37
38 /**
39 * Default layout of this object
40 *
41 * @var string
42 */
43 protected $layout = '
44 <form>
45 <containerWrap />
46 </form>';
47
48 /**
49 * Set the data for the FORM tag
50 *
51 * @param tx_form_Domain_Model_Form $formModel The model of the form
52 * @return void
53 */
54 public function setData(tx_form_Domain_Model_Form $model) {
55 $this->model = (object) $model;
56 }
57
58 /**
59 * Start the main DOMdocument for the form
60 * Return it as a string using saveXML() to get a proper formatted output
61 * (when using formatOutput :-)
62 *
63 * @return string XHTML string containing the whole form
64 */
65 public function get() {
66 $node = $this->render('element', FALSE);
67 $content = chr(10) . html_entity_decode($node->saveXML($node->firstChild), ENT_QUOTES, 'UTF-8') . chr(10);
68
69 return $content;
70 }
71 }
72 ?>