24 'int' =>
'renderIntegerField',
25 'int+' =>
'renderPositiveIntegerField',
26 'integer' =>
'renderIntegerField',
27 'color' =>
'renderColorPicker',
28 'wrap' =>
'renderWrapField',
29 'offset' =>
'renderOffsetField',
30 'options' =>
'renderOptionSelect',
31 'boolean' =>
'renderCheckbox',
32 'user' =>
'renderUserFunction',
33 'small' =>
'renderSmallTextField',
34 'string' =>
'renderTextField',
35 'input' =>
'renderTextField',
36 'default' =>
'renderTextField' 47 parent::initializeArguments();
59 public function render(\
TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $configuration) {
61 if (isset($this->viewHelperMapping[$configuration->getType()]) && method_exists($this, $this->viewHelperMapping[$configuration->getType()])) {
62 $input = $this->{$this->viewHelperMapping[$configuration->getType()]}($configuration);
64 $input = $this->{$this->viewHelperMapping[
'default']}($configuration);
77 $this->tag->setTagName(
'input');
78 $this->tag->addAttribute(
'type',
'text');
79 $this->tag->addAttribute(
'name', $this->
getName($configuration));
80 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
82 $pageRenderer = $doc->getPageRenderer();
83 $pageRenderer->addCssFile(
'sysext/extensionmanager/Resources/Public/Contrib/Farbtastic/farbtastic.css');
84 $pageRenderer->addJsFile(
'sysext/extensionmanager/Resources/Public/Contrib/Farbtastic/farbtastic.js');
85 $pageRenderer->addJsInlineCode(
'colorpicker',
' 86 jQuery(document).ready(function() { 87 jQuery(".colorPicker").farbtastic("#em-' . $configuration->getName() .
'"); 90 if ($configuration->getValue() !== NULL) {
91 $this->tag->addAttribute(
'value', $configuration->getValue());
93 return $this->tag->render() .
'<div class="colorPicker"></div>';
103 $this->tag->setTagName(
'input');
104 $this->tag->addAttribute(
'type',
'text');
105 $this->tag->addAttribute(
'name', $this->
getName($configuration));
106 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
107 $this->tag->addAttribute(
'class',
'offset');
108 if ($configuration->getValue() !== NULL) {
109 $this->tag->addAttribute(
'value', $configuration->getValue());
111 return $this->tag->render();
120 protected function renderWrapField(\
TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $configuration) {
121 $this->tag->setTagName(
'input');
122 $this->tag->addAttribute(
'type',
'text');
123 $this->tag->addAttribute(
'name', $this->
getName($configuration));
124 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
125 $this->tag->addAttribute(
'class',
'wrap');
126 if ($configuration->getValue() !== NULL) {
127 $this->tag->addAttribute(
'value', $configuration->getValue());
129 return $this->tag->render();
139 $this->tag->addAttribute(
'name', $this->
getName($configuration));
140 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
141 $this->tag->setTagName(
'select');
142 $optionValueArray = $configuration->getGeneric();
144 foreach ($optionValueArray as $label => $value) {
145 $output .=
'<option value="' . htmlspecialchars($value) .
'"';
146 if ($configuration->getValue() == $value) {
147 $output .=
' selected="selected"';
149 $output .=
'>' .
$GLOBALS[
'LANG']->sL($label, TRUE) .
'</option>';
151 $this->tag->setContent($output);
152 return $this->tag->render();
162 $this->tag->setTagName(
'input');
163 $this->tag->addAttribute(
'type',
'number');
164 $this->tag->addAttribute(
'min',
'0');
165 $this->tag->addAttribute(
'name', $this->
getName($configuration));
166 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
167 if ($configuration->getValue() !== NULL) {
168 $this->tag->addAttribute(
'value', $configuration->getValue());
170 return $this->tag->render();
180 $this->tag->setTagName(
'input');
181 $this->tag->addAttribute(
'type',
'number');
182 $this->tag->addAttribute(
'name', $this->
getName($configuration));
183 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
184 if ($configuration->getValue() !== NULL) {
185 $this->tag->addAttribute(
'value', $configuration->getValue());
187 return $this->tag->render();
196 protected function renderTextField(\
TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $configuration) {
197 $this->tag->setTagName(
'input');
198 $this->tag->addAttribute(
'type',
'text');
199 $this->tag->addAttribute(
'name', $this->
getName($configuration));
200 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
201 if ($configuration->getValue() !== NULL) {
202 $this->tag->addAttribute(
'value', $configuration->getValue());
204 return $this->tag->render();
214 $this->tag->addAttribute(
'class',
'small');
224 public function renderCheckbox(\
TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $configuration) {
225 $this->tag->addAttribute(
'type',
'checkbox');
226 $this->tag->addAttribute(
'name', $this->
getName($configuration));
227 $this->tag->addAttribute(
'value', 1);
228 $this->tag->addAttribute(
'id',
'em-' . $configuration->getName());
229 if ($configuration->getValue() == 1) {
230 $this->tag->addAttribute(
'checked',
'checked');
233 return $hiddenField . $this->tag->render();
243 $userFunction = $configuration->getGeneric();
244 $userFunctionParams = array(
245 'fieldName' => $this->
getName($configuration),
246 'fieldValue' => $configuration->getValue(),
247 'propertyName' => $configuration->getName()
249 return \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($userFunction, $userFunctionParams, $this,
'');
258 protected function getName(\
TYPO3\CMS\Extensionmanager\Domain\Model\ConfigurationItem $configuration) {
259 return 'tx_extensionmanager_tools_extensionmanagerextensionmanager[config][' . $configuration->getName() .
'][value]';
269 $hiddenFieldNames = array();
270 if ($this->viewHelperVariableContainer->exists(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper',
'renderedHiddenFields')) {
271 $hiddenFieldNames = $this->viewHelperVariableContainer->get(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper',
'renderedHiddenFields');
273 $fieldName = $this->
getName($configuration);
274 if (substr($fieldName, -2) ===
'[]') {
275 $fieldName = substr($fieldName, 0, -2);
277 if (!in_array($fieldName, $hiddenFieldNames)) {
278 $hiddenFieldNames[] = $fieldName;
279 $this->viewHelperVariableContainer->addOrUpdate(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\FormViewHelper',
'renderedHiddenFields', $hiddenFieldNames);
280 return '<input type="hidden" name="' . htmlspecialchars($fieldName) .
'" value="0" />';
291 if (!isset(
$GLOBALS[
'SOBE']->doc)) {
registerArgument($name, $type, $description, $required=FALSE, $defaultValue=NULL)
static makeInstance($className)
registerUniversalTagAttributes()
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]