TYPO3 CMS  TYPO3_6-2
FormUtility.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Form\Utility;
3 
23 
27  protected $formObjects = array();
28 
34  static public function getInstance() {
35  return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(__CLASS__);
36  }
37 
41  public function __construct() {
42  $this->setFormObjects(array(
43  'BUTTON',
44  'CHECKBOX',
45  'CHECKBOXGROUP',
46  'FIELDSET',
47  'FILEUPLOAD',
48  'FORM',
49  'FORM_INT',
50  'HEADER',
51  'HIDDEN',
52  'IMAGEBUTTON',
53  'OPTGROUP',
54  'OPTION',
55  'PASSWORD',
56  'RADIO',
57  'RADIOGROUP',
58  'RESET',
59  'SELECT',
60  'SUBMIT',
61  'TEXTAREA',
62  'TEXTBLOCK',
63  'TEXTLINE'
64  ));
65  }
66 
72  public function getFormObjects() {
73  return $this->formObjects;
74  }
75 
82  public function setFormObjects(array $formObjects) {
83  $this->formObjects = $formObjects;
84  }
85 
91  public function initializeFormObjects() {
92  // Assign new FORM objects
93  foreach ($this->getFormObjects() as $formObject) {
94  $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClass'][] = array(
95  $formObject,
96  'EXT:form/Classes/Controller/FormController.php:&TYPO3\\CMS\\Form\\Controller\\FormController'
97  );
98  }
99  return $this;
100  }
101 
107  public function initializePageTsConfig() {
108  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:form/Configuration/PageTS/modWizards.ts">');
109  return $this;
110  }
111 
120  public function getLastPartOfClassName($object, $lowercase = FALSE) {
121  $lastPart = preg_replace('/^.*\\\\([^\\\\]+?)(Additional|Attribute|Json|Element|View)+$/', '${1}', get_class($object), 1);
122  if ($lowercase) {
123  $lastPart = strtolower($lastPart);
124  }
125  return $lastPart;
126  }
127 
128 }
getLastPartOfClassName($object, $lowercase=FALSE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
setFormObjects(array $formObjects)
Definition: FormUtility.php:82