516 public $fieldTemplate =
'<strong>###FIELD_NAME###</strong><br />###FIELD_ITEM###<hr />';
727 if (!$this->RTEenabled) {
733 $this->defColorScheme = array(
734 $docTemplate->bgColor,
744 $this->defColorScheme = array();
751 $this->allowOverrideMatrix = array(
752 'input' => array(
'size',
'max',
'readOnly'),
753 'text' => array(
'cols',
'rows',
'wrap',
'readOnly'),
754 'check' => array(
'cols',
'showIfRTE',
'readOnly'),
755 'select' => array(
'size',
'autoSizeMax',
'maxitems',
'minitems',
'readOnly',
'treeConfig'),
756 'group' => array(
'size',
'autoSizeMax',
'max_size',
'show_thumbs',
'maxitems',
'minitems',
'disable_controls',
'readOnly'),
757 'inline' => array(
'appearance',
'behaviour',
'foreign_label',
'foreign_selector',
'foreign_unique',
'maxitems',
'minitems',
'size',
'autoSizeMax',
'symmetric_label',
'readOnly')
760 if (!isset(
$GLOBALS[
'ajaxID']) || strpos(
$GLOBALS[
'ajaxID'],
'TYPO3\\CMS\\Backend\\Form\\Element\\InlineElement::') !== 0) {
764 if (!isset(
$GLOBALS[
'ajaxID']) || strpos(
$GLOBALS[
'ajaxID'],
'TYPO3\\CMS\\Backend\\Form\\Element\\SuggestElement::') !== 0) {
768 $this->hookObjectsMainFields = array();
769 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms.php'][
'getMainFieldsClass'])) {
770 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms.php'][
'getMainFieldsClass'] as $classRef) {
774 $this->hookObjectsSingleField = array();
775 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms.php'][
'getSingleFieldClass'])) {
776 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms.php'][
'getSingleFieldClass'] as $classRef) {
780 $this->templateFile =
'sysext/backend/Resources/Private/Templates/FormEngine.html';
790 $this->prependFormFieldNames =
'data';
791 $this->formName =
'editform';
795 $this->
inline->init($this);
796 $this->suggest->init($this);
817 if (!isset(
$GLOBALS[
'TCA'][$table])) {
821 if (isset(
$GLOBALS[
'TCA'][$table][
'types'][$typeNum])) {
822 $itemList =
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'showitem'];
826 foreach ($fields as $fieldInfo) {
827 $parts = explode(
';', $fieldInfo);
828 $theField = trim($parts[0]);
829 if (!in_array($theField, $excludeElements) && (
string)$theField === (
string)$theFieldToReturn) {
830 if (
$GLOBALS[
'TCA'][$table][
'columns'][$theField]) {
831 $sField = $this->getSingleField($table, $theField, $row, $parts[1], 1, $parts[3], $parts[2]);
832 return $sField[
'ITEM'];
855 public function getMainFields($table, array $row, $depth = 0, array $overruleTypesArray = array()) {
856 $this->renderDepth = $depth;
858 $out_array = array(array());
859 $out_array_meta = array(
861 'title' => $this->
getLL(
'l_generalTab')
866 $this->palettesRendered = array();
869 foreach ($this->hookObjectsMainFields as $hookObj) {
870 if (method_exists($hookObj,
'getMainFields_preProcess')) {
871 $hookObj->getMainFields_preProcess($table, $row, $this);
874 $tabIdentString =
'';
875 $tabIdentStringMD5 =
'';
878 $dividers2tabs = &
$GLOBALS[
'TCA'][$table][
'ctrl'][
'dividers2tabs'];
886 if (
$GLOBALS[
'TCA'][$table][
'types'][$typeNum]) {
887 $itemList =
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'showitem'];
888 if (is_array($overruleTypesArray) && isset($overruleTypesArray[$typeNum][
'showitem'])) {
889 $itemList = $overruleTypesArray[$typeNum][
'showitem'];
895 if ($this->fieldOrder) {
902 if (strstr($itemList,
'--div--') !== FALSE && $this->enableTabMenu && $dividers2tabs) {
903 $tabIdentString =
'TCEforms:' . $table .
':' . $row[
'uid'];
906 if (isset($fields[0]) && strpos($fields[0],
'--div--') !== 0) {
912 foreach ($fields as $fieldInfo) {
914 $parts = explode(
';', $fieldInfo);
917 if ($color_style_parts[0] !==
'') {
920 if ($color_style_parts[1] !==
'') {
921 $this->fieldStyle =
$GLOBALS[
'TBE_STYLES'][
'styleschemes'][(int)$color_style_parts[1]];
922 if (!isset($this->fieldStyle)) {
923 $this->fieldStyle =
$GLOBALS[
'TBE_STYLES'][
'styleschemes'][0];
926 if ($color_style_parts[2] !==
'') {
927 $this->
wrapBorder($out_array[$out_sheet], $out_pointer);
928 $this->borderStyle =
$GLOBALS[
'TBE_STYLES'][
'borderschemes'][(int)$color_style_parts[2]];
929 if (!isset($this->borderStyle)) {
930 $this->borderStyle =
$GLOBALS[
'TBE_STYLES'][
'borderschemes'][0];
934 $theField = $parts[0];
935 if (!in_array($theField, $excludeElements)) {
936 if (
$GLOBALS[
'TCA'][$table][
'columns'][$theField]) {
938 if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
942 $sField = $this->getSingleField($table, $theField, $row, $parts[1], 0, $parts[3], $parts[2]);
944 $sField .= $sFieldPal;
946 $out_array[$out_sheet][$out_pointer] .= $sField;
947 } elseif ($theField ==
'--div--') {
949 $out_array[$out_sheet][$out_pointer] .= $this->
getDivider();
950 if ($this->enableTabMenu && $dividers2tabs) {
951 $this->
wrapBorder($out_array[$out_sheet], $out_pointer);
958 $out_array[$out_sheet] = array();
959 $out_array_meta[$out_sheet][
'title'] = $this->
sL($parts[1]);
961 $out_array_meta[$out_sheet][
'newline'] = $parts[2] ==
'newline';
965 $out_array_meta[$out_sheet][
'title'] = $this->
sL($parts[1]);
967 if ($tabIdentString && strpos($itemList,
'--div--', strlen($fieldInfo))) {
971 } elseif ($theField ==
'--palette--') {
972 if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
974 if (
$GLOBALS[
'TCA'][$table][
'palettes'][$parts[2]][
'canNotCollapse'] && $parts[1]) {
975 $out_array[$out_sheet][$out_pointer] .= $this->
getPaletteFields($table, $row, $parts[2], $this->
sL($parts[1]));
977 $out_array[$out_sheet][$out_pointer] .= $this->
getPaletteFields($table, $row, $parts[2],
'',
'', $this->
sL($parts[1]));
989 foreach ($this->hookObjectsMainFields as $hookObj) {
990 if (method_exists($hookObj,
'getMainFields_postProcess')) {
991 $hookObj->getMainFields_postProcess($table, $row, $this);
995 $this->
wrapBorder($out_array[$out_sheet], $out_pointer);
1001 if (count($mParr)) {
1002 foreach ($mParr as $mP) {
1003 if (!isset($this->palettesRendered[$this->renderDepth][$table][$mP])) {
1005 $this->palettesCollapsed = FALSE;
1006 $label = $i == 0 ? $this->
getLL(
'l_generalOptions') : $this->
getLL(
'l_generalOptions_more');
1007 $out_array[$out_sheet][$out_pointer] .= $this->
getPaletteFields($table, $row, $mP, $label);
1008 $this->palettesCollapsed = $temp_palettesCollapsed;
1011 $this->
wrapBorder($out_array[$out_sheet], $out_pointer);
1013 if ($this->renderDepth) {
1014 $this->renderDepth--;
1020 if ($out_sheet > 0) {
1023 foreach ($out_array as $idx => $sheetContent) {
1024 $content = implode(
'', $sheetContent);
1027 $content =
'<table border="0" cellspacing="0" cellpadding="0" width="100%">' . $content .
'</table>';
1029 $parts[$idx] = array(
1030 'label' => $out_array_meta[$idx][
'title'],
1031 'content' => $content,
1032 'newline' => $out_array_meta[$idx][
'newline']
1035 if (count($parts) > 1) {
1038 $dividersToTabsBehaviour = isset(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'dividers2tabs']) ?
$GLOBALS[
'TCA'][$table][
'ctrl'][
'dividers2tabs'] : 1;
1039 $output = $this->
getDynTabMenu($parts, $tabIdentString, $dividersToTabsBehaviour);
1042 $output = isset($parts[0]) ? trim($parts[0][
'content']) :
'';
1052 $output = implode(
'', $out_array[$out_sheet]);
1053 $output =
'<div class="typo3-dyntabmenu-divs">' . $output .
'</div>';
1077 foreach ($editFieldList as $theFieldC) {
1078 list($theField, $palFields) = preg_split(
'/\\[|\\]/', $theFieldC);
1079 $theField = trim($theField);
1080 $palFields = trim($palFields);
1081 if (
$GLOBALS[
'TCA'][$table][
'columns'][$theField]) {
1084 $sField = $this->getSingleField($table, $theField, $row, $parts[1], 0, $parts[3], 0);
1086 } elseif ($theField ==
'--div--') {
1108 public function getPaletteFields($table, $row, $palette, $header =
'', $itemList =
'', $collapsedHeader = NULL) {
1109 if (!$this->doPrintPalette) {
1115 if (count($parts)) {
1117 foreach ($parts as $part) {
1118 if ($part[
'NAME'] !==
'--linebreak--') {
1122 if ($realFields > 0) {
1124 $out .= $this->
intoTemplate(array(
'HEADER' => htmlspecialchars($header)), $this->palFieldTemplateHeader);
1128 $isHiddenPalette = !empty(
$GLOBALS[
'TCA'][$table][
'palettes'][$palette][
'isHiddenPalette']);
1130 if ($collapsed && $collapsedHeader !== NULL && !$isHiddenPalette) {
1132 $thePalIcon =
'<span style="margin-left: 20px;">' . $thePalIcon . $collapsedHeader .
'</span>';
1135 $out .= $this->
intoTemplate(array(
'PALETTE' => $thePalIcon . $paletteHtml), $this->palFieldTemplate);
1154 public function getSingleField($table, $field, $row, $altName =
'', $palette = FALSE, $extra =
'', $pal = 0) {
1156 foreach ($this->hookObjectsSingleField as $hookObj) {
1157 if (method_exists($hookObj,
'getSingleField_preProcess')) {
1158 $hookObj->getSingleField_preProcess($table, $field, $row, $altName, $palette, $extra, $pal, $this);
1163 $PA[
'altName'] = $altName;
1164 $PA[
'palette'] = $palette;
1165 $PA[
'extra'] = $extra;
1168 $PA[
'fieldConf'] =
$GLOBALS[
'TCA'][$table][
'columns'][$field];
1169 $PA[
'fieldConf'][
'config'][
'form_type'] = $PA[
'fieldConf'][
'config'][
'form_type'] ?: $PA[
'fieldConf'][
'config'][
'type'];
1172 $skipThisField = $this->
inline->skipField($table, $field, $row, $PA[
'fieldConf'][
'config']);
1175 $displayConditionResult = TRUE;
1176 if (is_array($PA[
'fieldConf']) && $PA[
'fieldConf'][
'displayCond'] && is_array($row)) {
1179 $displayConditionResult = $elementConditionMatcher->match($PA[
'fieldConf'][
'displayCond'], $row);
1183 is_array($PA[
'fieldConf'])
1186 && $PA[
'fieldConf'][
'config'][
'form_type'] !=
'passthrough' 1187 && ($this->RTEenabled || !$PA[
'fieldConf'][
'config'][
'showIfRTE'])
1188 && $displayConditionResult
1189 && (!
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] || $PA[
'fieldConf'][
'l10n_display'] || ($PA[
'fieldConf'][
'l10n_mode'] !==
'exclude') || $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] <= 0)
1190 && (!
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] || !$this->localizationMode || $this->localizationMode === $PA[
'fieldConf'][
'l10n_cat'])
1193 $PA[
'fieldTSConfig'] = $this->
setTSconfig($table, $row, $field);
1195 if (!$PA[
'fieldTSConfig'][
'disabled']) {
1197 $PA[
'fieldConf'][
'config'] = $this->
overrideFieldConf($PA[
'fieldConf'][
'config'], $PA[
'fieldTSConfig']);
1199 $PA[
'itemFormElName'] = $this->prependFormFieldNames .
'[' . $table .
'][' . $row[
'uid'] .
'][' . $field .
']';
1201 $PA[
'itemFormElName_file'] = $this->prependFormFieldNames_file .
'[' . $table .
'][' . $row[
'uid'] .
'][' . $field .
']';
1204 $PA[
'itemFormElNameActive'] = $this->prependFormFieldNamesActive .
'[' . $table .
'][' . $row[
'uid'] .
'][' . $field .
']';
1206 $PA[
'itemFormElValue'] = $row[$field];
1207 $PA[
'itemFormElID'] = $this->prependFormFieldNames .
'_' . $table .
'_' . $row[
'uid'] .
'_' . $field;
1209 if ($PA[
'fieldConf'][
'l10n_display'] &&
GeneralUtility::inList($PA[
'fieldConf'][
'l10n_display'],
'defaultAsReadonly') && $row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] > 0) {
1210 $PA[
'fieldConf'][
'config'][
'readOnly'] = TRUE;
1211 $PA[
'itemFormElValue'] = $this->defaultLanguageData[$table .
':' . $row[
'uid']][$field];
1213 if (strpos(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'],
':') === FALSE) {
1214 $typeField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'];
1216 $typeField = substr(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'], 0, strpos(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'],
':'));
1220 !empty(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'])
1221 && $field === $typeField
1222 || !empty(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'requestUpdate'])
1226 $alertMsgOnChange =
'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
1228 $alertMsgOnChange =
'if (TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
1231 $alertMsgOnChange =
'';
1234 if (in_array($field, $this->hiddenFieldListArr)) {
1235 $this->hiddenFieldAccum[] =
'<input type="hidden" name="' . $PA[
'itemFormElName'] .
'" value="' . htmlspecialchars($PA[
'itemFormElValue']) .
'" />';
1241 if (!$PA[
'palette']) {
1243 if ($PA[
'pal'] && $this->
isPalettesCollapsed($table, $PA[
'pal']) && count($paletteFields)) {
1248 $PA[
'onFocus'] = $palJSfunc && !$this->
getBackendUserAuthentication()->uc[
'dontShowPalettesOnFocusInAB'] ?
' onfocus="' . htmlspecialchars($palJSfunc) .
'"' :
'';
1249 $PA[
'label'] = $PA[
'altName'] ?: $PA[
'fieldConf'][
'label'];
1250 $PA[
'label'] = $PA[
'fieldTSConfig'][
'label'] ?: $PA[
'label'];
1251 $PA[
'label'] = $PA[
'fieldTSConfig'][
'label.'][$this->
getLanguageService()->lang] ?: $PA[
'label'];
1252 $PA[
'label'] = $this->
sL($PA[
'label']);
1254 $PA[
'fieldChangeFunc'] = array();
1255 $PA[
'fieldChangeFunc'][
'TBE_EDITOR_fieldChanged'] =
'TBE_EDITOR.fieldChanged(\'' . $table .
'\',\
'' . $row[
'uid'] .
'\',\
'' . $field .
'\',\
'' . $PA[
'itemFormElName'] .
'\');
'; 1256 $PA['fieldChangeFunc
']['alert
'] = $alertMsgOnChange; 1257 // If this is the child of an inline type and it is the field creating the label 1258 if ($this->inline->isInlineChildAndLabelField($table, $field)) { 1259 $inlineObjectId = implode(InlineElement::Structure_Separator, array( 1260 $this->inline->inlineNames['object'], 1264 $PA['fieldChangeFunc
']['inline'] = 'inline.handleChangedField(\
'' . $PA[
'itemFormElName'] .
'\',\
'' . $inlineObjectId .
'\');
'; 1266 // Based on the type of the item, call a render function: 1267 $item = $this->getSingleField_SW($table, $field, $row, $PA); 1268 // Add language + diff 1269 if ($PA['fieldConf
']['l10n_display
'] && (GeneralUtility::inList($PA['fieldConf
']['l10n_display
'], 'hideDiff
') || GeneralUtility::inList($PA['fieldConf
']['l10n_display
'], 'defaultAsReadonly
'))) { 1270 $renderLanguageDiff = FALSE; 1272 $renderLanguageDiff = TRUE; 1274 if ($renderLanguageDiff) { 1275 $item = $this->renderDefaultLanguageContent($table, $field, $row, $item); 1276 $item = $this->renderDefaultLanguageDiff($table, $field, $row, $item); 1278 // If the record has been saved and the "linkTitleToSelf" is set, we make the field name into a link, which will load ONLY this field in alt_doc.php 1279 $label = htmlspecialchars($PA['label
'], ENT_COMPAT, 'UTF-8
', FALSE); 1280 if (MathUtility::canBeInterpretedAsInteger($row['uid
']) && $PA['fieldTSConfig
']['linkTitleToSelf
'] && !GeneralUtility::_GP('columnsOnly
')) { 1281 $lTTS_url = $this->backPath . 'alt_doc.php?edit[
' . $table . '][
' . $row['uid
'] . ']=edit&columnsOnly=
' . $field . '&returnUrl=
' . rawurlencode($this->thisReturnUrl()); 1282 $label = '<a href=
"' . htmlspecialchars($lTTS_url) . '">
' . $label . '</a>
'; 1285 if (isset($PA['fieldConf
']['config
']['mode
']) && $PA['fieldConf
']['config
']['mode
'] == 'useOrOverridePlaceholder
') { 1286 $placeholder = $this->getPlaceholderValue($table, $field, $PA['fieldConf
']['config
'], $row); 1287 $onChange = 'typo3form.fieldTogglePlaceholder(
' . GeneralUtility::quoteJSvalue($PA['itemFormElName
']) . ', !this.checked)
'; 1288 $checked = $PA['itemFormElValue
'] === NULL ? '' : ' checked=
"checked"'; 1290 $this->additionalJS_post[] = 'typo3form.fieldTogglePlaceholder(
' 1291 . GeneralUtility::quoteJSvalue($PA['itemFormElName
']) . ',
' . ($checked ? 'false' : 'true') . ');
'; 1293 $item = '<div
class=
"t3-form-field-placeholder-override">
' 1294 . '<span
class=
"t3-tceforms-placeholder-override-checkbox">
' . 1295 '<input type=
"hidden" name=
"' . htmlspecialchars($PA['itemFormElNameActive']) . '" value=
"0" />
' . 1296 '<input type=
"checkbox" name=
"' . htmlspecialchars($PA['itemFormElNameActive']) . '" value=
"1" id=
"tce-forms-textfield-use-override-' . $field . '-' . $row['uid'] . '" onchange=
"' . htmlspecialchars($onChange) . '"' . $checked . ' />
' . 1297 '<label
for=
"tce-forms-textfield-use-override-' . $field . '-' . $row['uid'] . '">
' . 1298 sprintf($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.placeholder.override
'), 1299 BackendUtility::getRecordTitlePrep($placeholder, 20)) . '</label>
' . 1301 . '<div
class=
"t3-form-placeholder-placeholder">
' . $this->getSingleField_typeNone_render( 1302 $PA['fieldConf
']['config
'], GeneralUtility::fixed_lgd_cs($placeholder, 30) 1304 . '<div
class=
"t3-form-placeholder-formfield">
' . $item . '</div>
' 1308 // Wrap the label with help text 1309 $PA['label
'] = ($label = BackendUtility::wrapInHelp($table, $field, $label)); 1310 // Create output value: 1311 if ($PA['fieldConf
']['config
']['form_type
'] == 'user
' && $PA['fieldConf
']['config
']['noTableWrapping
']) { 1313 } elseif ($PA['palette
']) { 1317 'ID
' => $row['uid
'], 1321 'ITEM_DISABLED
' => ($this->isDisabledNullValueField($table, $field, $row, $PA) ? ' disabled
' : ''), 1322 'ITEM_NULLVALUE
' => $this->renderNullValueWidget($table, $field, $row, $PA), 1324 $out = $this->addUserTemplateMarkers($out, $table, $field, $row, $PA); 1331 'ID
' => $row['uid
'], 1332 'PAL_LINK_ICON
' => $thePalIcon, 1334 'ITEM_DISABLED
' => ($this->isDisabledNullValueField($table, $field, $row, $PA) ? ' disabled
' : ''), 1335 'ITEM_NULLVALUE
' => $this->renderNullValueWidget($table, $field, $row, $PA), 1337 $out = $this->addUserTemplateMarkers($out, $table, $field, $row, $PA); 1339 $out = $this->intoTemplate($out); 1343 $this->commentMessages[] = $this->prependFormFieldNames . '[
' . $table . '][
' . $row['uid
'] . '][
' . $field . ']: Disabled by TSconfig
'; 1346 // Hook: getSingleField_postProcess 1347 foreach ($this->hookObjectsSingleField as $hookObj) { 1348 if (method_exists($hookObj, 'getSingleField_postProcess
')) { 1349 $hookObj->getSingleField_postProcess($table, $field, $row, $out, $PA, $this); 1352 // Return value (string or array) 1368 public function getSingleField_SW($table, $field, $row, &$PA) { 1369 $PA['fieldConf
']['config
']['form_type
'] = $PA['fieldConf
']['config
']['form_type
'] ?: $PA['fieldConf
']['config
']['type
']; 1370 // Using "form_type" locally in this script 1371 // Hook: getSingleField_beforeRender 1372 foreach ($this->hookObjectsSingleField as $hookObject) { 1373 if (method_exists($hookObject, 'getSingleField_beforeRender
')) { 1374 $hookObject->getSingleField_beforeRender($table, $field, $row, $PA); 1377 switch ($PA['fieldConf
']['config
']['form_type
']) { 1379 $item = $this->getSingleField_typeInput($table, $field, $row, $PA); 1382 $item = $this->getSingleField_typeText($table, $field, $row, $PA); 1385 $item = $this->getSingleField_typeCheck($table, $field, $row, $PA); 1388 $item = $this->getSingleField_typeRadio($table, $field, $row, $PA); 1391 $item = $this->getSingleField_typeSelect($table, $field, $row, $PA); 1394 $item = $this->getSingleField_typeGroup($table, $field, $row, $PA); 1397 $item = $this->inline->getSingleField_typeInline($table, $field, $row, $PA); 1400 $item = $this->getSingleField_typeNone($table, $field, $row, $PA); 1403 $item = $this->getSingleField_typeUser($table, $field, $row, $PA); 1406 $item = $this->getSingleField_typeFlex($table, $field, $row, $PA); 1409 $item = $this->getSingleField_typeUnknown($table, $field, $row, $PA); 1414 /********************************************************** 1416 * Rendering of each TCEform field type 1418 ************************************************************/ 1430 public function getSingleField_typeInput($table, $field, $row, &$PA) { 1431 $config = $PA['fieldConf
']['config
']; 1432 $specConf = $this->getSpecConfFromString($PA['extra
'], $PA['fieldConf
']['defaultExtras
']); 1433 $size = MathUtility::forceIntegerInRange($config['size
'] ? $config['size
'] : 30, 5, $this->maxInputWidth); 1434 $evalList = GeneralUtility::trimExplode(',
', $config['eval
'], TRUE); 1435 $classAndStyleAttributes = $this->formWidthAsArray($size); 1436 $fieldAppendix = ''; 1438 $cssClasses = array($classAndStyleAttributes['class']); 1439 $cssStyle = $classAndStyleAttributes['style
']; 1440 if (!isset($config['checkbox
'])) { 1441 $config['checkbox
'] = '0
'; 1442 $checkboxIsset = FALSE; 1444 $checkboxIsset = TRUE; 1446 if (in_array('date
', $evalList) || in_array('datetime
', $evalList)) { 1447 if (in_array('datetime
', $evalList)) { 1448 $class = 'datetime
'; 1453 if (isset($config['range
']['lower
'])) { 1454 $dateRange .= ' lower-
' . (int)$config['range
']['lower
']; 1456 if (isset($config['range
']['upper
'])) { 1457 $dateRange .= ' upper-
' . (int)$config['range
']['upper
']; 1459 $inputId = uniqid('tceforms-
' . $class . 'field-
', TRUE); 1460 $cssClasses[] = 'tceforms-textfield tceforms-
' . $class . 'field
' . $dateRange; 1461 $fieldAppendix = IconUtility::getSpriteIcon('actions-edit-pick-date
', array( 1462 'style
' => 'cursor:pointer;
', 1463 'id' => 'picker-
' . $inputId 1465 } elseif (in_array('timesec
', $evalList)) { 1466 $inputId = uniqid('tceforms-timesecfield-
', TRUE); 1467 $cssClasses[] = 'tceforms-textfield tceforms-timesecfield
'; 1468 } elseif (in_array('year
', $evalList)) { 1469 $inputId = uniqid('tceforms-yearfield-
', TRUE); 1470 $cssClasses[] = 'tceforms-textfield tceforms-yearfield
'; 1471 } elseif (in_array('time
', $evalList)) { 1472 $inputId = uniqid('tceforms-timefield-
', TRUE); 1473 $cssClasses[] = 'tceforms-textfield tceforms-timefield
'; 1474 } elseif (in_array('int', $evalList)) { 1475 $inputId = uniqid('tceforms-intfield-
', TRUE); 1476 $cssClasses[] = 'tceforms-textfield tceforms-intfield
'; 1477 } elseif (in_array('double2
', $evalList)) { 1478 $inputId = uniqid('tceforms-double2field-
', TRUE); 1479 $cssClasses[] = 'tceforms-textfield tceforms-double2field
'; 1481 $inputId = uniqid('tceforms-textfield-
', TRUE); 1482 $cssClasses[] = 'tceforms-textfield
'; 1483 if ($checkboxIsset === FALSE) { 1484 $config['checkbox
'] = ''; 1487 if (isset($config['wizards
']['link
'])) { 1488 $inputId = uniqid('tceforms-linkfield-
', TRUE); 1489 $cssClasses[] = 'tceforms-textfield tceforms-linkfield
'; 1490 } elseif (isset($config['wizards
']['color
'])) { 1491 $inputId = uniqid('tceforms-colorfield-
', TRUE); 1492 $cssClasses[] = 'tceforms-textfield tceforms-colorfield
'; 1494 $inputId = str_replace('.
', '', $inputId); 1495 if ($this->renderReadonly || $config['readOnly
']) { 1496 $itemFormElValue = $PA['itemFormElValue
']; 1497 if (in_array('date
', $evalList)) { 1498 $config['format
'] = 'date
'; 1499 } elseif (in_array('datetime
', $evalList)) { 1500 $config['format
'] = 'datetime
'; 1501 } elseif (in_array('time
', $evalList)) { 1502 $config['format
'] = 'time
'; 1504 if (in_array('password
', $evalList)) { 1505 $itemFormElValue = $itemFormElValue ? '*********
' : ''; 1507 return $this->getSingleField_typeNone_render($config, $itemFormElValue); 1509 foreach ($evalList as $func) { 1512 $this->registerRequiredProperty('field
', $table . '_
' . $row['uid
'] . '_
' . $field, $PA['itemFormElName
']); 1513 // Mark this field for date/time disposal: 1514 if (array_intersect($evalList, array('date
', 'datetime
', 'time
'))) { 1515 $this->requiredAdditional[$PA['itemFormElName
']]['isPositiveNumber
'] = TRUE; 1519 // Pair hook to the one in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_input_Eval() 1520 $evalObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['tce
']['formevals
'][$func] . ':&
' . $func); 1521 if (is_object($evalObj) && method_exists($evalObj, 'deevaluateFieldValue
')) { 1523 'value
' => $PA['itemFormElValue
'] 1525 $PA['itemFormElValue
'] = $evalObj->deevaluateFieldValue($_params); 1529 $paramsList = '\
'' . $PA[
'itemFormElName'] .
'\',\
'' . implode(
',', $evalList) .
'\',\
'' . trim($config[
'is_in']) .
'\',
' . ($checkboxIsset ? 1 : 0) . ',\
'' . $config[
'checkbox'] .
'\'';
1530 if (in_array(
'date', $evalList) || in_array(
'datetime', $evalList)) {
1531 $item .=
'<span class="t3-tceforms-input-wrapper-datetime" onmouseOver="if (document.getElementById(\'' . $inputId .
'\').value) {this.className=\
't3-tceforms-input-wrapper-datetime-hover\';} else {this.className=\'t3-tceforms-input-wrapper-datetime\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper-datetime\';">';
1533 if ($PA[
'itemFormElValue'] > 0) {
1534 $PA[
'itemFormElValue'] += date(
'Z', $PA[
'itemFormElValue']);
1537 $item .=
'<span class="t3-tceforms-input-wrapper" onmouseOver="if (document.getElementById(\'' . $inputId .
'\').value) {this.className=\
't3-tceforms-input-wrapper-hover\';} else {this.className=\'t3-tceforms-input-wrapper\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper\';">';
1539 $PA[
'fieldChangeFunc'] = array_merge(array(
'typo3form.fieldGet' =>
'typo3form.fieldGet(' . $paramsList .
');'), $PA[
'fieldChangeFunc']);
1541 if (isset($config[
'checkbox'])) {
1542 $item .=
IconUtility::getSpriteIcon(
'actions-input-clear', array(
'tag' =>
'a',
'class' =>
't3-tceforms-input-clearer',
'onclick' =>
'document.getElementById(\'' . $inputId .
'\').value=\
'\';document.getElementById(\
'' . $inputId .
'\').focus();
' . implode('', $PA['fieldChangeFunc
']))); 1544 $mLgd = $config['max
'] ?: 256; 1545 $iOnChange = implode('', $PA['fieldChangeFunc
']); 1546 $cssClasses[] = 'hasDefaultValue
'; 1547 $item .= '<input type=
"text" ' . $this->getPlaceholderAttribute($table, $field, $config, $row) . 'id=
"' . $inputId . '" ' . 'class=
"' . implode(' ', $cssClasses) . '" ' . 'name=
"' . $PA['itemFormElName'] . '_hr" ' . 'value=
""' . 'style=
"' . $cssStyle . '" ' . 'maxlength=
"' . $mLgd . '" ' . 'onchange=
"' . htmlspecialchars($iOnChange) . '"' . $PA['onFocus
'] . ' />
'; 1548 // This is the EDITABLE form field. 1549 $item .= '<input type=
"hidden" name=
"' . $PA['itemFormElName'] . '" value=
"' . htmlspecialchars($PA['itemFormElValue']) . '" />
'; 1550 // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database. 1551 $item .= $fieldAppendix . '</span><div style=
"clear:both;"></div>
'; 1552 $this->extJSCODE .= 'typo3form.fieldSet(
' . $paramsList . ');
'; 1553 // Going through all custom evaluations configured for this field 1554 foreach ($evalList as $evalData) { 1555 $evalObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['tce
']['formevals
'][$evalData] . ':&
' . $evalData); 1556 if (is_object($evalObj) && method_exists($evalObj, 'returnFieldJS
')) { 1557 $this->extJSCODE .= ' 1558 TBE_EDITOR.customEvalFunctions[\
'' . $evalData .
'\'] =
function(value) {
1559 ' . $evalObj->returnFieldJS() . ' 1564 // Creating an alternative item without the JavaScript handlers. 1565 $altItem = '<input type=
"hidden" name=
"' . $PA['itemFormElName'] . '_hr" value=
"" />
'; 1566 $altItem .= '<input type=
"hidden" name=
"' . $PA['itemFormElName'] . '" value=
"' . htmlspecialchars($PA['itemFormElValue']) . '" />
'; 1567 // Wrap a wizard around the item? 1568 $item = $this->renderWizards(array($item, $altItem), $config['wizards
'], $table, $row, $field, $PA, $PA['itemFormElName
'] . '_hr
', $specConf); 1583 protected function renderNullValueWidget($table, $field, array $row, array $PA) { 1586 $config = $PA['fieldConf
']['config
']; 1588 !empty($config['eval
']) && GeneralUtility::inList($config['eval
'], 'null
') 1589 && (empty($config['mode
']) || $config['mode
'] !== 'useOrOverridePlaceholder
') 1591 $checked = $PA['itemFormElValue
'] === NULL ? '' : ' checked=
"checked"'; 1592 $onChange = htmlspecialchars( 1593 'typo3form.fieldSetNull(\
'' . $PA[
'itemFormElName'] .
'\', !this.checked)
' 1596 $widget = '<span
class=
"t3-tceforms-widget-null-wrapper">
' . 1597 '<input type=
"hidden" name=
"' . $PA['itemFormElNameActive'] . '" value=
"0" />
' . 1598 '<input type=
"checkbox" name=
"' . $PA['itemFormElNameActive'] . '" value=
"1" onchange=
"' . $onChange . '"' . $checked . ' />
' . 1615 protected function isDisabledNullValueField($table, $field, array $row, array $PA) { 1618 $config = $PA['fieldConf
']['config
']; 1619 if ($PA['itemFormElValue
'] === NULL && !empty($config['eval
']) 1620 && GeneralUtility::inList($config['eval
'], 'null
') 1621 && (empty($config['mode
']) || $config['mode
'] !== 'useOrOverridePlaceholder
')) { 1640 public function getSingleField_typeText($table, $field, $row, &$PA) { 1642 $config = $PA['fieldConf
']['config
']; 1643 $evalList = GeneralUtility::trimExplode(',
', $config['eval
'], TRUE); 1644 if ($this->renderReadonly || $config['readOnly
']) { 1645 return $this->getSingleField_typeNone_render($config, $PA['itemFormElValue
']); 1647 // Setting columns number: 1648 $cols = MathUtility::forceIntegerInRange($config['cols
'] ? $config['cols
'] : 30, 5, $this->maxTextareaWidth); 1649 // Setting number of rows: 1650 $origRows = ($rows = MathUtility::forceIntegerInRange($config['rows
'] ? $config['rows
'] : 5, 1, 20)); 1651 if (strlen($PA['itemFormElValue
']) > $this->charsPerRow * 2) { 1652 $cols = $this->maxTextareaWidth; 1653 $rows = MathUtility::forceIntegerInRange(round(strlen($PA['itemFormElValue
']) / $this->charsPerRow), count(explode(LF, $PA['itemFormElValue
'])), 20); 1654 if ($rows < $origRows) { 1658 if (in_array('required
', $evalList)) { 1659 $this->requiredFields[$table . '_
' . $row['uid
'] . '_
' . $field] = $PA['itemFormElName
']; 1662 // Set TRUE, if the RTE is loaded; If not a normal textarea is shown. 1664 // Set TRUE, if the RTE would have been loaded if it wasn't
for the disable-RTE flag in the bottom of the page...
1665 $RTEwouldHaveBeenLoaded = 0;
1669 $altItem =
'<input type="hidden" name="' . htmlspecialchars($PA[
'itemFormElName']) .
'" value="' . htmlspecialchars($PA[
'itemFormElValue']) .
'" />';
1672 if ($this->RTEenabled) {
1675 if (isset($specConf[
'richtext']) && (!$p[
'flag'] || !$row[$p[
'flag']])) {
1677 list($tscPID, $thePidValue) = $this->
getTSCpid($table, $row[
'uid'], $row[
'pid']);
1679 if ($thePidValue >= 0) {
1683 if (!$thisConfig[
'disabled']) {
1684 if (!$this->disableRTE) {
1685 $this->RTEcounter++;
1688 $RTErelPath = is_array($eFile) ? dirname($eFile[
'relEditFile']) :
'';
1691 $item = $RTEobj->drawRTE($this, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue);
1693 $item = $this->
renderWizards(array($item, $altItem), $config[
'wizards'], $table, $row, $field, $PA, $PA[
'itemFormElName'], $specConf, 1);
1696 $RTEwouldHaveBeenLoaded = 1;
1697 $this->commentMessages[] = $PA[
'itemFormElName'] .
': RTE is disabled by the on-page RTE-flag (probably you can enable it by the check-box in the bottom of this page!)';
1700 $this->commentMessages[] = $PA[
'itemFormElName'] .
': RTE is disabled by the Page TSconfig, "RTE"-key (eg. by RTE.default.disabled=0 or such)';
1703 $this->commentMessages[] = $PA[
'itemFormElName'] .
': PID value could NOT be fetched. Rare error, normally with new records.';
1706 if (!isset($specConf[
'richtext'])) {
1707 $this->commentMessages[] = $PA[
'itemFormElName'] .
': RTE was not configured for this field in TCA-types';
1709 if (!(!$p[
'flag'] || !$row[$p[
'flag']])) {
1710 $this->commentMessages[] = $PA[
'itemFormElName'] .
': Field-flag (' . $PA[
'flag'] .
') has been set to disable RTE!';
1715 if (!$RTEwasLoaded) {
1717 if ($specConf[
'rte_only']) {
1718 $item =
'<p><em>' . htmlspecialchars($this->
getLL(
'l_noRTEfound')) .
'</em></p>';
1720 if ($specConf[
'nowrap']) {
1723 $wrap = $config[
'wrap'] ?:
'virtual';
1726 if ($specConf[
'fixed-font']) {
1727 $classes[] =
'fixed-font';
1729 if ($specConf[
'enable-tab']) {
1730 $classes[] =
'enable-tab';
1735 if (preg_match(
'/ class="(.+?)"/', $formWidthText, $res)) {
1736 $formWidthText = str_replace(
' class="' . $res[1] .
'"',
'', $formWidthText);
1737 $classes = array_merge($classes, explode(
' ', $res[1]));
1739 if (count($classes)) {
1740 $class =
' class="tceforms-textarea ' . implode(
' ', $classes) .
'"';
1742 $class =
'tceforms-textarea';
1745 foreach ($evalList as $func) {
1754 if (is_object($evalObj) && method_exists($evalObj,
'deevaluateFieldValue')) {
1756 'value' => $PA[
'itemFormElValue']
1758 $PA[
'itemFormElValue'] = $evalObj->deevaluateFieldValue($_params);
1762 $iOnChange = implode(
'', $PA[
'fieldChangeFunc']);
1764 <textarea ' .
'id="' . str_replace(
'.',
'', uniqid(
'tceforms-textarea-', TRUE)) .
'" ' .
'name="' . $PA[
'itemFormElName']
1765 .
'"' . $formWidthText . $class .
' ' .
'rows="' . $rows .
'" ' .
'wrap="' . $wrap .
'" ' .
'onchange="' 1768 $item = $this->
renderWizards(array($item, $altItem), $config[
'wizards'], $table, $row, $field, $PA,
1769 $PA[
'itemFormElName'], $specConf, $RTEwouldHaveBeenLoaded);
1788 $config = $PA[
'fieldConf'][
'config'];
1791 if ($this->renderReadonly || $config[
'readOnly']) {
1792 $disabled =
' disabled="disabled"';
1796 if ($config[
'itemsProcFunc']) {
1797 $selItems = $this->procItems($selItems, $PA[
'fieldTSConfig'][
'itemsProcFunc.'], $config, $table, $row, $field);
1799 if (!count($selItems)) {
1800 $selItems[] = array(
'',
'');
1802 $thisValue = (int)$PA[
'itemFormElValue'];
1803 $cols = (int)$config[
'cols'];
1804 $selItemsCount = count($selItems);
1806 $item .=
'<table border="0" cellspacing="0" cellpadding="0" class="typo3-TCEforms-checkboxArray">';
1807 for ($c = 0; $c < $selItemsCount; $c++) {
1809 if (!($c % $cols)) {
1812 $cBP = $this->
checkBoxParams($PA[
'itemFormElName'], $thisValue, $c, count($selItems), implode(
'', $PA[
'fieldChangeFunc']));
1813 $cBName = $PA[
'itemFormElName'] .
'_' . $c;
1814 $cBID = $PA[
'itemFormElID'] .
'_' . $c;
1815 $item .=
'<td nowrap="nowrap">' .
'<input type="checkbox"' . $this->
insertDefStyle(
'check')
1816 .
' value="1" name="' . $cBName .
'"' . $cBP . $disabled .
' id="' . $cBID .
'" />' 1817 . $this->
wrapLabels((
'<label for="' . $cBID .
'">' . htmlspecialchars($p[0]) .
'</label> '))
1819 if ($c % $cols + 1 == $cols) {
1824 $rest = $cols - $c % $cols;
1825 for ($c = 0; $c < $rest; $c++) {
1826 $item .=
'<td></td>';
1832 $item .=
'</table>';
1834 for ($c = 0; $c < $selItemsCount; $c++) {
1836 $cBP = $this->
checkBoxParams($PA[
'itemFormElName'], $thisValue, $c, count($selItems), implode(
'', $PA[
'fieldChangeFunc']));
1837 $cBName = $PA[
'itemFormElName'] .
'_' . $c;
1838 $cBID = $PA[
'itemFormElID'] .
'_' . $c;
1839 $item .= ($c > 0 ?
'<br />' :
'') .
'<input type="checkbox"' . $this->
insertDefStyle(
'check')
1840 .
' value="1" name="' . $cBName .
'"' . $cBP . $PA[
'onFocus'] . $disabled .
' id="' . $cBID .
'" />' 1841 . $this->
wrapLabels(
'<label for="' . $cBID .
'">' . htmlspecialchars($p[0]) .
'</label>');
1845 $item .=
'<input type="hidden" name="' . $PA[
'itemFormElName'] .
'" value="' . htmlspecialchars($thisValue) .
'" />';
1862 $config = $PA[
'fieldConf'][
'config'];
1865 if ($this->renderReadonly || $config[
'readOnly']) {
1866 $disabled =
' disabled="disabled"';
1870 if ($config[
'itemsProcFunc']) {
1871 $selItems = $this->procItems($selItems, $PA[
'fieldTSConfig'][
'itemsProcFunc.'], $config, $table, $row, $field);
1874 $selItemsCount = count($selItems);
1875 for ($c = 0; $c < $selItemsCount; $c++) {
1877 $rID = $PA[
'itemFormElID'] .
'_' . $c;
1878 $rOnClick = implode(
'', $PA[
'fieldChangeFunc']);
1879 $rChecked = (string)$p[1] === (
string)$PA[
'itemFormElValue'] ?
' checked="checked"' :
'';
1880 $item .=
'<input type="radio"' . $this->
insertDefStyle(
'radio') .
' name="' . $PA[
'itemFormElName']
1881 .
'" value="' . htmlspecialchars($p[1]) .
'" onclick="' . htmlspecialchars($rOnClick) .
'"' . $rChecked
1882 . $PA[
'onFocus'] . $disabled .
' id="' . $rID .
'" /> 1883 <label for="' . $rID .
'">' . htmlspecialchars($p[0]) .
'</label> 1903 $config = $PA[
'fieldConf'][
'config'];
1905 if ($this->renderReadonly || $config[
'readOnly']) {
1906 $disabled =
' disabled="disabled"';
1913 $nMV_label = isset($PA[
'fieldTSConfig'][
'noMatchingValue_label'])
1914 ? $this->
sL($PA[
'fieldTSConfig'][
'noMatchingValue_label'])
1915 :
'[ ' . $this->
getLL(
'l_noMatchingValue') .
' ]';
1917 $maxitems = (int)$config[
'maxitems'];
1919 if ($maxitems <= 1 && $config[
'renderMode'] !==
'tree') {
1921 } elseif ($config[
'renderMode'] ===
'checkbox') {
1924 } elseif ($config[
'renderMode'] ===
'singlebox') {
1927 } elseif ($config[
'renderMode'] ===
'tree') {
1930 $item = $treeClass->renderField($table, $field, $row, $PA, $config, $selItems, $nMV_label);
1933 $this->
registerRequiredProperty(
'range', $PA[
'itemFormElName'], array($minitems, $maxitems,
'imgName' => $table .
'_' . $row[
'uid'] .
'_' . $field));
1940 $altItem =
'<input type="hidden" name="' . $PA[
'itemFormElName'] .
'" value="' . htmlspecialchars($PA[
'itemFormElValue']) .
'" />';
1941 $item = $this->
renderWizards(array($item, $altItem), $config[
'wizards'], $table, $row, $field, $PA, $PA[
'itemFormElName'], $specConf);
1958 $config = $PA[
'fieldConf'][
'config'];
1971 $PA[
'fieldTSConfig'][
'keepItems'],
1978 $selectItems = $this->
addItems($selectItems, $PA[
'fieldTSConfig'][
'addItems.']);
1981 if (isset($config[
'itemsProcFunc']) && $config[
'itemsProcFunc']) {
1982 $selectItems = $this->procItems($selectItems, $PA[
'fieldTSConfig'][
'itemsProcFunc.'], $config, $table, $row, $fieldName);
1987 foreach ($selectItems as $selectItemIndex => $selectItem) {
1990 $languageDeny = FALSE;
1993 !empty(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'])
1994 &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] === $fieldName
1995 && !$beUserAuth->checkLanguageAccess($selectItem[1])
1997 $languageDeny = TRUE;
2000 $authModeDeny = FALSE;
2002 ($config[
'form_type'] ===
'select')
2003 && $config[
'authMode']
2004 && !$beUserAuth->checkAuthMode($table, $fieldName, $selectItem[1], $config[
'authMode'])
2006 $authModeDeny = TRUE;
2009 if (in_array($selectItem[1], $removeItems) || $languageDeny || $authModeDeny) {
2010 unset($selectItems[$selectItemIndex]);
2011 } elseif (isset($PA[
'fieldTSConfig'][
'altLabels.'][$selectItem[1]])) {
2012 $selectItems[$selectItemIndex][0] = htmlspecialchars($this->
sL($PA[
'fieldTSConfig'][
'altLabels.'][$selectItem[1]]));
2016 if (($table ===
'pages' || $table ===
'pages_language_overlay') && $fieldName ===
'doktype') {
2017 if (!($beUserAuth->isAdmin() ||
GeneralUtility::inList($beUserAuth->groupData[
'pagetypes_select'], $selectItem[1]))) {
2018 unset($selectItems[$selectItemIndex]);
2023 return $selectItems;
2043 $inlineParent = $this->
inline->getStructureLevel(-1);
2045 if (is_array($inlineParent) && $inlineParent[
'uid']) {
2046 if ($inlineParent[
'config'][
'foreign_table'] == $table && $inlineParent[
'config'][
'foreign_unique'] == $field) {
2047 $uniqueIds = $this->
inline->inlineData[
'unique'][$this->
inline->inlineNames[
'object']
2049 $PA[
'fieldChangeFunc'][
'inlineUnique'] =
'inline.updateUnique(this,\'' . $this->
inline->inlineNames[
'object']
2051 .
'\',\
'' . $row[
'uid'] .
'\');
'; 2053 // hide uid of parent record for symmetric relations 2055 $inlineParent['config
']['foreign_table
'] == $table 2056 && ($inlineParent['config
']['foreign_field
'] == $field || $inlineParent['config
']['symmetric_field
'] == $field) 2058 $uniqueIds[] = $inlineParent['uid
']; 2064 $noMatchingValue = 1; 2066 $selicons = array(); 2067 $onlySelectedIconShown = 0; 2068 $size = (int)$config['size
']; 2069 // Style set on <select/> 2070 $selectedStyle = ''; 2073 if ($this->renderReadonly || $config['readOnly
']) { 2074 $disabled = ' disabled=
"disabled"'; 2075 $onlySelectedIconShown = 1; 2077 // Register as required if minitems is greater than zero 2078 if (($minItems = MathUtility::forceIntegerInRange($config['minitems
'], 0)) > 0) { 2079 $this->registerRequiredProperty('field
', $table . '_
' . $row['uid
'] . '_
' . $field, $PA['itemFormElName
']); 2082 // Icon configuration: 2083 if ($config['suppress_icons
'] == 'IF_VALUE_FALSE
') { 2084 $suppressIcons = !$PA['itemFormElValue
'] ? 1 : 0; 2085 } elseif ($config['suppress_icons
'] == 'ONLY_SELECTED
') { 2087 $onlySelectedIconShown = 1; 2088 } elseif ($config['suppress_icons
']) { 2093 // Traverse the Array of selector box items: 2094 $optGroupStart = array(); 2095 $optGroupOpen = FALSE; 2096 $classesForSelectTag = array(); 2097 foreach ($selItems as $p) { 2098 $sM = (string)$PA['itemFormElValue
'] === (string)$p[1] ? ' selected=
"selected"' : ''; 2101 $noMatchingValue = 0; 2103 // Getting style attribute value (for icons): 2104 $styleAttrValue = ''; 2105 if ($config['iconsInOptionTags
']) { 2106 $styleAttrValue = $this->optionTagStyle($p[2]); 2108 list($selectIconFile, $selectIconInfo) = $this->getIcon($p[2]); 2109 if (!empty($selectIconInfo)) { 2110 $selectedStyle = ' style=
"background-image:url(' . $selectIconFile . ');"'; 2111 $classesForSelectTag[] = 'typo3-TCEforms-select-selectedItemWithBackgroundImage
'; 2115 // Compiling the <option> tag: 2116 if (!($p[1] != $PA['itemFormElValue
'] && is_array($uniqueIds) && in_array($p[1], $uniqueIds))) { 2117 if ($p[1] === '--div--
') { 2118 $optGroupStart[0] = $p[0]; 2119 if ($config['iconsInOptionTags
']) { 2120 $optGroupStart[1] = $this->optgroupTagStyle($p[2]); 2122 $optGroupStart[1] = $styleAttrValue; 2125 if (count($optGroupStart)) { 2126 // Closing last optgroup before next one starts 2127 if ($optGroupOpen) { 2128 $opt[] = '</optgroup>
' . LF; 2130 $opt[] = '<optgroup label=
"' . htmlspecialchars($optGroupStart[0], ENT_COMPAT, 'UTF-8', FALSE) 2131 . '"' . ($optGroupStart[1] ? ' style=
"' . htmlspecialchars($optGroupStart[1]) . '"' : '') 2132 . ' class=
"c-divider">
' . LF; 2133 $optGroupOpen = TRUE; 2135 $optGroupStart = array(); 2137 $opt[] = '<option value=
"' . htmlspecialchars($p[1]) . '"' . $sM 2138 . ($styleAttrValue ? ' style=
"' . htmlspecialchars($styleAttrValue) . '"' : '') . '>
' 2139 . htmlspecialchars($p[0], ENT_COMPAT, 'UTF-8
', FALSE) . '</option>
' . LF; 2142 // If there is an icon for the selector box (rendered in selicon-table below)...: 2143 // if there is an icon ($p[2]), icons should be shown, and, if only selected are visible, is it selected 2144 if ($p[2] && !$suppressIcons && (!$onlySelectedIconShown || $sM)) { 2145 list($selIconFile, $selIconInfo) = $this->getIcon($p[2]); 2146 $iOnClick = $this->elName($PA['itemFormElName
']) . '.selectedIndex=
' . $c . ';
'. $this->elName($PA['itemFormElName
']); 2147 $iOnClickOptions = $this->elName($PA['itemFormElName
']) . '.options[
' . $c . ']
'; 2148 if (empty($selIconInfo)) { 2149 $iOnClick .= '.className=
' . $iOnClickOptions . '.className;
'; 2151 $iOnClick .= '.style.backgroundImage=
' . $iOnClickOptions . '.style.backgroundImage;
'; 2153 $iOnClick .= implode('', $PA['fieldChangeFunc
']) . 'this.blur();
return false;
'; 2154 $selicons[] = array( 2155 (!$onlySelectedIconShown ? '<a href=
"#" onclick=
"' . htmlspecialchars($iOnClick) . '">
' : '') 2156 . $this->getIconHtml($p[2], htmlspecialchars($p[0]), htmlspecialchars($p[0])) 2157 . (!$onlySelectedIconShown ? '</a>
' : ''), 2164 // Closing optgroup if open 2165 if ($optGroupOpen) { 2166 $opt[] = '</optgroup>
'; 2168 // No-matching-value: 2169 if ($PA['itemFormElValue
'] && $noMatchingValue && !$PA['fieldTSConfig
']['disableNoMatchingValueElement
'] && !$config['disableNoMatchingValueElement
']) { 2170 $nMV_label = @sprintf($nMV_label, $PA['itemFormElValue
']); 2171 $opt[] = '<option value=
"' . htmlspecialchars($PA['itemFormElValue']) . '" selected=
"selected">
' . htmlspecialchars($nMV_label) . '</option>
'; 2173 // Create item form fields: 2174 $sOnChange = 'if (this.options[this.selectedIndex].value==\
'--div--\') {this.selectedIndex=' . $sI .
';} ' . implode(
'', $PA[
'fieldChangeFunc']);
2177 $item .=
'<input type="hidden" name="' . $PA[
'itemFormElName'] .
'_selIconVal" value="' . htmlspecialchars($sI) .
'" />';
2179 if ($config[
'iconsInOptionTags']) {
2180 $classesForSelectTag[] =
'icon-select';
2182 $item .=
'<select' . $selectedStyle .
' id="' . str_replace(
'.',
'', uniqid(
'tceforms-select-', TRUE)) .
'" name="' . $PA[
'itemFormElName'] .
'"' . $this->
insertDefStyle(
'select', implode(
' ', $classesForSelectTag)) . ($size ?
' size="' . $size .
'"' :
'') .
' onchange="' . htmlspecialchars($sOnChange) .
'"' . $PA[
'onFocus'] . $disabled .
'>';
2183 $item .= implode(
'', $opt);
2184 $item .=
'</select>';
2186 if (count($selicons) && !$config[
'noIconsBelowSelect']) {
2187 $item .=
'<table border="0" cellpadding="0" cellspacing="0" class="typo3-TCEforms-selectIcons">';
2188 $selicon_cols = (int)$config[
'selicon_cols'];
2189 if (!$selicon_cols) {
2190 $selicon_cols = count($selicons);
2192 $sR = ceil(count($selicons) / $selicon_cols);
2193 $selicons = array_pad($selicons, $sR * $selicon_cols,
'');
2194 for ($sa = 0; $sa < $sR; $sa++) {
2196 for ($sb = 0; $sb < $selicon_cols; $sb++) {
2197 $sk = $sa * $selicon_cols + $sb;
2198 $imgN =
'selIcon_' . $table .
'_' . $row[
'uid'] .
'_' . $field .
'_' . $selicons[$sk][1];
2199 $imgS = $selicons[$sk][2] ? $this->backPath .
'gfx/content_selected.gif' :
'clear.gif';
2200 $item .=
'<td><img name="' . htmlspecialchars($imgN) .
'" src="' . $imgS .
'" width="7" height="10" alt="" /></td>';
2201 $item .=
'<td>' . $selicons[$sk][0] .
'</td>';
2205 $item .=
'</table>';
2226 if (empty($selItems)) {
2233 if ($this->renderReadonly || $config[
'readOnly']) {
2234 $disabled =
' disabled="disabled"';
2240 $unSetAll = array();
2241 $restoreCmd = array();
2244 $sOnChange = implode(
'', $PA[
'fieldChangeFunc']);
2246 foreach ($selItems as $p) {
2248 if ($p[1] ===
'--div--') {
2250 if (isset($p[2]) && $p[2] !=
'empty-emtpy') {
2254 <tr class="c-header"> 2255 <td colspan="3">' . $selIcon . htmlspecialchars($p[0]) .
'</td> 2260 if (isset($itemArray[$p[1]])) {
2261 $sM =
' checked="checked"';
2262 unset($itemArray[$p[1]]);
2265 if (!empty($p[2])) {
2271 $rowId = str_replace(
'.',
'', uniqid(
'select_checkbox_row_', TRUE));
2272 $onClickCell = $this->
elName(($PA[
'itemFormElName'] .
'[' . $c .
']')) .
'.checked=!' . $this->
elName(($PA[
'itemFormElName'] .
'[' . $c .
']')) .
'.checked;';
2273 $onClick =
'this.attributes.getNamedItem("class").nodeValue = ' . $this->
elName(($PA[
'itemFormElName'] .
'[' . $c .
']')) .
'.checked ? "c-selectedItem" : "c-unselectedItem";';
2274 $setAll[] = $this->
elName(($PA[
'itemFormElName'] .
'[' . $c .
']')) .
'.checked=1;';
2275 $setAll[] .=
'$(\'' . $rowId .
'\').removeClassName(\
'c-unselectedItem\');$(\'' . $rowId .
'\').addClassName(\
'c-selectedItem\');';
2276 $unSetAll[] = $this->
elName(($PA[
'itemFormElName'] .
'[' . $c .
']')) .
'.checked=0;';
2277 $unSetAll[] .=
'$(\'' . $rowId .
'\').removeClassName(\
'c-selectedItem\');$(\'' . $rowId .
'\').addClassName(\
'c-unselectedItem\');';
2278 $restoreCmd[] = $this->
elName(($PA[
'itemFormElName'] .
'[' . $c .
']')) .
'.checked=' . ($sM ? 1 : 0) .
';' .
'$(\'' . $rowId .
'\').removeClassName(\
'c-selectedItem\');$(\'' . $rowId .
'\').removeClassName(\
'c-unselectedItem\');' .
'$(\'' . $rowId .
'\').addClassName(\
'c-' . ($sM ?
'' :
'un') .
'selectedItem\');';
2287 $helpArray = array();
2288 if (is_array($p[3]) && count($p[3]) > 0 || !empty($p[3])) {
2290 if (is_array($p[3])) {
2293 $helpArray[
'description'] = $p[3];
2296 $label = htmlspecialchars($p[0], ENT_COMPAT,
'UTF-8', FALSE);
2301 <tr id="' . $rowId .
'" class="' . ($sM ?
'c-selectedItem' :
'c-unselectedItem')
2302 .
'" onclick="' . htmlspecialchars($onClick) .
'" style="cursor: pointer;"> 2303 <td class="c-checkbox"><input type="checkbox"' . $this->
insertDefStyle(
'check')
2304 .
' name="' . htmlspecialchars(($PA[
'itemFormElName'] .
'[' . $c .
']'))
2305 .
'" value="' . htmlspecialchars($p[1]) .
'"' . $sM .
' onclick="' . htmlspecialchars($sOnChange)
2306 .
'"' . $PA[
'onFocus'] .
' /></td> 2307 <td class="c-labelCell" onclick="' . htmlspecialchars($onClickCell) .
'">' . $selIcon . $label .
'</td> 2308 <td class="c-descr" onclick="' . htmlspecialchars($onClickCell) .
'">' . (empty($help) ?
'' : $help) .
'</td> 2315 if (count($itemArray) && !$PA[
'fieldTSConfig'][
'disableNoMatchingValueElement'] && !$config[
'disableNoMatchingValueElement']) {
2316 foreach ($itemArray as $theNoMatchValue => $temp) {
2318 array_unshift($tRows,
' 2319 <tr class="c-invalidItem"> 2320 <td class="c-checkbox"><input type="checkbox"' . $this->
insertDefStyle(
'check')
2321 .
' name="' . htmlspecialchars(($PA[
'itemFormElName'] .
'[' . $c .
']'))
2322 .
'" value="' . htmlspecialchars($theNoMatchValue) .
'" checked="checked" onclick="' . htmlspecialchars($sOnChange) .
'"' 2323 . $PA[
'onFocus'] . $disabled .
' /></td> 2324 <td class="c-labelCell">' . htmlspecialchars(@sprintf($nMV_label, $theNoMatchValue), ENT_COMPAT,
'UTF-8', FALSE) .
'</td><td> </td> 2330 $item .=
'<input type="hidden" class="select-checkbox" name="' . htmlspecialchars($PA[
'itemFormElName']) .
'" value="" />';
2333 if (count($setAll)) {
2334 $tableHead =
'<thead> 2335 <tr class="c-header-checkbox-controls t3-row-header"> 2336 <td class="c-checkbox"> 2337 <input type="checkbox" class="checkbox" onclick="if (checked) {' . htmlspecialchars(implode(
'', $setAll) .
'} else {' . implode(
'', $unSetAll) .
'}') .
'"> 2345 <table border="0" cellpadding="0" cellspacing="0" class="typo3-TCEforms-select-checkbox">' . $tableHead .
'<tbody>' . implode(
'', $tRows) .
'</tbody> 2349 if (!empty($restoreCmd)) {
2350 $item .=
'<a href="#" onclick="' . implode(
'', $restoreCmd) .
' return false;' .
'">' 2376 if ($this->renderReadonly || $config[
'readOnly']) {
2377 $disabled =
' disabled="disabled"';
2382 $restoreCmd = array();
2384 foreach ($selItems as $p) {
2387 if (isset($itemArray[$p[1]])) {
2388 $sM =
' selected="selected"';
2389 $restoreCmd[] = $this->
elName(($PA[
'itemFormElName'] .
'[]')) .
'.options[' . $c .
'].selected=1;';
2390 unset($itemArray[$p[1]]);
2394 if ((
string) $p[1] ===
'--div--') {
2395 $nonSel =
' onclick="this.selected=0;" class="c-divider"';
2398 $styleAttrValue =
'';
2399 if ($config[
'iconsInOptionTags']) {
2403 $opt[] =
'<option value="' . htmlspecialchars($p[1]) .
'"' . $sM . $nonSel
2404 . ($styleAttrValue ?
' style="' . htmlspecialchars($styleAttrValue) .
'"' :
'') .
'>' 2405 . htmlspecialchars($p[0], ENT_COMPAT,
'UTF-8', FALSE) .
'</option>';
2409 if (count($itemArray) && !$PA[
'fieldTSConfig'][
'disableNoMatchingValueElement'] && !$config[
'disableNoMatchingValueElement']) {
2410 foreach ($itemArray as $theNoMatchValue => $temp) {
2412 array_unshift($opt,
'<option value="' . htmlspecialchars($theNoMatchValue) .
'" selected="selected">' 2413 . htmlspecialchars(@sprintf($nMV_label, $theNoMatchValue), ENT_COMPAT,
'UTF-8', FALSE) .
'</option>');
2417 $sOnChange = implode(
'', $PA[
'fieldChangeFunc']);
2418 $selector_itemListStyle = isset($config[
'itemListStyle'])
2419 ?
' style="' . htmlspecialchars($config[
'itemListStyle']) .
'"' 2420 :
' style="' . $this->defaultMultipleSelectorStyle .
'"';
2421 $size = (int)$config[
'size'];
2422 $cssPrefix = $size === 1 ?
'tceforms-select' :
'tceforms-multiselect';
2423 $size = $config[
'autoSizeMax']
2426 $selectBox =
'<select id="' . str_replace(
'.',
'', uniqid($cssPrefix, TRUE)) .
'" name="' . $PA[
'itemFormElName'] .
'[]"' 2427 . $this->
insertDefStyle(
'select', $cssPrefix) . ($size ?
' size="' . $size .
'"' :
'')
2428 .
' multiple="multiple" onchange="' . htmlspecialchars($sOnChange) .
'"' . $PA[
'onFocus']
2429 . $selector_itemListStyle . $disabled .
'> 2435 $item .=
'<input type="hidden" name="' . htmlspecialchars($PA[
'itemFormElName']) .
'" value="" />';
2438 $onClick = htmlspecialchars($this->
elName(($PA[
'itemFormElName'] .
'[]')) .
'.selectedIndex=-1;' . implode(
'', $restoreCmd) .
' return false;');
2440 <table border="0" cellspacing="0" cellpadding="0" width="1" class="typo3-TCEforms-select-singlebox"> 2445 <em>' . htmlspecialchars($this->
getLL(
'l_holdDownCTRL')) .
'</em> 2448 <a href="#" onclick="' . $onClick .
'" title="' . htmlspecialchars($this->
getLL(
'l_revertSelection')) .
'">' 2475 if ($this->renderReadonly || $config[
'readOnly']) {
2476 $disabled =
' disabled="disabled"';
2480 $item .=
'<input type="hidden" name="' . $PA[
'itemFormElName'] .
'_mul" value="' . ($config[
'multiple'] ? 1 : 0) .
'" />';
2489 $this->
registerRequiredProperty(
'range', $PA[
'itemFormElName'], array($minitems, $maxitems,
'imgName' => $table .
'_' . $row[
'uid'] .
'_' . $field));
2498 $PA[
'fieldTSConfig'][
'keepItems'],
2500 $parts = explode(
'|', $value, 2);
2501 return rawurldecode($parts[0]);
2506 foreach ($itemArray as $tk => $tv) {
2507 $tvP = explode(
'|', $tv, 2);
2508 $evalValue = $tvP[0];
2509 $isRemoved = in_array($evalValue, $removeItems)
2510 || $config[
'form_type'] ==
'select' && $config[
'authMode']
2512 if ($isRemoved && !$PA[
'fieldTSConfig'][
'disableNoMatchingValueElement'] && !$config[
'disableNoMatchingValueElement']) {
2513 $tvP[1] = rawurlencode(@sprintf($nMV_label, $evalValue));
2514 } elseif (isset($PA[
'fieldTSConfig'][
'altLabels.'][$evalValue])) {
2515 $tvP[1] = rawurlencode($this->
sL($PA[
'fieldTSConfig'][
'altLabels.'][$evalValue]));
2517 if ($tvP[1] ==
'') {
2519 foreach ($selItems as $selItem) {
2520 if ($selItem[1] == $tvP[0]) {
2521 $tvP[1] = html_entity_decode($selItem[0]);
2526 $itemArray[$tk] = implode(
'|', $tvP);
2528 $itemsToSelect =
'';
2529 $filterTextfield =
'';
2530 $filterSelectbox =
'';
2535 $styleAttrValue =
'';
2536 foreach ($selItems as $p) {
2537 if ($config[
'iconsInOptionTags']) {
2540 $opt[] =
'<option value="' . htmlspecialchars($p[1]) .
'"' 2541 . ($styleAttrValue ?
' style="' . htmlspecialchars($styleAttrValue) .
'"' :
'')
2542 .
' title="' . $p[0] .
'">' . $p[0] .
'</option>';
2545 $selector_itemListStyle = isset($config[
'itemListStyle'])
2546 ?
' style="' . htmlspecialchars($config[
'itemListStyle']) .
'"' 2547 :
' style="' . $this->defaultMultipleSelectorStyle .
'"';
2548 $size = (int)$config[
'size'];
2549 $size = $config[
'autoSizeMax']
2552 $sOnChange = implode(
'', $PA[
'fieldChangeFunc']);
2554 $multiSelectId = str_replace(
'.',
'', uniqid(
'tceforms-multiselect-', TRUE));
2556 <select data-relatedfieldname="' . htmlspecialchars($PA[
'itemFormElName']) .
'" data-exclusivevalues="' 2557 . htmlspecialchars($config[
'exclusiveKeys']) .
'" id="' . $multiSelectId .
'" name="' . $PA[
'itemFormElName'] .
'_sel"' 2558 . $this->
insertDefStyle(
'select',
'tceforms-multiselect tceforms-itemstoselect t3-form-select-itemstoselect')
2559 . ($size ?
' size="' . $size .
'"' :
'') .
' onchange="' . htmlspecialchars($sOnChange) .
'"' 2560 . $PA[
'onFocus'] . $selector_itemListStyle .
'> 2565 if ($config[
'enableMultiSelectFilterTextfield'] || $config[
'multiSelectFilterItems']) {
2566 $this->multiSelectFilterCount++;
2568 $this->additionalJS_post[] =
' 2569 var '. $jsSelectBoxFilterName .
' = new TCEForms.SelectBoxFilter("' . $multiSelectId .
'"); 2573 if ($config[
'enableMultiSelectFilterTextfield']) {
2575 $filterTextfield =
'<input class="typo3-TCEforms-suggest-search typo3-TCEforms-multiselect-filter" id="' 2576 . $multiSelectId .
'_filtertextfield" value="" style="width: 104px;" />';
2579 if (isset($config[
'multiSelectFilterItems']) && is_array($config[
'multiSelectFilterItems']) && count($config[
'multiSelectFilterItems']) > 1) {
2580 $filterDropDownOptions = array();
2581 foreach ($config[
'multiSelectFilterItems'] as $optionElement) {
2582 $optionValue = $this->
sL(isset($optionElement[1]) && $optionElement[1] !=
'' ? $optionElement[1]
2583 : $optionElement[0]);
2584 $filterDropDownOptions[] =
'<option value="' . htmlspecialchars($this->
sL($optionElement[0])) .
'">' 2585 . htmlspecialchars($optionValue) .
'</option>';
2587 $filterSelectbox =
' 2588 <select id="' . $multiSelectId .
'_filterdropdown"> 2590 ', $filterDropDownOptions) .
' 2598 'style' => isset($config[
'selectedListStyle'])
2599 ?
' style="' . htmlspecialchars($config[
'selectedListStyle']) .
'"' 2600 :
' style="' . $this->defaultMultipleSelectorStyle .
'"',
2601 'dontShowMoveIcons' => $maxitems <= 1,
2602 'maxitems' => $maxitems,
2605 'selector' => $this->
getLL(
'l_selected') .
':<br />',
2606 'items' => $this->
getLL(
'l_items') .
': ' . $filterSelectbox . $filterTextfield .
'<br />' 2609 'thumbnails' => $itemsToSelect,
2610 'readOnly' => $disabled
2612 $item .= $this->
dbFileIcons($PA[
'itemFormElName'],
'',
'', $itemArray,
'', $params, $PA[
'onFocus']);
2627 public function getSingleField_typeGroup($table, $field, $row, &$PA) {
2629 $config = $PA[
'fieldConf'][
'config'];
2630 $show_thumbs = $config[
'show_thumbs'];
2631 $size = isset($config[
'size']) ? (int)$config[
'size'] : 5;
2637 $allowed = trim($config[
'allowed']);
2638 $disallowed = trim($config[
'disallowed']);
2641 if ($this->renderReadonly || $config[
'readOnly']) {
2642 $disabled =
' disabled="disabled"';
2644 $item .=
'<input type="hidden" name="' . $PA[
'itemFormElName'] .
'_mul" value="' . ($config[
'multiple'] ? 1 : 0) .
'"' . $disabled .
' />';
2645 $this->
registerRequiredProperty(
'range', $PA[
'itemFormElName'], array($minitems, $maxitems,
'imgName' => $table .
'_' . $row[
'uid'] .
'_' . $field));
2649 $PA[
'itemFormElID_file'] = $PA[
'itemFormElID'] .
'_files';
2651 $noList = isset($config[
'disable_controls']) &&
GeneralUtility::inList($config[
'disable_controls'],
'list');
2652 $noDelete = isset($config[
'disable_controls']) &&
GeneralUtility::inList($config[
'disable_controls'],
'delete');
2654 if ($maxitems === 1) {
2655 $this->additionalJS_post[] =
'TBE_EDITOR.clearBeforeSettingFormValueFromBrowseWin[\'' . $PA[
'itemFormElName'] .
'\'] = {
2656 itemFormElID_file: \
'' . $PA[
'itemFormElID_file'] .
'\' 2658 $PA['fieldChangeFunc
']['TBE_EDITOR_fieldChanged
'] = 'setFormValueManipulate(\
'' . $PA[
'itemFormElName']
2659 .
'\', \
'Remove\'); ' . $PA[
'fieldChangeFunc'][
'TBE_EDITOR_fieldChanged'];
2660 } elseif ($noList) {
2662 $PA[
'fieldChangeFunc'][
'TBE_EDITOR_fieldChanged'] =
'setFormValueManipulate(\'' . $PA[
'itemFormElName']
2663 .
'\', \
'RemoveFirstIfFull\', \'' . $maxitems .
'\');
' . $PA['fieldChangeFunc
']['TBE_EDITOR_fieldChanged
']; 2665 // Acting according to either "file" or "db" type: 2666 switch ((string) $config['internal_type
']) { 2667 case 'file_reference
': 2668 $config['uploadfolder
'] = ''; 2671 // Creating string showing allowed types: 2672 $tempFT = GeneralUtility::trimExplode(',
', $allowed, TRUE); 2673 if (!count($tempFT)) { 2676 foreach ($tempFT as $ext) { 2678 $info .= strtoupper($ext) . ' '; 2681 // Creating string, showing disallowed types: 2682 $tempFT_dis = GeneralUtility::trimExplode(',
', $disallowed, TRUE); 2683 if (count($tempFT_dis)) { 2686 foreach ($tempFT_dis as $ext) { 2688 $info .= '-
' . strtoupper($ext) . ' '; 2691 // Making the array of file items: 2692 $itemArray = GeneralUtility::trimExplode(',
', $PA['itemFormElValue
'], TRUE); 2693 $fileFactory = ResourceFactory::getInstance(); 2694 // Correct the filename for the FAL items 2695 foreach ($itemArray as &$fileItem) { 2696 list($fileUid, $fileLabel) = explode('|
', $fileItem); 2697 if (MathUtility::canBeInterpretedAsInteger($fileUid)) { 2698 $fileObject = $fileFactory->getFileObject($fileUid); 2699 $fileLabel = $fileObject->getName(); 2701 $fileItem = $fileUid . '|
' . $fileLabel; 2703 // Showing thumbnails: 2707 foreach ($itemArray as $imgRead) { 2708 $imgP = explode('|
', $imgRead); 2709 $imgPath = rawurldecode($imgP[0]); 2710 // FAL icon production 2711 if (MathUtility::canBeInterpretedAsInteger($imgP[0])) { 2712 $fileObject = $fileFactory->getFileObject($imgP[0]); 2714 if ($fileObject->isMissing()) { 2715 $flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject); 2716 $imgs[] = $flashMessage->render(); 2717 } elseif (GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS
']['GFX
']['imagefile_ext
'], $fileObject->getExtension())) { 2718 $imageUrl = $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, array())->getPublicUrl(TRUE); 2719 $imgTag = '<img src=
"' . $imageUrl . '" alt=
"' . htmlspecialchars($fileObject->getName()) . '" />
'; 2720 $imgs[] = '<span
class=
"nobr">
' . $imgTag . htmlspecialchars($fileObject->getName()) . '</span>
'; 2723 $imgTag = IconUtility::getSpriteIconForResource($fileObject, array('title
' => $fileObject->getName())); 2724 $imgs[] = '<span
class=
"nobr">
' . $imgTag . htmlspecialchars($fileObject->getName()) . '</span>
'; 2728 $rowCopy[$field] = $imgPath; 2729 $thumbnailCode = ''; 2731 $thumbnailCode = BackendUtility::thumbCode( 2732 $rowCopy, $table, $field, $this->backPath, 'thumbs.php
', 2733 $config['uploadfolder
'], 0, ' align=
"middle"' 2735 $thumbnailCode = '<span
class=
"nobr">
' . $thumbnailCode . $imgPath . '</span>
'; 2737 } catch (\Exception $exception) { 2739 $message = $exception->getMessage(); 2740 $flashMessage = GeneralUtility::makeInstance( 2742 htmlspecialchars($message), '', FlashMessage::ERROR, TRUE 2746 $flashMessageService = GeneralUtility::makeInstance($class); 2747 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); 2748 $defaultFlashMessageQueue->enqueue($flashMessage); 2750 $logMessage = $message . ' (
' . $table . ':
' . $row['uid
'] . ')
'; 2751 GeneralUtility::sysLog($logMessage, 'core
', GeneralUtility::SYSLOG_SEVERITY_WARNING); 2754 $imgs[] = $thumbnailCode; 2757 $thumbsnail = implode('<br />
', $imgs); 2759 // Creating the element: 2762 'dontShowMoveIcons
' => $maxitems <= 1, 2763 'autoSizeMax
' => MathUtility::forceIntegerInRange($config['autoSizeMax
'], 0), 2764 'maxitems
' => $maxitems, 2765 'style
' => isset($config['selectedListStyle
']) 2766 ? ' style=
"' . htmlspecialchars($config['selectedListStyle']) . '"' 2767 : ' style=
"' . $this->defaultMultipleSelectorStyle . '"', 2769 'thumbnails
' => $thumbsnail, 2770 'readOnly
' => $disabled, 2771 'noBrowser
' => $noList || isset($config['disable_controls
']) && GeneralUtility::inList($config['disable_controls
'], 'browser
'), 2772 'noList
' => $noList, 2773 'noDelete
' => $noDelete 2775 $item .= $this->dbFileIcons($PA['itemFormElName
'], 'file
', implode(',
', $tempFT), $itemArray, '', $params, $PA['onFocus
'], '', '', '', $config); 2776 if (!$disabled && !(isset($config['disable_controls
']) && GeneralUtility::inList($config['disable_controls
'], 'upload
'))) { 2777 // Adding the upload field: 2778 if ($this->edit_docModuleUpload && $config['uploadfolder
']) { 2779 // Insert the multiple attribute to enable HTML5 multiple file upload 2780 $multipleAttribute = ''; 2781 $multipleFilenameSuffix = ''; 2782 if (isset($config['maxitems
']) && $config['maxitems
'] > 1) { 2783 $multipleAttribute = ' multiple=
"multiple"'; 2784 $multipleFilenameSuffix = '[]
'; 2786 $item .= '<div
id=
"' . $PA['itemFormElID_file'] . '"><input type=
"file"' . $multipleAttribute 2787 . ' name=
"' . $PA['itemFormElName_file'] . $multipleFilenameSuffix . '" size=
"35" onchange=
"' 2788 . implode('', $PA['fieldChangeFunc']) . '" /></div>
'; 2793 // If the element is of the internal type "folder": 2794 // Array of folder items: 2795 $itemArray = GeneralUtility::trimExplode(',
', $PA['itemFormElValue
'], TRUE); 2796 // Creating the element: 2799 'dontShowMoveIcons
' => $maxitems <= 1, 2800 'autoSizeMax
' => MathUtility::forceIntegerInRange($config['autoSizeMax
'], 0), 2801 'maxitems
' => $maxitems, 2802 'style
' => isset($config['selectedListStyle
']) 2803 ? ' style=
"' . htmlspecialchars($config['selectedListStyle']) . '"' 2804 : ' style=
"' . $this->defaultMultipleSelectorStyle . '"', 2806 'readOnly
' => $disabled, 2807 'noBrowser
' => $noList || isset($config['disable_controls
']) && GeneralUtility::inList($config['disable_controls
'], 'browser
'), 2810 $item .= $this->dbFileIcons($PA['itemFormElName
'], 'folder
', '', $itemArray, '', $params, $PA['onFocus
']); 2813 // If the element is of the internal type "db": 2814 // Creating string showing allowed types: 2815 $tempFT = GeneralUtility::trimExplode(',
', $allowed, TRUE); 2816 $onlySingleTableAllowed = FALSE; 2817 if (trim($tempFT[0]) === '*
') { 2818 $info .= '<span
class=
"nobr">
' . htmlspecialchars($this->getLL('l_allTables
')) . '</span><br />
'; 2819 } elseif ($tempFT) { 2820 $onlySingleTableAllowed = count($tempFT) == 1; 2821 foreach ($tempFT as $theT) { 2822 $label = IconUtility::getSpriteIconForRecord($theT, array()) 2823 . htmlspecialchars($this->sL($GLOBALS['TCA
'][$theT]['ctrl
']['title
'])); 2824 if (empty($config['readOnly
'])) { 2825 $aOnClick = 'setFormValueOpenBrowser(\
'db\', \'' . ($PA[
'itemFormElName'] .
'|||' . $theT) .
'\');
return false;
'; 2826 $info .= '<span
class=
"nobr"><a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '">
' 2827 . $label . '</a></span>
'; 2829 $info .= '<span
class=
"nobr">
' . $label . '</span>
'; 2834 $perms_clause = $this->getBackendUserAuthentication()->getPagePermsClause(1); 2835 $itemArray = array(); 2838 $temp_itemArray = GeneralUtility::trimExplode(',
', $PA['itemFormElValue
'], TRUE); 2839 foreach ($temp_itemArray as $dbRead) { 2840 $recordParts = explode('|
', $dbRead); 2841 list($this_table, $this_uid) = BackendUtility::splitTable_Uid($recordParts[0]); 2842 // For the case that no table was found and only a single table is defined to be allowed, use that one: 2843 if (!$this_table && $onlySingleTableAllowed) { 2844 $this_table = $allowed; 2846 $itemArray[] = array('table
' => $this_table, 'id' => $this_uid); 2847 if (!$disabled && $show_thumbs) { 2848 $rr = BackendUtility::getRecordWSOL($this_table, $this_uid); 2849 $imgs[] = '<span
class=
"nobr">
' . $this->getClickMenu(IconUtility::getSpriteIconForRecord($this_table, $rr, array( 2850 'style
' => 'vertical-align:top
', 2851 'title
' => htmlspecialchars((BackendUtility::getRecordPath($rr['pid
'], $perms_clause, 15) . ' [UID:
' . $rr['uid
'] . ']
')) 2852 )), $this_table, $this_uid) . '
' . BackendUtility::getRecordTitle($this_table, $rr, TRUE) 2853 . ' <span
class=
"typo3-dimmed"><em>[
' . $rr['uid
'] . ']</em></span>
' . '</span>
'; 2857 if (!$disabled && $show_thumbs) { 2858 $thumbsnail = implode('<br />
', $imgs); 2860 // Creating the element: 2863 'dontShowMoveIcons
' => $maxitems <= 1, 2864 'autoSizeMax
' => MathUtility::forceIntegerInRange($config['autoSizeMax
'], 0), 2865 'maxitems
' => $maxitems, 2866 'style
' => isset($config['selectedListStyle
']) 2867 ? ' style=
"' . htmlspecialchars($config['selectedListStyle']) . '"' 2868 : ' style=
"' . $this->defaultMultipleSelectorStyle . '"', 2870 'thumbnails
' => $thumbsnail, 2871 'readOnly
' => $disabled, 2872 'noBrowser
' => $noList || isset($config['disable_controls
']) && GeneralUtility::inList($config['disable_controls
'], 'browser
'), 2875 $item .= $this->dbFileIcons($PA['itemFormElName
'], 'db
', implode(',
', $tempFT), $itemArray, '', $params, $PA['onFocus
'], $table, $field, $row['uid
'], $config); 2879 $altItem = '<input type=
"hidden" name=
"' . $PA['itemFormElName'] . '" value=
"' . htmlspecialchars($PA['itemFormElValue']) . '" />
'; 2881 $item = $this->renderWizards(array($item, $altItem), $config['wizards
'], $table, $row, $field, $PA, $PA['itemFormElName
'], $specConf); 2897 public function getSingleField_typeNone($table, $field, $row, &$PA) { 2899 $config = $PA['fieldConf
']['config
']; 2900 $itemValue = $PA['itemFormElValue
']; 2901 return $this->getSingleField_typeNone_render($config, $itemValue); 2913 public function getSingleField_typeNone_render($config, $itemValue) { 2914 if ($config['format
']) { 2915 $itemValue = $this->formatValue($config, $itemValue); 2917 $rows = (int)$config['rows
']; 2919 if (!$config['pass_content
']) { 2920 $itemValue = nl2br(htmlspecialchars($itemValue)); 2923 $cols = MathUtility::forceIntegerInRange($config['cols
'] ? $config['cols
'] : 30, 5, $this->maxTextareaWidth); 2924 if (!$config['fixedRows
']) { 2925 $origRows = ($rows = MathUtility::forceIntegerInRange($rows, 1, 20)); 2926 if (strlen($itemValue) > $this->charsPerRow * 2) { 2927 $cols = $this->maxTextareaWidth; 2928 $rows = MathUtility::forceIntegerInRange(round(strlen($itemValue) / $this->charsPerRow), count(explode(LF, $itemValue)), 20); 2929 if ($rows < $origRows) { 2935 $cols = round($cols * $this->form_largeComp); 2936 $width = ceil($cols * $this->form_rowsToStylewidth); 2937 // Hardcoded: 12 is the height of the font 2938 $height = $rows * 12; 2940 <div style=
"overflow:auto; height:' . $height . 'px; width:' . $width . 'px;" class=
"t3-tceforms-fieldReadOnly">
' 2941 . $itemValue . IconUtility::getSpriteIcon('status-status-readonly
') . '</div>
'; 2943 if (!$config['pass_content
']) { 2944 $itemValue = htmlspecialchars($itemValue); 2946 $cols = $config['cols
'] ? $config['cols
'] : ($config['size
'] ? $config['size
'] : $this->maxInputWidth); 2947 $cols = round($cols * $this->form_largeComp); 2948 $width = ceil($cols * $this->form_rowsToStylewidth); 2949 // Overflow:auto crashes mozilla here. Title tag is useful when text is longer than the div box (overflow:hidden). 2951 <div style=
"overflow:hidden; width:' . $width . 'px;" class=
"t3-tceforms-fieldReadOnly" title=
"' . $itemValue . '">
' 2952 . '<span
class=
"nobr">
' . ((string)$itemValue !== '' ? $itemValue : '
') . '</span>
' 2953 . IconUtility::getSpriteIcon('status-status-readonly
') . '</div>
'; 2968 public function getSingleField_typeFlex($table, $field, $row, &$PA) { 2970 $dataStructArray = BackendUtility::getFlexFormDS($PA['fieldConf
']['config
'], $row, $table, $field); 2972 // Manipulate Flexform DS via TSConfig and group access lists 2973 if (is_array($dataStructArray)) { 2975 $dataStructArray = $flexFormHelper->modifyFlexFormDS($dataStructArray, $table, $field, $row, $PA['fieldConf
']); 2976 unset($flexFormHelper); 2978 // Get data structure: 2979 if (is_array($dataStructArray)) { 2981 $xmlData = $PA['itemFormElValue
']; 2982 $xmlHeaderAttributes = GeneralUtility::xmlGetHeaderAttribs($xmlData); 2983 $storeInCharset = strtolower($xmlHeaderAttributes['encoding
']); 2984 if ($storeInCharset) { 2985 $currentCharset = $this->getLanguageService()->charSet; 2986 $xmlData = $this->getLanguageService()->csConvObj->conv($xmlData, $storeInCharset, $currentCharset, 1); 2988 $editData = GeneralUtility::xml2array($xmlData); 2989 // Must be XML parsing error... 2990 if (!is_array($editData)) { 2991 $editData = array(); 2992 } elseif (!isset($editData['meta
']) || !is_array($editData['meta
'])) { 2993 $editData['meta
'] = array(); 2995 // Find the data structure if sheets are found: 2996 $sheet = $editData['meta
']['currentSheetId
'] ? $editData['meta
']['currentSheetId
'] : 'sDEF
'; 2998 // Create language menu: 2999 $langChildren = $dataStructArray['meta
']['langChildren
'] ? 1 : 0; 3000 $langDisabled = $dataStructArray['meta
']['langDisable
'] ? 1 : 0; 3001 $editData['meta
']['currentLangId
'] = array(); 3002 // Look up page overlays: 3003 $checkPageLanguageOverlay = $this->getBackendUserAuthentication()->getTSConfigVal('options.checkPageLanguageOverlay
') ? TRUE : FALSE; 3004 if ($checkPageLanguageOverlay) { 3005 $where_clause = 'pid=
' . (int)$row['pid
'] . BackendUtility::deleteClause('pages_language_overlay
') 3006 . BackendUtility::versioningPlaceholderClause('pages_language_overlay
'); 3007 $pageOverlays = $this->getDatabaseConnection()->exec_SELECTgetRows('*
', 'pages_language_overlay
', $where_clause, '', '', '', 'sys_language_uid
'); 3009 $languages = $this->getAvailableLanguages(); 3010 foreach ($languages as $lInfo) { 3012 $this->getBackendUserAuthentication()->checkLanguageAccess($lInfo['uid
']) 3013 && (!$checkPageLanguageOverlay || $lInfo['uid
'] <= 0 || is_array($pageOverlays[$lInfo['uid
']])) 3015 $editData['meta
']['currentLangId
'][] = $lInfo['ISOcode
']; 3018 if (!is_array($editData['meta
']['currentLangId
']) || !count($editData['meta
']['currentLangId
'])) { 3019 $editData['meta
']['currentLangId
'] = array('DEF
'); 3021 $editData['meta
']['currentLangId
'] = array_unique($editData['meta
']['currentLangId
']); 3022 $PA['_noEditDEF
'] = FALSE; 3023 if ($langChildren || $langDisabled) { 3024 $rotateLang = array('DEF
'); 3026 if (!in_array('DEF
', $editData['meta
']['currentLangId
'])) { 3027 array_unshift($editData['meta
']['currentLangId
'], 'DEF
'); 3028 $PA['_noEditDEF
'] = TRUE; 3030 $rotateLang = $editData['meta
']['currentLangId
']; 3033 if (is_array($dataStructArray['sheets
'])) { 3034 $tabsToTraverse = array_keys($dataStructArray['sheets
']); 3036 $tabsToTraverse = array($sheet); 3042 foreach ($rotateLang as $lKey) { 3043 if (!$langChildren && !$langDisabled) { 3044 $item .= '<strong>
' . $this->getLanguageIcon($table, $row, ('v
' . $lKey)) . $lKey . ':</strong>
'; 3046 // Default language, other options are "lUK" or whatever country code (independent of system!!!) 3047 $lang = 'l
' . $lKey; 3048 $tabParts = array(); 3050 foreach ($tabsToTraverse as $sheet) { 3051 list($dataStruct, $sheet) = GeneralUtility::resolveSheetDefInDS($dataStructArray, $sheet); 3052 // If sheet has displayCond 3053 if ($dataStruct['ROOT
']['TCEforms
']['displayCond
']) { 3054 $splitCondition = GeneralUtility::trimExplode(':
', $dataStruct['ROOT
']['TCEforms
']['displayCond
']); 3055 $skipCondition = FALSE; 3057 switch ($splitCondition[0]) { 3059 list($sheetName, $fieldName) = GeneralUtility::trimExplode('.
', $splitCondition[1], FALSE, 2); 3060 $fieldValue = $editData['data
'][$sheetName][$lang][$fieldName]; 3061 $splitCondition[1] = $fieldName; 3062 $dataStruct['ROOT
']['TCEforms
']['displayCond
'] = join(':
', $splitCondition); 3063 $fakeRow = array($fieldName => $fieldValue); 3065 case 'HIDE_FOR_NON_ADMINS
': 3069 case 'HIDE_L10N_SIBLINGS
': 3074 $fakeRow = array('uid
' => $row['uid
']); 3077 $skipCondition = TRUE; 3079 $displayConditionResult = TRUE; 3080 if ($dataStruct['ROOT
']['TCEforms
']['displayCond
']) { 3081 $displayConditionResult = $elementConditionMatcher->match($dataStruct['ROOT
']['TCEforms
']['displayCond
'], $fakeRow, 'vDEF
'); 3083 // If sheets displayCond leads to false 3084 if (!$skipCondition && !$displayConditionResult) { 3085 // Don't create
this sheet
3090 if (is_array($dataStruct[
'ROOT']) && is_array($dataStruct[
'ROOT'][
'el'])) {
3092 $PA[
'_valLang'] = $langChildren && !$langDisabled ? $editData[
'meta'][
'currentLangId'] :
'DEF';
3093 $PA[
'_lang'] = $lang;
3096 $PA[
'_cshKey'] = $table .
'.' . $field;
3097 foreach ($dsPointerFields as $key) {
3098 $PA[
'_cshKey'] .=
'.' . $row[$key];
3101 $tabIdentString =
'';
3102 if (is_array($dataStructArray[
'sheets'])) {
3103 $tabIdentString = $this->
getDocumentTemplate()->getDynTabMenuId(
'TCEFORMS:flexform:' . $PA[
'itemFormElName'] . $PA[
'_lang']);
3107 $tRows = $this->getSingleField_typeFlex_draw($dataStruct[
'ROOT'][
'el'], $editData[
'data'][$sheet][$lang], $table, $field, $row, $PA,
'[data][' . $sheet .
'][' . $lang .
']');
3108 $sheetContent =
'<div class="typo3-TCEforms-flexForm">' . $tRows .
'</div>';
3110 if (is_array($dataStructArray[
'sheets'])) {
3114 $sheetContent =
'Data Structure ERROR: No ROOT element found for sheet "' . $sheet .
'".';
3117 $tabParts[] = array(
3118 'label' => $dataStruct[
'ROOT'][
'TCEforms'][
'sheetTitle'] ? $this->
sL($dataStruct[
'ROOT'][
'TCEforms'][
'sheetTitle']) : $sheet,
3119 'description' => $dataStruct[
'ROOT'][
'TCEforms'][
'sheetDescription'] ? $this->
sL($dataStruct[
'ROOT'][
'TCEforms'][
'sheetDescription']) :
'',
3120 'linkTitle' => $dataStruct[
'ROOT'][
'TCEforms'][
'sheetShortDescr'] ? $this->
sL($dataStruct[
'ROOT'][
'TCEforms'][
'sheetShortDescr']) :
'',
3121 'content' => $sheetContent
3124 if (is_array($dataStructArray[
'sheets'])) {
3125 $dividersToTabsBehaviour = isset(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'dividers2tabs']) ?
$GLOBALS[
'TCA'][$table][
'ctrl'][
'dividers2tabs'] : 1;
3126 $item .= $this->
getDynTabMenu($tabParts,
'TCEFORMS:flexform:' . $PA[
'itemFormElName'] . $PA[
'_lang'], $dividersToTabsBehaviour);
3128 $item .= $sheetContent;
3132 $item =
'Data Structure ERROR: ' . $dataStructArray;
3149 foreach ($languages as $lArr) {
3150 $opt[] =
'<option value="' . htmlspecialchars($lArr[
'ISOcode']) .
'"' 3151 . (in_array($lArr[
'ISOcode'], $selectedLanguage) ?
' selected="selected"' :
'') .
'>' 3152 . htmlspecialchars($lArr[
'title']) .
'</option>';
3154 $output =
'<select id="' . str_replace(
'.',
'', uniqid(
'tceforms-multiselect-', TRUE))
3155 .
' class="tceforms-select tceforms-multiselect tceforms-flexlangmenu" name="' . $elName .
'[]"' 3156 . ($multi ?
' multiple="multiple" size="' . count($languages) .
'"' :
'') .
'>' . implode(
'', $opt)
3172 $pct = round(100 / count($sArr));
3173 foreach ($sArr as $sKey => $sheetCfg) {
3175 $onClick =
'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){' 3176 . $this->
elName($elName) .
'.value=\'' . $sKey .
'\'; TBE_EDITOR.submitForm()};
'; 3178 $onClick = 'if(TBE_EDITOR.checkSubmit(-1)){
' . $this->elName($elName) . '.value=\
'' . $sKey .
'\'; TBE_EDITOR.submitForm();}
'; 3180 $tCells[] = '<td width=
"' . $pct . '%" style=
"' 3181 . ($sKey == $sheetKey ? 'background-color: #9999cc; font-weight: bold;' : 'background-color: #aaaaaa;') 3182 . ' cursor: hand;" onclick=
"' . htmlspecialchars($onClick) . '" align=
"center">
' 3183 . ($sheetCfg['ROOT
']['TCEforms
']['sheetTitle
'] ? $this->sL($sheetCfg['ROOT
']['TCEforms
']['sheetTitle
']) : $sKey) 3186 return '<table border=
"0" cellpadding=
"0" cellspacing=
"2" class=
"typo3-TCEforms-flexForm-sheetMenu"><tr>
' . implode('', $tCells) . '</tr></table>
'; 3205 public function getSingleField_typeFlex_draw($dataStruct, $editData, $table, $field, $row, &$PA, $formPrefix = '', $level = 0, $idPrefix = 'ID
', $toggleClosed = FALSE) { 3207 $mayRestructureFlexforms = $this->getBackendUserAuthentication()->checkLanguageAccess(0); 3208 // Data Structure array must be ... and array of course... 3209 if (is_array($dataStruct)) { 3210 foreach ($dataStruct as $key => $value) { 3211 // Traversing fields in structure: 3212 if (is_array($value)) { 3213 // The value of each entry must be an array. 3214 // ******************** 3216 // ******************** 3218 // <title>LLL:EXT:cms/locallang_ttc.xml:media.sources</title> 3219 $theTitle = $value['title
']; 3221 // If there is a title, check for LLL label 3222 if (strlen($theTitle) > 0) { 3223 $theTitle = htmlspecialchars(GeneralUtility::fixed_lgd_cs($this->sL($theTitle), 3224 (int)$this->getBackendUserAuthentication()->uc['titleLen
'])); 3226 // If it's a
"section" or
"container":
3227 if ($value[
'type'] ==
'array') {
3232 $thisId = GeneralUtility::shortMd5(uniqid(
'id', TRUE));
3235 $idTagPrefix = $idPrefix .
'-' . $thisId;
3237 if ($value[
'section']) {
3241 $output .=
'<div class="t3-form-field-label-flexsection"><strong>' . $theTitle .
'</strong></div>';
3244 if (is_array($editData[$key][
'el'])) {
3245 foreach ($editData[$key][
'el'] as $k3 => $v3) {
3247 if (is_array($v3)) {
3248 $theType = key($v3);
3249 $theDat = $v3[$theType];
3250 $newSectionEl = $value[
'el'][$theType];
3251 if (is_array($newSectionEl)) {
3252 $tRows[] = $this->getSingleField_typeFlex_draw(array($theType => $newSectionEl),
3253 array($theType => $theDat), $table, $field, $row, $PA,
3254 $formPrefix .
'[' . $key .
'][el][' . $cc .
']', $level + 1,
3255 $idTagPrefix, $v3[
'_TOGGLE']);
3268 $newElementsLinks = array();
3269 foreach ($value[
'el'] as $nnKey => $nCfg) {
3271 $this->additionalJS_post = array();
3273 $this->additionalJS_submit = array();
3274 $newElementTemplate = $this->getSingleField_typeFlex_draw(array($nnKey => $nCfg),
3275 array(), $table, $field, $row, $PA,
3276 $formPrefix .
'[' . $key .
'][el][' . $idTagPrefix .
'-form]', $level + 1,
3279 $var = str_replace(
'.',
'', uniqid(
'idvar', TRUE));
3280 $replace =
'replace(/' . $idTagPrefix .
'-/g,"' . $idTagPrefix .
'-"+' . $var .
'+"-")';
3281 $replace .=
'.replace(/(tceforms-(datetime|date)field-)/g,"$1" + (new Date()).getTime())';
3282 $onClickInsert =
'var ' . $var .
' = "' .
'idx"+(new Date()).getTime();' 3284 .
'new Insertion.Bottom($("' . $idTagPrefix .
'"), ' . json_encode($newElementTemplate)
3285 .
'.' . $replace .
'); setActionStatus("' . $idTagPrefix .
'");' 3286 .
'eval(unescape("' . rawurlencode(implode(
';', $this->additionalJS_post)) .
'").' . $replace .
');' 3287 .
'TBE_EDITOR.addActionChecks("submit", unescape("' 3288 . rawurlencode(implode(
';', $this->additionalJS_submit)) .
'").' . $replace .
');' 3289 .
'TYPO3.TCEFORMS.update();' 3295 $this->additionalJS_post = $additionalJS_post_saved;
3296 $this->additionalJS_submit = $additionalJS_submit_saved;
3298 if (isset($nCfg[
'title'])) {
3299 $title = $this->
sL($nCfg[
'title']);
3300 } elseif (isset($nCfg[
'tx_templavoila'][
'title'])) {
3303 'Flexform data for table ' . $table .
', field ' . $field
3304 .
'contains the <tx_templavoila><title>... construct deprecated since TYPO3 4.7. ' 3305 .
'The <tx_templavoila> element has to be removed now. Support will be removed two versions after 6.2.' 3307 $title = $this->
sL($nCfg[
'tx_templavoila'][
'title']);
3309 $newElementsLinks[] =
'<a href="#" onclick="' . htmlspecialchars($onClickInsert) .
'">' 3314 $this->requiredElements = $TEMP_requiredElements;
3316 $toggleAll = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.toggleall', TRUE);
3318 <div class="t3-form-field-toggle-flexsection"> 3319 <a href="#" onclick="' . htmlspecialchars((
'flexFormToggleSubs("' . $idTagPrefix
3320 .
'"); return false;')) .
'">' 3325 <div id="' . $idTagPrefix .
'" class="t3-form-field-container-flexsection">' . implode(
'', $tRows) .
'</div>';
3326 $output .= $mayRestructureFlexforms ?
'<div class="t3-form-field-add-flexsection"><strong>' 3327 . $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.addnew', TRUE)
3328 .
':</strong> ' . implode(
' | ', $newElementsLinks) .
'</div>' :
'';
3334 $onClickRemove =
'if (confirm("Are you sure?")){/*###REMOVE###*/;$("' . $idTagPrefix
3335 .
'").hide();setActionStatus("' . $idPrefix .
'");} return false;';
3336 $onClickToggle =
'flexFormToggle("' . $idTagPrefix .
'"); return false;';
3337 $onMove =
'flexFormSortable("' . $idPrefix .
'")';
3349 <table class="t3-form-field-header-flexsection" onmousedown="' . ($mayRestructureFlexforms ? htmlspecialchars($onMove) :
'') .
'"> 3352 <a href="#" onclick="' . htmlspecialchars($onClickToggle) .
'" id="' . $idTagPrefix .
'-toggle"> 3353 ' . ($toggleClosed ? $toggleIcon_close : $toggleIcon_open) .
' 3355 <strong>' . $theTitle .
'</strong> <em><span id="' . $idTagPrefix .
'-preview"></span></em> 3359 . ($mayRestructureFlexforms ?
'<a href="#" onclick="' . htmlspecialchars($onClickRemove) .
'">' 3365 $actionFieldName =
'_ACTION_FLEX_FORM' . $PA[
'itemFormElName'] . $s[0] .
'][_ACTION][' . $s[1];
3369 $this->additionalJS_delete = array();
3370 $singleField_typeFlex_draw = $this->getSingleField_typeFlex_draw($value[
'el'],
3371 $editData[$key][
'el'], $table, $field, $row, $PA,
3372 ($formPrefix .
'[' . $key .
'][el]'), ($level + 1), $idTagPrefix);
3374 <div id="' . $idTagPrefix .
'" class="t3-form-field-container-flexsections"> 3375 <input id="' . $idTagPrefix .
'-action" type="hidden" name="' . htmlspecialchars($actionFieldName) .
'" value=""/> 3378 <div class="t3-form-field-record-flexsection" id="' . $idTagPrefix .
'-content"' 3379 . ($toggleClosed ?
' style="display:none;"' :
'') .
'>' . $singleField_typeFlex_draw .
' 3381 <input id="' . $idTagPrefix .
'-toggleClosed" type="hidden" name="' 3382 . htmlspecialchars(
'data[' . $table .
'][' . $row[
'uid'] .
'][' . $field .
']' . $formPrefix .
'[_TOGGLE]')
3383 .
'" value="' . ($toggleClosed ? 1 : 0) .
'" /> 3385 $output = str_replace(
'/*###REMOVE###*/', htmlspecialchars(implode(
'', $this->additionalJS_delete), ENT_QUOTES), $output);
3394 } elseif (is_array($value[
'TCEforms'][
'config'])) {
3396 if (is_array($PA[
'_valLang'])) {
3397 $rotateLang = $PA[
'_valLang'];
3399 $rotateLang = array($PA[
'_valLang']);
3401 $conditionData = is_array($editData) ? $editData : array();
3403 $conditionData[
'parentRec'] = $row;
3409 foreach ($rotateLang as $vDEFkey) {
3410 $vDEFkey =
'v' . $vDEFkey;
3411 $displayConditionResult = TRUE;
3412 if ($value[
'TCEforms'][
'displayCond']) {
3413 $displayConditionResult = $elementConditionMatcher->match($value[
'TCEforms'][
'displayCond'], $conditionData, $vDEFkey);
3415 if ($displayConditionResult) {
3417 $fakePA[
'fieldConf'] = array(
3418 'label' => $this->
sL(trim($value[
'TCEforms'][
'label'])),
3419 'config' => $value[
'TCEforms'][
'config'],
3420 'defaultExtras' => $value[
'TCEforms'][
'defaultExtras'],
3421 'onChange' => $value[
'TCEforms'][
'onChange']
3423 if ($PA[
'_noEditDEF'] && $PA[
'_lang'] ===
'lDEF') {
3424 $fakePA[
'fieldConf'][
'config'] = array(
3430 $fakePA[
'fieldConf'][
'onChange'] ===
'reload' 3431 || !empty(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'])
3432 && (
string)$key ===
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type']
3433 || !empty(
$GLOBALS[
'TCA'][$table][
'ctrl'][
'requestUpdate'])
3437 $alertMsgOnChange =
'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
3439 $alertMsgOnChange =
'if(TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm();}';
3442 $alertMsgOnChange =
'';
3444 $fakePA[
'fieldChangeFunc'] = $PA[
'fieldChangeFunc'];
3445 if (strlen($alertMsgOnChange)) {
3446 $fakePA[
'fieldChangeFunc'][
'alert'] = $alertMsgOnChange;
3448 $fakePA[
'onFocus'] = $PA[
'onFocus'];
3449 $fakePA[
'label'] = $PA[
'label'];
3450 $fakePA[
'itemFormElName'] = $PA[
'itemFormElName'] . $formPrefix .
'[' . $key .
'][' . $vDEFkey .
']';
3451 $fakePA[
'itemFormElName_file'] = $PA[
'itemFormElName_file'] . $formPrefix .
'[' . $key .
'][' . $vDEFkey .
']';
3452 $fakePA[
'itemFormElID'] = $fakePA[
'itemFormElName'];
3453 if (isset($editData[$key][$vDEFkey])) {
3454 $fakePA[
'itemFormElValue'] = $editData[$key][$vDEFkey];
3456 $fakePA[
'itemFormElValue'] = $fakePA[
'fieldConf'][
'config'][
'default'];
3459 $theTitle = htmlspecialchars($fakePA[
'fieldConf'][
'label']);
3460 if (!in_array(
'DEF', $rotateLang)) {
3461 $defInfo =
'<div class="typo3-TCEforms-originalLanguageValue">' 3462 . $this->getLanguageIcon($table, $row, 0)
3463 . $this->
previewFieldValue($editData[$key][
'vDEF'], $fakePA[
'fieldConf'], $field)
3468 if (!$PA[
'_noEditDEF']) {
3470 foreach ($prLang as $prL) {
3471 $defInfo .=
'<div class="typo3-TCEforms-originalLanguageValue">' 3472 . $this->getLanguageIcon($table, $row, (
'v' . $prL[
'ISOcode']))
3473 . $this->
previewFieldValue($editData[$key][(
'v' . $prL[
'ISOcode'])], $fakePA[
'fieldConf'], $field)
3478 if ($vDEFkey !=
'vDEF') {
3479 $languageIcon = $this->getLanguageIcon($table, $row, $vDEFkey);
3484 $processedTitle = str_replace(
'\\n',
'<br />', $theTitle);
3485 $tRows[] =
'<div class="t3-form-field-container t3-form-field-container-flex">' 3486 .
'<div class="t3-form-field-label t3-form-field-label-flex">' . $languageIcon
3488 <div class="t3-form-field t3-form-field-flex">' . $theFormEl . $defInfo
3493 if (count($tRows)) {
3494 $output .= implode(
'', $tRows);
3514 $item =
'Unknown type: ' . $PA[
'fieldConf'][
'config'][
'form_type'] .
'<br />';
3529 $PA[
'table'] = $table;
3530 $PA[
'field'] = $field;
3532 $PA[
'parameters'] = isset($PA[
'fieldConf'][
'config'][
'parameters']) ? $PA[
'fieldConf'][
'config'][
'parameters'] : array();
3533 $PA[
'pObj'] = &$this;
3552 $format = trim($config[
'format']);
3556 $option = trim($config[
'format.'][
'option']);
3558 if ($config[
'format.'][
'strftime']) {
3559 $value = strftime($option, $itemValue);
3561 $value = date($option, $itemValue);
3564 $value = date(
'd-m-Y', $itemValue);
3569 if ($config[
'format.'][
'appendAge']) {
3571 $GLOBALS[
'EXEC_TIME'] - $itemValue,
3572 $this->
getLanguageService()->
sL(
'LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')
3574 $value .=
' (' . $age .
')';
3576 $itemValue = $value;
3580 if ($itemValue !==
'') {
3581 $itemValue = date(
'H:i d-m-Y', (
int)$itemValue);
3586 if ($itemValue !==
'') {
3587 $itemValue = date(
'H:i', (
int)$itemValue);
3592 if ($itemValue !==
'') {
3593 $itemValue = date(
'H:i:s', (
int)$itemValue);
3598 if ($itemValue !==
'') {
3599 $itemValue = date(
'Y', (
int)$itemValue);
3603 $baseArr = array(
'dec' =>
'd',
'hex' =>
'x',
'HEX' =>
'X',
'oct' =>
'o',
'bin' =>
'b');
3604 $base = trim($config[
'format.'][
'base']);
3605 $format = $baseArr[$base] ?:
'd';
3606 $itemValue = sprintf(
'%' . $format, $itemValue);
3610 $itemValue = sprintf(
'%.' . $precision .
'f', $itemValue);
3613 $format = trim($config[
'format.'][
'option']);
3614 $itemValue = sprintf(
'%' . $format, $itemValue);
3617 $itemValue = md5($itemValue);
3623 if ($config[
'format.'][
'appendByteSize']) {
3624 $value .=
' (' . $itemValue .
')';
3626 $itemValue = $value;
3629 $func = trim($config[
'format.'][
'userFunc']);
3632 'value' => $itemValue,
3633 'args' => $config[
'format.'][
'userFunc'],
3634 'config' => $config,
3662 $field =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'type'];
3664 if (strpos($field,
':') !== FALSE) {
3665 list($pointerField, $foreignTypeField) = explode(
':', $field);
3666 $fieldConfig =
$GLOBALS[
'TCA'][$table][
'columns'][$pointerField][
'config'];
3667 $relationType = $fieldConfig[
'type'];
3668 if ($relationType ===
'select') {
3669 $foreignUid = $row[$pointerField];
3670 $foreignTable = $fieldConfig[
'foreign_table'];
3671 } elseif ($relationType ===
'group') {
3674 $allowedTables = explode(
',', $fieldConfig[
'allowed']);
3676 $foreignTable = $allowedTables[0];
3678 throw new \RuntimeException(
'TCA Foreign field pointer fields are only allowed to be used with group or select field types.', 1325861239);
3681 $foreignRow = BackendUtility::getRecord($foreignTable, $foreignUid, $foreignTypeField);
3682 $this->registerDefaultLanguageData($foreignTable, $foreignRow);
3683 if ($foreignRow[$foreignTypeField]) {
3684 $foreignTypeFieldConfig =
$GLOBALS[
'TCA'][$table][
'columns'][$field];
3689 $typeFieldConfig =
$GLOBALS[
'TCA'][$table][
'columns'][$field];
3693 if (empty($typeNum)) {
3698 if (!
$GLOBALS[
'TCA'][$table][
'types'][$typeNum]) {
3699 $typeNum =
$GLOBALS[
'TCA'][$table][
'types'][
'0'] ? 0 : 1;
3702 $typeNum = (string) $typeNum;
3716 $newFields = array();
3717 foreach ($fields as $cc => $content) {
3719 if (isset($fO[$cP[0]])) {
3720 $newFields[$fO[$cP[0]]] = $content;
3721 unset($fields[$cc]);
3726 $fields = array_merge($newFields, $fields);
3744 $excludeElements = array();
3746 if (
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'subtype_value_field']) {
3747 $sTfield =
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'subtype_value_field'];
3748 if (trim(
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'subtypes_excludelist'][$row[$sTfield]])) {
3753 if (
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'bitmask_value_field']) {
3754 $sTfield =
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'bitmask_value_field'];
3756 if (is_array(
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'bitmask_excludelist_bits'])) {
3757 foreach (
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'bitmask_excludelist_bits'] as $bitKey => $eList) {
3758 $bit = substr($bitKey, 1);
3761 if ($bitKey[0] ===
'-' && !($sTValue & pow(2, $bit)) || $bitKey[0] ===
'+' && $sTValue & pow(2, $bit)) {
3769 return $excludeElements;
3784 $addElements = array();
3787 if (
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'subtype_value_field']) {
3788 $sTfield =
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'subtype_value_field'];
3789 if (trim(
$GLOBALS[
'TCA'][$table][
'types'][$typeNum][
'subtypes_addlist'][$row[$sTfield]])) {
3794 return array($addElements, $sTfield);
3808 if (count($fieldsToAdd[0])) {
3811 foreach ($fields as $fieldInfo) {
3813 if ($fieldName === $fieldsToAdd[1]) {
3815 } elseif ($fieldName ===
'--palette--' && $paletteName && $table !==
'') {
3817 if (is_array(
$GLOBALS[
'TCA'][$table][
'palettes'][$paletteName])) {
3818 $itemList =
$GLOBALS[
'TCA'][$table][
'palettes'][$paletteName][
'showitem'];
3821 foreach ($paletteFields as $info) {
3823 $theField = $fieldParts[0];
3824 if ($theField === $fieldsToAdd[1]) {
3833 array_splice($fields, $c + 1, 0, $fieldsToAdd[0]);
3855 $mainKey = $table .
':' . $row[
'uid'];
3856 if (!isset($this->cachedTSconfig[$mainKey])) {
3860 return $this->cachedTSconfig[$mainKey][$field];
3862 return $this->cachedTSconfig[$mainKey];
3878 if (is_array($TSconfig)) {
3880 $type = $fieldConfig[
'type'];
3881 if (is_array($TSconfig[
'config']) && is_array($this->allowOverrideMatrix[$type])) {
3883 foreach ($TSconfig[
'config'] as $key => $_) {
3884 if (!in_array($key, $this->allowOverrideMatrix[$type], TRUE)) {
3885 unset($TSconfig[
'config'][$key]);
3889 if (count($TSconfig[
'config'])) {
3894 return $fieldConfig;
3912 if (is_array($types_fieldConfig)) {
3913 foreach ($types_fieldConfig as $vconf) {
3915 if ($vconf[
'field'] == $field) {
3916 return $vconf[
'spec'];
3950 if (
$GLOBALS[
'TCA'][$table] && (is_array(
$GLOBALS[
'TCA'][$table][
'palettes'][$palette]) || $itemList)) {
3951 $itemList = $itemList ? $itemList :
$GLOBALS[
'TCA'][$table][
'palettes'][$palette][
'showitem'];
3954 foreach ($fields as $info) {
3956 $theField = $fieldParts[0];
3957 if ($theField ===
'--linebreak--') {
3958 $parts[][
'NAME'] =
'--linebreak--';
3959 } elseif (!in_array($theField, $excludeElements) &&
$GLOBALS[
'TCA'][$table][
'columns'][$theField]) {
3960 $this->palFieldArr[$palette][] = $theField;
3961 $elem = $this->getSingleField($table, $theField, $row, $fieldParts[1], 1,
'', $fieldParts[2]);
3962 if (is_array($elem)) {
3988 public function registerDefaultLanguageData($table, $rec) {
3991 $GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField'] && $rec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']] > 0
3992 &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']
3993 && (
int)$rec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']] > 0
3995 $lookUpTable =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerTable']
3996 ?
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerTable']
4001 (
int)$rec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']]
4004 if (
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigDiffSourceField']) {
4005 $this->defaultLanguageData_diff[$table .
':' . $rec[
'uid']] = unserialize($rec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigDiffSourceField']]);
4009 foreach ($prLang as $prL) {
4012 $tInfo = $t8Tools->translationInfo($lookUpTable, (
int)$rec[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']], $prL[
'uid']);
4013 if (is_array($tInfo[
'translations']) && is_array($tInfo[
'translations'][$prL[
'uid']])) {
4014 $this->additionalPreviewLanguageData[$table .
':' . $rec[
'uid']][$prL[
'uid']] =
BackendUtility::getRecordWSOL($table, (
int)$tInfo[
'translations'][$prL[
'uid']][
'uid']);
4033 $value = $row[$field];
4034 if (is_array($this->defaultLanguageData[$table .
':' . $row[
'uid']])) {
4036 $fieldConf[
'l10n_mode'] ==
'exclude' 4037 || $fieldConf[
'l10n_mode'] ==
'mergeIfNotBlank' && trim($this->defaultLanguageData[$table .
':' . $row[
'uid']][$field]) !==
'' 4039 $value = $this->defaultLanguageData[$table .
':' . $row[
'uid']][$field];
4059 if (is_array($this->defaultLanguageData[$table .
':' . $row[
'uid']])) {
4060 $defaultLanguageValue = BackendUtility::getProcessedValue($table, $field, $this->defaultLanguageData[$table .
':' . $row[
'uid']][$field], 0, 1, FALSE, $this->defaultLanguageData[$table .
':' . $row[
'uid']][
'uid']);
4061 $fieldConfig =
$GLOBALS[
'TCA'][$table][
'columns'][$field];
4063 if ($fieldConfig[
'config'][
'type'] !=
'inline') {
4064 if ($defaultLanguageValue !==
'') {
4065 $item .=
'<div class="typo3-TCEforms-originalLanguageValue">' . $this->getLanguageIcon($table, $row, 0)
4067 . $this->
previewFieldValue($defaultLanguageValue, $fieldConfig, $field) .
' </div>';
4070 foreach ($previewLanguages as $previewLanguage) {
4071 $defaultLanguageValue = BackendUtility::getProcessedValue($table, $field, $this->additionalPreviewLanguageData[$table .
':' . $row[
'uid']][$previewLanguage[
'uid']][$field], 0, 1);
4072 if ($defaultLanguageValue !==
'') {
4073 $item .=
'<div class="typo3-TCEforms-originalLanguageValue">' 4074 . $this->getLanguageIcon($table, $row, (
'v' . $previewLanguage[
'ISOcode']))
4076 . $this->
previewFieldValue($defaultLanguageValue, $fieldConfig, $field) .
' </div>';
4098 if (is_array($this->defaultLanguageData_diff[$table .
':' . $row[
'uid']])) {
4101 'old' => $this->defaultLanguageData_diff[$table .
':' . $row[
'uid']],
4102 'new' => $this->defaultLanguageData[$table .
':' . $row[
'uid']]
4105 if (isset($dLVal[
'old'][$field])) {
4106 if ((
string)$dLVal[
'old'][$field] !== (
string)$dLVal[
'new'][$field]) {
4109 $diffres = $t3lib_diff_Obj->makeDiffDisplay(
4110 BackendUtility::getProcessedValue($table, $field, $dLVal[
'old'][$field], 0, 1),
4111 BackendUtility::getProcessedValue($table, $field, $dLVal[
'new'][$field], 0, 1)
4113 $item .=
'<div class="typo3-TCEforms-diffBox">' .
'<div class="typo3-TCEforms-diffBox-header">' 4114 . htmlspecialchars($this->
getLL(
'l_changeInOrig')) .
':</div>' . $diffres .
'</div>';
4133 $GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'flexFormXMLincludeDiffBase'] && isset($vArray[$vDEFkey .
'.vDEFbase'])
4134 && (
string)$vArray[$vDEFkey .
'.vDEFbase'] !== (
string)$vArray[
'vDEF']
4138 $diffres = $t3lib_diff_Obj->makeDiffDisplay($vArray[$vDEFkey .
'.vDEFbase'], $vArray[
'vDEF']);
4139 $item =
'<div class="typo3-TCEforms-diffBox">' .
'<div class="typo3-TCEforms-diffBox-header">' 4140 . htmlspecialchars($this->
getLL(
'l_changeInOrig')) .
':</div>' . $diffres .
'</div>';
4168 public function dbFileIcons($fName, $mode, $allowed, $itemArray, $selector =
'', $params = array(), $onFocus =
'', $table =
'', $field =
'',
$uid =
'', $config = array()) {
4170 if ($this->renderReadonly || $params[
'readOnly']) {
4171 $disabled =
' disabled="disabled"';
4174 $this->printNeededJS[
'dbFileIcons'] = 1;
4180 if (is_array($itemArray)) {
4181 $itemArrayC = count($itemArray);
4184 foreach ($itemArray as $pp) {
4186 if (is_array($pRec)) {
4188 $pUid = $pp[
'table'] .
'_' . $pp[
'id'];
4190 $title = htmlspecialchars($pTitle);
4191 $opt[] =
'<option value="' . htmlspecialchars($pUid) .
'" title="' . $title .
'">' . $title .
'</option>';
4195 case 'file_reference':
4198 foreach ($itemArray as $item) {
4199 $itemParts = explode(
'|', $item);
4200 $uidList[] = ($pUid = ($pTitle = $itemParts[0]));
4201 $title = htmlspecialchars(rawurldecode($itemParts[1]));
4202 $opt[] =
'<option value="' . htmlspecialchars(rawurldecode($itemParts[0])) .
'" title="' . $title .
'">' . $title .
'</option>';
4206 foreach ($itemArray as $pp) {
4207 $pParts = explode(
'|', $pp);
4208 $uidList[] = ($pUid = ($pTitle = $pParts[0]));
4209 $title = htmlspecialchars(rawurldecode($pParts[0]));
4210 $opt[] =
'<option value="' . htmlspecialchars(rawurldecode($pParts[0])) .
'" title="' . $title .
'">' . $title .
'</option>';
4214 foreach ($itemArray as $pp) {
4215 $pParts = explode(
'|', $pp, 2);
4216 $uidList[] = ($pUid = $pParts[0]);
4217 $pTitle = $pParts[1];
4218 $title = htmlspecialchars(rawurldecode($pTitle));
4219 $opt[] =
'<option value="' . htmlspecialchars(rawurldecode($pUid)) .
'" title="' . $title .
'">' . $title .
'</option>';
4224 $sSize = $params[
'autoSizeMax']
4228 $isMultiple = $params[
'maxitems'] != 1 && $params[
'size'] != 1;
4229 $selector =
'<select id="' . str_replace(
'.',
'', uniqid(
'tceforms-multiselect-', TRUE)) .
'" ' 4230 . ($params[
'noList'] ?
'style="display: none"' :
'size="' . $sSize .
'"' . $this->
insertDefStyle(
'group',
'tceforms-multiselect'))
4231 . ($isMultiple ?
' multiple="multiple"' :
'')
4232 .
' name="' . $fName .
'_list" ' . $onFocus . $params[
'style'] . $disabled .
'>' . implode(
'', $opt)
4239 $rOnClickInline =
'';
4240 if (!$params[
'readOnly'] && !$params[
'noList']) {
4241 if (!$params[
'noBrowser']) {
4243 $inlineParent = $this->
inline->getStructureLevel(-1);
4244 $aOnClickInline =
'';
4245 if (is_array($inlineParent) && $inlineParent[
'uid']) {
4246 if ($inlineParent[
'config'][
'foreign_table'] == $table && $inlineParent[
'config'][
'foreign_unique'] == $field) {
4248 $aOnClickInline = $objectPrefix .
'|inline.checkUniqueElement|inline.setUniqueElement';
4249 $rOnClickInline =
'inline.revertUnique(\'' . $objectPrefix .
'\',null,\
'' .
$uid .
'\');
'; 4252 if (is_array($config['appearance
']) && isset($config['appearance
']['elementBrowserType
'])) { 4253 $elementBrowserType = $config['appearance
']['elementBrowserType
']; 4255 $elementBrowserType = $mode; 4257 if (is_array($config['appearance
']) && isset($config['appearance
']['elementBrowserAllowed
'])) { 4258 $elementBrowserAllowed = $config['appearance
']['elementBrowserAllowed
']; 4260 $elementBrowserAllowed = $allowed; 4262 $aOnClick = 'setFormValueOpenBrowser(\
'' . $elementBrowserType .
'\',\
'' 4263 . ($fName .
'|||' . $elementBrowserAllowed .
'|' . $aOnClickInline) .
'\');
return false;
'; 4264 $spriteIcon = IconUtility::getSpriteIcon('actions-insert-record
', array( 4265 'title
' => htmlspecialchars($this->getLL('l_browse_
' . ($mode == 'db
' ? 'db
' : 'file
'))) 4267 $icons['R
'][] = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '">
' . $spriteIcon . '</a>
'; 4269 if (!$params['dontShowMoveIcons
']) { 4271 $icons['L
'][] = IconUtility::getSpriteIcon('actions-move-to-top
', array( 4272 'data-fieldname
' => $fName, 4273 'class' => 't3-btn t3-btn-moveoption-top
', 4274 'title
' => htmlspecialchars($this->getLL('l_move_to_top
')) 4277 $icons['L
'][] = IconUtility::getSpriteIcon('actions-move-up
', array( 4278 'data-fieldname
' => $fName, 4279 'class' => 't3-btn t3-btn-moveoption-up
', 4280 'title
' => htmlspecialchars($this->getLL('l_move_up
')) 4282 $icons['L
'][] = IconUtility::getSpriteIcon('actions-move-down
', array( 4283 'data-fieldname
' => $fName, 4284 'class' => 't3-btn t3-btn-moveoption-down
', 4285 'title
' => htmlspecialchars($this->getLL('l_move_down
')) 4288 $icons['L
'][] = IconUtility::getSpriteIcon('actions-move-to-bottom
', array( 4289 'data-fieldname
' => $fName, 4290 'class' => 't3-btn t3-btn-moveoption-bottom
', 4291 'title
' => htmlspecialchars($this->getLL('l_move_to_bottom
')) 4295 $clipElements = $this->getClipboardElements($allowed, $mode); 4296 if (count($clipElements)) { 4298 foreach ($clipElements as $elValue) { 4299 if ($mode == 'db
') { 4300 list($itemTable, $itemUid) = explode('|
', $elValue); 4301 $recordTitle = BackendUtility::getRecordTitle($itemTable, BackendUtility::getRecordWSOL($itemTable, $itemUid)); 4302 $itemTitle = GeneralUtility::quoteJSvalue($recordTitle); 4303 $elValue = $itemTable . '_
' . $itemUid; 4305 // 'file
', 'file_reference
' and 'folder
' mode 4306 $itemTitle = 'unescape(\
'' . rawurlencode(basename($elValue)) .
'\')
'; 4308 $aOnClick .= 'setFormValueFromBrowseWin(\
'' . $fName .
'\',unescape(\
'' 4309 . rawurlencode(str_replace(
'%20',
' ', $elValue)) .
'\'),
' . $itemTitle . ',
' . $itemTitle . ');
'; 4311 $aOnClick .= 'return false;
'; 4312 $spriteIcon1 = IconUtility::getSpriteIcon('actions-document-paste-into
', array( 4313 'title
' => htmlspecialchars(sprintf($this->getLL('l_clipInsert_
' . ($mode == 'db
' ? 'db
' : 'file
')), count($clipElements))) 4315 $icons['R
'][] = '<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '">
' . $spriteIcon1 . '</a>
'; 4318 if (!$params['readOnly
'] && !$params['noDelete
']) { 4319 $icons['L
'][] = IconUtility::getSpriteIcon('actions-selection-
delete', array( 4320 'onclick
' => $rOnClickInline, 4321 'data-fieldname
' => $fName, 4322 'class' => 't3-btn t3-btn-removeoption
', 4323 'title
' => htmlspecialchars($this->getLL('l_remove_selected
')) 4327 $imagesOnly = FALSE; 4328 if ($params['thumbnails
'] && $params['info
']) { 4329 // In case we have thumbnails, check if only images are allowed. 4330 // In this case, render them below the field, instead of to the right 4331 $allowedExtensionList = GeneralUtility::trimExplode(' ', strtolower($params['info
']), TRUE); 4332 $imageExtensionList = GeneralUtility::trimExplode(',
', strtolower($GLOBALS['TYPO3_CONF_VARS
']['GFX
']['imagefile_ext
']), TRUE); 4334 foreach ($allowedExtensionList as $allowedExtension) { 4335 if (!GeneralUtility::inArray($imageExtensionList, $allowedExtension)) { 4336 $imagesOnly = FALSE; 4343 $thumbnails = '<div
class=
"imagethumbs">
' . $this->wrapLabels($params['thumbnails
']) . '</div>
'; 4345 $rightbox = $this->wrapLabels($params['thumbnails
']); 4348 // Hook: dbFileIcons_postProcess (requested by FAL-team for use with the "fal" extension) 4349 if (is_array($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['t3lib/
class.t3lib_tceforms.php
']['dbFileIcons'])) { 4350 foreach ($GLOBALS['TYPO3_CONF_VARS
']['SC_OPTIONS
']['t3lib/
class.t3lib_tceforms.php
']['dbFileIcons'] as $classRef) { 4351 $hookObject = GeneralUtility::getUserObj($classRef); 4352 if (!$hookObject instanceof DatabaseFileIconsHookInterface) { 4353 throw new \UnexpectedValueException('$hookObject must implement
interface TYPO3\\CMS\\Backend\\Form\\DatabaseFileIconsHookInterface', 1290167704);
4355 $additionalParams = array(
4357 'allowed' => $allowed,
4358 'itemArray' => $itemArray,
4359 'onFocus' => $onFocus,
4363 'config' =>
$GLOBALS[
'TCA'][$table][
'columns'][$field]
4365 $hookObject->dbFileIcons_postProcess($params, $selector, $thumbnails,
$icons, $rightbox, $fName, $uidList, $additionalParams, $this);
4368 $str =
'<table border="0" cellpadding="0" cellspacing="0" width="1"> 4369 ' . ($params[
'headers'] ?
' 4371 <td>' . $this->
wrapLabels($params[
'headers'][
'selector']) .
'</td> 4374 <td>' . ($params[
'thumbnails'] ? $this->
wrapLabels($params[
'headers'][
'items']) :
'') .
'</td> 4377 <td valign="top">' . $selector . $thumbnails;
4378 if (!$params[
'noList'] && $params[
'info'] !==
'') {
4379 $str .=
'<span class="filetypes">' . $this->
wrapLabels($params[
'info']) .
'</span>';
4382 <td valign="top" class="icons">' . implode(
'<br />',
$icons[
'L']) .
'</td> 4383 <td valign="top" class="icons">' . implode(
'<br />',
$icons[
'R']) .
'</td> 4384 <td valign="top">' . $rightbox .
'</td> 4388 $str .=
'<input type="hidden" name="' . $fName .
'" value="' . htmlspecialchars(implode(
',', $uidList)) .
'" />';
4402 if (is_object($this->clipObj)) {
4404 case 'file_reference':
4407 $elFromTable = $this->clipObj->elFromTable(
'_FILE');
4411 foreach ($elFromTable as $elValue) {
4412 $pI = pathinfo($elValue);
4413 $ext = strtolower($pI[
'extension']);
4414 if (in_array($ext, $allowedExts)) {
4415 $output[] = $elValue;
4421 $output = $elFromTable;
4427 if (trim($allowedTables[0]) ===
'*') {
4428 $output = $this->clipObj->elFromTable(
'');
4431 foreach ($allowedTables as $tablename) {
4432 $elFromTable = $this->clipObj->elFromTable($tablename);
4433 $output = array_merge($output, $elFromTable);
4436 $output = array_keys($output);
4455 if ($this->enableClickMenu) {
4457 return '<a href="#" onclick="' . htmlspecialchars($onClick) .
'">' . $str .
'</a>';
4477 public function renderWizards($itemKinds, $wizConf, $table, $row, $field, &$PA, $itemName, $specConf, $RTE = FALSE) {
4479 $fieldChangeFunc = $PA[
'fieldChangeFunc'];
4480 $item = $itemKinds[0];
4482 $colorBoxLinks = array();
4483 $fName =
'[' . $table .
'][' . $row[
'uid'] .
'][' . $field .
']';
4484 $md5ID =
'ID' . GeneralUtility::shortmd5($itemName);
4485 $listFlag =
'_list';
4486 $fieldConfig = $PA[
'fieldConf'][
'config'];
4487 $prefixOfFormElName =
'data[' . $table .
'][' . $row[
'uid'] .
'][' . $field .
']';
4490 $flexFormPath = str_replace(
'][',
'/', substr($PA[
'itemFormElName'], strlen($prefixOfFormElName) + 1, -1));
4494 if ($PA[
'fieldConf'][
'config'][
'form_type'] ==
'select') {
4496 if ($PA[
'fieldConf'][
'config'][
'maxitems'] <= 1) {
4498 } elseif ($PA[
'fieldConf'][
'config'][
'renderMode'] ==
'singlebox') {
4504 if (is_array($wizConf) && !$this->disableWizards) {
4505 $parametersOfWizards = &$specConf[
'wizards'][
'parameters'];
4506 foreach ($wizConf as $wid => $wConf) {
4508 $wid[0] !==
'_' && (!$wConf[
'enableByTypeConfig']
4509 || is_array($parametersOfWizards) && in_array($wid, $parametersOfWizards)) && ($RTE || !$wConf[
'RTEonly'])
4512 $iTitle = htmlspecialchars($this->
sL($wConf[
'title']));
4513 if ($wConf[
'icon']) {
4514 $icon = $this->
getIconHtml($wConf[
'icon'], $iTitle, $iTitle);
4518 switch ((
string) $wConf[
'type']) {
4532 if ($wid !=
'RTE') {
4533 $params[
'fieldConfig'] = $fieldConfig;
4535 $params[
'params'] = $wConf[
'params'];
4536 $params[
'exampleImg'] = $wConf[
'exampleImg'];
4537 $params[
'table'] = $table;
4538 $params[
'uid'] = $row[
'uid'];
4539 $params[
'pid'] = $row[
'pid'];
4540 $params[
'field'] = $field;
4541 $params[
'flexFormPath'] = $flexFormPath;
4542 $params[
'md5ID'] = $md5ID;
4547 if (isset($wConf[
'module'][
'name'])) {
4548 $urlParameters = array();
4549 if (isset($wConf[
'module'][
'urlParameters']) && is_array($wConf[
'module'][
'urlParameters'])) {
4550 $urlParameters = $wConf[
'module'][
'urlParameters'];
4553 } elseif (isset($wConf[
'script'])) {
4555 'The way registering a wizard in TCA has changed in 6.2. ' 4556 .
'Please set module[name]=module_name instead of using script=path/to/script.php in your TCA. ' 4557 .
'The possibility to register wizards this way will be removed in TYPO3 CMS 7.' 4559 if (substr($wConf[
'script'], 0, 4) ===
'EXT:') {
4570 $parsedWizardUrl = parse_url($wConf[
'script']);
4571 if (in_array($parsedWizardUrl[
'path'], array(
4573 'wizard_colorpicker.php',
4580 'sysext/cms/layout/wizard_backend_layout.php' 4583 $urlParameters = array();
4584 if (isset($parsedWizardUrl[
'query'])) {
4585 parse_str($parsedWizardUrl[
'query'], $urlParameters);
4588 array(
'.php',
'browse_links',
'sysext/cms/layout/wizard_backend_layout'),
4589 array(
'',
'wizard_element_browser',
'wizard_backend_layout'),
4590 $parsedWizardUrl[
'path']
4593 unset(
$moduleName, $urlParameters, $parsedWizardUrl);
4595 $wScript = $wConf[
'script'];
4598 } elseif (in_array($wConf[
'type'], array(
'script',
'colorbox',
'popup'), TRUE)) {
4603 $url = ($wScript ?:
$this->backPath) . (strstr($wScript,
'?') ?
'' :
'?');
4605 if ((
string) $wConf[
'type'] ===
'script') {
4607 $outArr[] =
'<a href="' . htmlspecialchars($aUrl) .
'" onclick="this.blur(); return !TBE_EDITOR.isFormChanged();">' . $icon .
'</a>';
4611 $params[
'itemName'] = $itemName;
4612 $params[
'hmac'] =
GeneralUtility::hmac($params[
'formName'] . $params[
'itemName'],
'wizard_js');
4613 $params[
'fieldChangeFunc'] = $fieldChangeFunc;
4615 switch ((
string) $wConf[
'type']) {
4619 $addJS = $wConf[
'popup_onlyOpenIfSelected']
4620 ?
'if (!TBE_EDITOR.curSelected(\'' . $itemName . $listFlag .
'\')){alert(
' 4621 . GeneralUtility::quoteJSvalue($this->getLL('m_noSelItemForEdit
')) 4622 . ');
return false;}
' 4624 $curSelectedValues = '+\
'&P[currentSelectedValues]=\'+TBE_EDITOR.curSelected(\'' . $itemName . $listFlag .
'\')
'; 4625 $aOnClick = 'this.blur();
' . $addJS . 'vHWin=window.open(\
'' . $url
4627 .
'\'+\
'&P[currentValue]=\'+TBE_EDITOR.rawurlencode(' 4628 . $this->
elName($itemName) .
'.value,200)' . $curSelectedValues
4629 .
',\'popUp' . $md5ID .
'\',\
'' . $wConf[
'JSopenParams'] .
'\');
' 4630 . 'vHWin.focus();
return false;
'; 4631 // Setting "colorBoxLinks" - user LATER to wrap around the color box as well: 4632 $colorBoxLinks = array('<a href=
"#" onclick=
"' . htmlspecialchars($aOnClick) . '">
', '</a>
'); 4633 if ((string) $wConf['type
'] == 'popup
') { 4634 $outArr[] = $colorBoxLinks[0] . $icon . $colorBoxLinks[1]; 4639 $params['item
'] = &$item; 4640 $params['icon
'] = $icon; 4641 $params['iTitle
'] = $iTitle; 4642 $params['wConf
'] = $wConf; 4643 $params['row
'] = $row; 4644 $outArr[] = GeneralUtility::callUserFunction($wConf['userFunc
'], $params, $this); 4648 $params['item
'] = &$item; 4649 $params['icon
'] = $icon; 4650 $params['iTitle
'] = $iTitle; 4651 $params['wConf
'] = $wConf; 4652 $params['row
'] = $row; 4653 $wizard = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\Element\\ValueSlider
'); 4654 $outArr[] = call_user_func_array(array(&$wizard, 'renderWizard
'), array(&$params, &$this)); 4658 // Hide the real form element? 4659 if (is_array($wConf['hideParent
']) || $wConf['hideParent
']) { 4660 // Setting the item to a hidden-field. 4661 $item = $itemKinds[1]; 4662 if (is_array($wConf['hideParent
'])) { 4663 $item .= $this->getSingleField_typeNone_render($wConf['hideParent
'], $PA['itemFormElValue
']); 4669 $fieldValue = array('config
' => $wConf); 4670 $TSconfig = $this->setTSconfig($table, $row); 4671 $TSconfig[$field] = $TSconfig[$field]['wizards.
'][$wid . '.
']; 4672 $selItems = $this->addSelectOptionsToItemArray($this->initItemArray($fieldValue), $fieldValue, $TSconfig, $field); 4673 // Process items by a user function: 4674 if (!empty($wConf['itemsProcFunc
'])) { 4675 $funcConfig = !empty($wConf['itemsProcFunc.
']) ? $wConf['itemsProcFunc.
'] : array(); 4676 $selItems = $this->procItems($selItems, $funcConfig, $wConf, $table, $row, $field); 4679 $opt[] = '<option>
' . $iTitle . '</option>
'; 4680 foreach ($selItems as $p) { 4681 $opt[] = '<option value=
"' . htmlspecialchars($p[1]) . '">
' . htmlspecialchars($p[0]) . '</option>
'; 4683 if ($wConf['mode
'] == 'append
') { 4684 $assignValue = $this->elName($itemName) . '.value=\
'\'+this.options[this.selectedIndex].value+
' . $this->elName($itemName) . '.value
'; 4685 } elseif ($wConf['mode
'] == 'prepend
') { 4686 $assignValue = $this->elName($itemName) . '.value+=\
'\'+this.options[this.selectedIndex].value
'; 4688 $assignValue = $this->elName($itemName) . '.value=this.options[this.selectedIndex].value
'; 4690 $sOnChange = $assignValue . ';this.blur();this.selectedIndex=0;
' . implode('', $fieldChangeFunc); 4691 $outArr[] = '<select
id=
"' . str_replace('.', '', uniqid('tceforms-select-', TRUE)) 4692 . '" class=
"tceforms-select tceforms-wizardselect" name=
"_WIZARD' . $fName . '" onchange=
"' 4693 . htmlspecialchars($sOnChange) . '">
' . implode('', $opt) . '</select>
'; 4696 if (!empty($PA['fieldTSConfig
']['suggest.
']['default.
']['hide
'])) { 4699 $outArr[] = $this->suggest->renderSuggestSelector($PA['itemFormElName
'], $table, $field, $row, $PA); 4702 // Color wizard colorbox: 4703 if ((string) $wConf['type
'] === 'colorbox
') { 4704 $dim = GeneralUtility::intExplode('x
', $wConf['dim
']); 4705 $dX = MathUtility::forceIntegerInRange($dim[0], 1, 200, 20); 4706 $dY = MathUtility::forceIntegerInRange($dim[1], 1, 200, 20); 4707 $color = $PA['itemFormElValue
'] ? ' bgcolor=
"' . htmlspecialchars($PA['itemFormElValue']) . '"' : ''; 4708 $skinImg = IconUtility::skinImg( 4710 $color === '' ? 'gfx/colorpicker_empty.png
' : 'gfx/colorpicker.png
', 4711 'width=
"' . $dX . '" height=
"' . $dY . '"' . BackendUtility::titleAltAttrib(trim($iTitle . ' ' . $PA['itemFormElValue
'])) . ' border=
"0"' 4713 $outArr[] = '<table border=
"0" cellpadding=
"0" cellspacing=
"0" id=
"' . $md5ID . '"' . $color 4714 . ' style=
"' . htmlspecialchars($wConf['tableStyle']) . '">
4716 <td>
' . $colorBoxLinks[0] . '<img
' . $skinImg . '>
' . $colorBoxLinks[1] . '</td>
4722 // For each rendered wizard, put them together around the item. 4723 if (count($outArr)) { 4724 if ($wizConf['_HIDDENFIELD
']) { 4725 $item = $itemKinds[1]; 4727 $vAlign = $wizConf['_VALIGN
'] ? ' style=
"vertical-align:' . $wizConf['_VALIGN'] . '"' : ''; 4728 if (count($outArr) > 1 || $wizConf['_PADDING
']) { 4729 $dist = (int)$wizConf['_DISTANCE
']; 4730 if ($wizConf['_VERTICAL
']) { 4731 $dist = $dist ? '<tr><td><img src=
"clear.gif" width=
"1" height=
"' . $dist . '" alt=
"" /></td></tr>
' : ''; 4732 $outStr = '<tr><td>
' . implode(('</td></tr>
' . $dist . '<tr><td>
'), $outArr) . '</td></tr>
'; 4734 $dist = $dist ? '<td><img src=
"clear.gif" height=
"1" width=
"' . $dist . '" alt=
"" /></td>
' : ''; 4735 $outStr = '<tr><td
' . $vAlign . '>
' . implode(('</td>
' . $dist . '<td
' . $vAlign . '>
'), $outArr) . '</td></tr>
'; 4737 $outStr = '<table border=
"0" cellpadding=
"' . (int)$wizConf['_PADDING'] . '" cellspacing=
"' . (int)$wizConf['_PADDING'] . '">
' . $outStr . '</table>
'; 4739 $outStr = implode('', $outArr); 4741 if ($wizConf['_POSITION
'] === 'left
') { 4742 $outStr = '<tr><td
' . $vAlign . '>
' . $outStr . '</td><td
' . $vAlign . '>
' . $item . '</td></tr>
'; 4743 } elseif ($wizConf['_POSITION
'] === 'top
') { 4744 $outStr = '<tr><td>
' . $outStr . '</td></tr><tr><td>
' . $item . '</td></tr>
'; 4745 } elseif ($wizConf['_POSITION
'] === 'bottom
') { 4746 $outStr = '<tr><td>
' . $item . '</td></tr><tr><td>
' . $outStr . '</td></tr>
'; 4748 $outStr = '<tr><td
' . $vAlign . '>
' . $item . '</td><td
' . $vAlign . '>
' . $outStr . '</td></tr>
'; 4750 $item = '<table border=
"0" cellpadding=
"0" cellspacing=
"0">
' . $outStr . '</table>
'; 4763 public function getIcon($icon) { 4764 $selIconInfo = FALSE; 4765 if (substr($icon, 0, 4) == 'EXT:
') { 4766 $file = GeneralUtility::getFileAbsFileName($icon); 4768 $file = PathUtility::stripPathSitePrefix($file); 4769 $selIconFile = $this->backPath . '../
' . $file; 4770 $selIconInfo = @getimagesize((PATH_site . $file)); 4774 } elseif (substr($icon, 0, 3) == '../
') { 4775 $selIconFile = $this->backPath . GeneralUtility::resolveBackPath($icon); 4776 if (is_file(PATH_site . GeneralUtility::resolveBackPath(substr($icon, 3)))) { 4777 $selIconInfo = getimagesize((PATH_site . GeneralUtility::resolveBackPath(substr($icon, 3)))); 4779 } elseif (substr($icon, 0, 4) == 'ext/
' || substr($icon, 0, 7) == 'sysext/
') { 4780 $selIconFile = $this->backPath . $icon; 4781 if (is_file(PATH_typo3 . $icon)) { 4782 $selIconInfo = getimagesize(PATH_typo3 . $icon); 4785 $selIconFile = IconUtility::skinImg($this->backPath, 'gfx/
' . $icon, '', 1); 4786 $iconPath = substr($selIconFile, strlen($this->backPath)); 4787 if (is_file(PATH_typo3 . $iconPath)) { 4788 $selIconInfo = getimagesize(PATH_typo3 . $iconPath); 4791 if ($selIconInfo === FALSE) { 4792 // Unset to empty string if icon is not available 4795 return array($selIconFile, $selIconInfo); 4806 protected function getIconHtml($icon, $alt = '', $title = '') { 4807 $iconArray = $this->getIcon($icon); 4808 if (!empty($iconArray[0]) && is_file(GeneralUtility::resolveBackPath(PATH_typo3 . PATH_typo3_mod . $iconArray[0]))) { 4809 return '<img src=
"' . $iconArray[0] . '" alt=
"' . $alt . '" ' . ($title ? 'title=
"' . $title . '"' : '') . ' />
'; 4811 return IconUtility::getSpriteIcon($icon, array('alt
' => $alt, 'title
' => $title)); 4823 public function optionTagStyle($iconString) { 4827 list($selIconFile, $selIconInfo) = $this->getIcon($iconString); 4828 if (empty($selIconFile)) { 4829 // Skip background style if image is unavailable 4832 $padLeft = $selIconInfo[0] + 4; 4833 if ($padLeft >= 18 && $padLeft <= 24) { 4834 // In order to get the same padding for all option tags even if icon sizes differ a little, 4835 // set it to 22 if it was between 18 and 24 pixels 4838 $padTop = MathUtility::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0); 4839 $styleAttr = 'background: #fff url(
' . $selIconFile . ') 0% 50% no-repeat; height:
' 4840 . MathUtility::forceIntegerInRange(($selIconInfo[1] + 2 - $padTop), 0) 4841 . 'px; padding-top:
' . $padTop . 'px; padding-left:
' . $padLeft . 'px;
'; 4853 public function optgroupTagStyle($iconString) { 4857 list($selIconFile, $selIconInfo) = $this->getIcon($iconString); 4858 if (empty($selIconFile)) { 4859 // Skip background style if image is unavailable 4862 $padLeft = $selIconInfo[0] + 4; 4863 if ($padLeft >= 18 && $padLeft <= 24) { 4864 // In order to get the same padding for all option tags even if icon sizes differ a little, 4865 // set it to 22, if it was between 18 and 24 pixels. 4868 $padTop = MathUtility::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0); 4869 return 'background: #ffffff url(
' . $selIconFile . ') 0 0 no-repeat; padding-top:
' . $padTop . 'px; padding-left:
' . $padLeft . 'px;
'; 4879 public function extractValuesOnlyFromValueLabelList($itemFormElValue) { 4880 // Get values of selected items: 4881 $itemArray = GeneralUtility::trimExplode(',
', $itemFormElValue, TRUE); 4882 foreach ($itemArray as $tk => $tv) { 4883 $tvP = explode('|
', $tv, 2); 4884 $tvP[0] = rawurldecode($tvP[0]); 4885 $itemArray[$tk] = $tvP[0]; 4901 public function wrapOpenPalette($header, $table, $row, $palette, $retFunc) { 4902 $id = 'TCEFORMS_
' . $table . '_
' . $palette . '_
' . $row['uid
']; 4903 $res = '<a href=
"#" onclick=
"TBE_EDITOR.toggle_display_states(\'' . $id . '\',\'block\',\'none\'); return false;" >
' . $header . '</a>
'; 4904 return array($res, ''); 4918 public function wrapPaletteField($code, $table, $row, $palette, $collapsed) { 4919 $display = $collapsed ? 'none
' : 'block
'; 4920 $id = 'TCEFORMS_
' . $table . '_
' . $palette . '_
' . $row['uid
']; 4921 $code = '<div
id=
"' . $id . '" style=
"display:' . $display . ';" >
' . $code . '</div>
'; 4936 public function checkBoxParams($itemName, $thisValue, $c, $iCount, $addFunc = '') { 4937 $onClick = $this->elName($itemName) . '.value=this.checked?(
' . $this->elName($itemName) . '.value|
' . pow(2, $c) 4938 . '):(
' . $this->elName($itemName) . '.value&
' . (pow(2, $iCount) - 1 - pow(2, $c)) . ');
' . $addFunc; 4939 $str = ' onclick=
"' . htmlspecialchars($onClick) . '"' . ($thisValue & pow(2, $c) ? ' checked=
"checked"' : ''); 4950 public function elName($itemName) { 4951 return 'document.
' . $this->formName . '[\
'' . $itemName .
'\']
'; 4960 public function thisReturnUrl() { 4961 return $this->returnUrl ? $this->returnUrl : GeneralUtility::linkThisScript(); 4974 public function getSingleHiddenField($table, $field, $row) { 4976 if ($GLOBALS['TCA
'][$table]['columns
'][$field]) { 4978 $itemName = $this->prependFormFieldNames . '[
' . $table . '][
' . $uid . '][
' . $field . ']
'; 4979 $itemValue = $row[$field]; 4980 $item = '<input type=
"hidden" name=
"' . $itemName . '" value=
"' . htmlspecialchars($itemValue) . '" />
'; 4993 public function formWidth($size = 48, $textarea = FALSE) { 4994 $fieldWidthAndStyle = $this->formWidthAsArray($size, $textarea); 4995 // Setting width by style-attribute. 'cols
' MUST be avoided with NN6+ 4996 $widthAndStyleAttributes = ' style=
"' . htmlspecialchars($fieldWidthAndStyle['style']) . '"'; 4997 if ($fieldWidthAndStyle['class']) { 4998 $widthAndStyleAttributes .= ' class=
"' . htmlspecialchars($fieldWidthAndStyle['class']) . '"'; 5000 return $widthAndStyleAttributes; 5010 protected function formWidthAsArray($size = 48, $textarea = FALSE) { 5011 $fieldWidthAndStyle = array('style
' => '', 'class' => '', 'width
' => ''); 5012 $size = round($size * $this->form_largeComp); 5014 // Setting width by style-attribute. 'cols
' MUST be avoided with NN6+ 5015 $widthInPixels = ceil($size * $this->form_rowsToStylewidth); 5018 $widthInPixels += $this->form_additionalTextareaStyleWidth; 5021 $fieldWidthAndStyle['style
'] = 'width:
' . $widthInPixels . 'px;
' . $this->defStyle . $this->formElStyle($textarea ? 'text
' : 'input
'); 5022 $fieldWidthAndStyle['class'] = $this->formElClass($textarea ? 'text
' : 'input
'); 5023 return $fieldWidthAndStyle; 5035 public function formWidthText($size = 48, $wrap = '') { 5036 $wTags = $this->formWidth($size, TRUE); 5037 // Netscape 6+ seems to have this ODD problem where there WILL ALWAYS be wrapping 5038 // with the cols-attribute set and NEVER without the col-attribute... 5039 if (strtolower(trim($wrap)) != 'off
' && $GLOBALS['CLIENT
']['BROWSER
'] == 'net
' && $GLOBALS['CLIENT
']['VERSION
'] >= 5) { 5040 $wTags .= ' cols=
"' . $size . '"'; 5053 public function formElStyle($type) { 5054 return $this->formElStyleClassValue($type); 5065 public function formElClass($type) { 5066 return $this->formElStyleClassValue($type, TRUE); 5077 public function formElStyleClassValue($type, $class = FALSE) { 5078 // Get value according to field: 5079 if (isset($this->fieldStyle[$type])) { 5080 $style = trim($this->fieldStyle[$type]); 5082 $style = trim($this->fieldStyle['all
']); 5084 // Check class prefixed: 5085 if (substr($style, 0, 6) == 'CLASS:
') { 5086 $out = $class ? trim(substr($style, 6)) : ''; 5088 $out = !$class ? $style : ''; 5101 public function insertDefStyle($type, $additionalClass = '') { 5103 $style = trim($this->defStyle . $this->formElStyle($type)); 5104 $out .= $style ? ' style=
"' . htmlspecialchars($style) . '"' : ''; 5105 $class = $this->formElClass($type); 5106 $classAttributeValue = join(' ', array_filter(array($class, $additionalClass))); 5107 $out .= $classAttributeValue ? ' class=
"' . htmlspecialchars($classAttributeValue) . '"' : ''; 5120 public function getDynTabMenu($parts, $idString, $dividersToTabsBehaviour = 1) { 5121 $docTemplate = $this->getDocumentTemplate(); 5122 if (is_object($docTemplate)) { 5123 $docTemplate->backPath = $this->backPath; 5124 return $docTemplate->getDynTabMenu($parts, $idString, 0, FALSE, 1, FALSE, 1, $dividersToTabsBehaviour); 5127 foreach ($parts as $singlePad) { 5129 <h3>
' . htmlspecialchars($singlePad['label
']) . '</h3>
5130 ' . ($singlePad['description
'] ? '<p
class=
"c-descr">
' . nl2br(htmlspecialchars($singlePad['description
'])) . '</p>
' : '') . ' 5131 ' . $singlePad['content
']; 5133 return '<div
class=
"typo3-dyntabmenu-divs">
' . $output . '</div>
'; 5137 /************************************************************ 5139 * Item-array manipulation functions (check/select/radio) 5141 ************************************************************/ 5150 public function initItemArray($fieldValue) { 5152 if (is_array($fieldValue['config
']['items
'])) { 5153 foreach ($fieldValue['config
']['items
'] as $itemValue) { 5154 $items[] = array($this->sL($itemValue[0]), $itemValue[1], $itemValue[2]); 5168 public function addItems($items, $iArray) { 5169 if (is_array($iArray)) { 5170 foreach ($iArray as $value => $label) { 5171 $items[] = array($this->sl($label), $value); 5189 public function procItems($items, $iArray, $config, $table, $row, $field) { 5191 $params['items
'] = &$items; 5192 $params['config
'] = $config; 5193 $params['TSconfig
'] = $iArray; 5194 $params['table
'] = $table; 5195 $params['row
'] = $row; 5196 $params['field
'] = $field; 5197 // The itemsProcFunc method may throw an exception. 5198 // If it does display an error message and return items unchanged. 5200 GeneralUtility::callUserFunction($config['itemsProcFunc
'], $params, $this); 5201 } catch (\Exception $exception) { 5202 $fieldLabel = $field; 5203 if (isset($GLOBALS['TCA
'][$table]['columns
'][$field]['label
'])) { 5204 $fieldLabel = $this->sL($GLOBALS['TCA
'][$table]['columns
'][$field]['label
']); 5207 $this->sL('LLL:EXT:lang/locallang_core.xlf:error.items_proc_func_error
'), 5209 $exception->getMessage() 5212 $flashMessage = GeneralUtility::makeInstance( 5214 htmlspecialchars($message), 5216 FlashMessage::ERROR, 5221 $flashMessageService = GeneralUtility::makeInstance($class); 5222 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); 5223 $defaultFlashMessageQueue->enqueue($flashMessage); 5238 public function addSelectOptionsToItemArray($items, $fieldValue, $TSconfig, $field) { 5239 // Values from foreign tables: 5240 if ($fieldValue['config
']['foreign_table
']) { 5241 $items = $this->foreignTable($items, $fieldValue, $TSconfig, $field); 5242 if ($fieldValue['config
']['neg_foreign_table
']) { 5243 $items = $this->foreignTable($items, $fieldValue, $TSconfig, $field, 1); 5246 // Values from a file folder: 5247 if ($fieldValue['config
']['fileFolder
']) { 5248 $fileFolder = GeneralUtility::getFileAbsFileName($fieldValue['config
']['fileFolder
']); 5249 if (@is_dir($fileFolder)) { 5251 $extList = $fieldValue['config
']['fileFolder_extList
']; 5252 $recursivityLevels = isset($fieldValue['config
']['fileFolder_recursions
']) 5253 ? MathUtility::forceIntegerInRange($fieldValue['config
']['fileFolder_recursions
'], 0, 99) 5256 $fileFolder = rtrim($fileFolder, '/
') . '/
'; 5257 $fileArr = GeneralUtility::getAllFilesAndFoldersInPath(array(), $fileFolder, $extList, 0, $recursivityLevels); 5258 $fileArr = GeneralUtility::removePrefixPathFromList($fileArr, $fileFolder); 5259 foreach ($fileArr as $fileRef) { 5260 $fI = pathinfo($fileRef); 5261 $icon = GeneralUtility::inList('gif,png,jpeg,jpg
', strtolower($fI['extension
'])) 5262 ? '../
' . PathUtility::stripPathSitePrefix($fileFolder) . $fileRef 5272 // If 'special
' is configured: 5273 if ($fieldValue['config
']['special
']) { 5274 $lang = $this->getLanguageService(); 5275 switch ($fieldValue['config
']['special
']) { 5277 foreach ($GLOBALS['TCA
'] as $theTableNames => $_) { 5278 if (!$GLOBALS['TCA
'][$theTableNames]['ctrl
']['adminOnly
']) { 5280 $icon = IconUtility::mapRecordTypeToSpriteIconName($theTableNames, array()); 5282 $helpText = array(); 5283 $lang->loadSingleTableDescription($theTableNames); 5284 $helpTextArray = $GLOBALS['TCA_DESCR
'][$theTableNames]['columns
']['']; 5285 if (!empty($helpTextArray['description
'])) { 5286 $helpText['description
'] = $helpTextArray['description
']; 5288 // Item configuration: 5290 $this->sL($GLOBALS['TCA
'][$theTableNames]['ctrl
']['title
']), 5299 $theTypes = $GLOBALS['TCA
']['pages
']['columns
']['doktype
']['config
']['items
']; 5300 foreach ($theTypes as $theTypeArrays) { 5302 $icon = 'empty-emtpy
'; 5303 if ($theTypeArrays[1] != '--div--
') { 5304 $icon = IconUtility::mapRecordTypeToSpriteIconName('pages
', array('doktype
' => $theTypeArrays[1])); 5306 // Item configuration: 5308 $this->sL($theTypeArrays[0]), 5315 $theTypes = BackendUtility::getExcludeFields(); 5316 foreach ($theTypes as $theTypeArrays) { 5317 list($theTable, $theFullField) = explode(':
', $theTypeArrays[1]); 5318 // If the field comes from a FlexForm, the syntax is more complex 5319 $theFieldParts = explode(';
', $theFullField); 5320 $theField = array_pop($theFieldParts); 5321 // Add header if not yet set for table: 5322 if (!array_key_exists($theTable, $items)) { 5323 $icon = IconUtility::mapRecordTypeToSpriteIconName($theTable, array()); 5324 $items[$theTable] = array( 5325 $this->sL($GLOBALS['TCA
'][$theTable]['ctrl
']['title
']), 5331 $helpText = array(); 5332 $lang->loadSingleTableDescription($theTable); 5333 $helpTextArray = $GLOBALS['TCA_DESCR
'][$theTable]['columns
'][$theFullField]; 5334 if (!empty($helpTextArray['description
'])) { 5335 $helpText['description
'] = $helpTextArray['description
']; 5337 // Item configuration: 5339 rtrim($lang->sl($GLOBALS['TCA
'][$theTable]['columns
'][$theField]['label
']), ':
') . ' (
' . $theField . ')
', 5346 case 'explicitValues
': 5347 $theTypes = BackendUtility::getExplicitAuthFieldValues(); 5350 'ALLOW
' => 'status-status-permission-granted
', 5351 'DENY
' => 'status-status-permission-denied
' 5354 foreach ($theTypes as $tableFieldKey => $theTypeArrays) { 5355 if (is_array($theTypeArrays['items
'])) { 5358 $theTypeArrays['tableFieldLabel
'], 5361 // Traverse options for this field: 5362 foreach ($theTypeArrays['items
'] as $itemValue => $itemContent) { 5363 // Add item to be selected: 5365 '[
' . $itemContent[2] . ']
' . $itemContent[1], 5366 $tableFieldKey . ':
' . preg_replace('/[:|,]/
', '', $itemValue) . ':
' . $itemContent[0], 5367 $icons[$itemContent[0]] 5374 $items = array_merge($items, BackendUtility::getSystemLanguages()); 5378 $customOptions = $GLOBALS['TYPO3_CONF_VARS
']['BE
']['customPermOptions
']; 5379 if (is_array($customOptions)) { 5380 foreach ($customOptions as $coKey => $coValue) { 5381 if (is_array($coValue['items
'])) { 5384 $lang->sl($coValue['header
']), 5388 foreach ($coValue['items
'] as $itemKey => $itemCfg) { 5391 list($icon) = $this->getIcon($itemCfg[1]); 5393 $icon = 'empty-empty
'; 5396 $helpText = array(); 5397 if (!empty($itemCfg[2])) { 5398 $helpText['description
'] = $lang->sl($itemCfg[2]); 5400 // Add item to be selected: 5402 $lang->sl($itemCfg[0]), 5403 $coKey . ':
' . preg_replace('/[:|,]/
', '', $itemKey), 5412 case 'modListGroup
': 5415 $loadModules = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Module\\ModuleLoader
'); 5416 $loadModules->load($GLOBALS['TBE_MODULES
']); 5417 $modList = $fieldValue['config
']['special
'] == 'modListUser
' ? $loadModules->modListUser : $loadModules->modListGroup; 5418 if (is_array($modList)) { 5419 foreach ($modList as $theMod) { 5421 $icon = $lang->moduleLabels['tabs_images
'][$theMod . '_tab
']; 5423 $icon = '../
' . PathUtility::stripPathSitePrefix($icon); 5427 'title
' => $lang->moduleLabels['labels
'][$theMod . '_tablabel
'], 5428 'description
' => $lang->moduleLabels['labels
'][$theMod . '_tabdescr
'] 5430 // Item configuration: 5432 $this->addSelectOptionsToItemArray_makeModuleData($theMod), 5442 // Return the items: 5455 public function addSelectOptionsToItemArray_makeModuleData($value) { 5457 // Add label for main module: 5458 $pp = explode('_
', $value); 5459 if (count($pp) > 1) { 5460 $label .= $this->getLanguageService()->moduleLabels['tabs
'][($pp[0] . '_tab
')] . '>
'; 5462 // Add modules own label now: 5463 $label .= $this->getLanguageService()->moduleLabels['tabs
'][$value . '_tab
']; 5479 public function foreignTable($items, $fieldValue, $TSconfig, $field, $pFFlag = FALSE) { 5481 $pF = $pFFlag ? 'neg_
' : ''; 5482 $f_table = $fieldValue['config
'][$pF . 'foreign_table
']; 5483 $uidPre = $pFFlag ? '-
' : ''; 5485 $res = BackendUtility::exec_foreign_table_where_query($fieldValue, $field, $TSconfig, $pF); 5486 // Perform error test 5487 $db = $this->getDatabaseConnection(); 5488 if ($db->sql_error()) { 5489 $msg = htmlspecialchars($db->sql_error()); 5490 $msg .= '<br />
' . LF; 5491 $msg .= $this->sL('LLL:EXT:lang/locallang_core.xlf:error.database_schema_mismatch
'); 5492 $msgTitle = $this->sL('LLL:EXT:lang/locallang_core.xlf:error.database_schema_mismatch_title
'); 5494 $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\
FlashMessage', $msg, $msgTitle, FlashMessage::ERROR, TRUE); 5498 $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); 5499 $defaultFlashMessageQueue->enqueue($flashMessage); 5502 // Get label prefix. 5503 $lPrefix = $this->sL($fieldValue['config
'][$pF . 'foreign_table_prefix
']); 5504 // Get icon field + path if any: 5505 $iField = $GLOBALS['TCA
'][$f_table]['ctrl
']['selicon_field
']; 5506 $iPath = trim($GLOBALS['TCA
'][$f_table]['ctrl
']['selicon_field_path
']); 5507 // Traverse the selected rows to add them: 5508 while ($row = $db->sql_fetch_assoc($res)) { 5509 BackendUtility::workspaceOL($f_table, $row); 5510 if (is_array($row)) { 5511 // Prepare the icon if available: 5512 if ($iField && $iPath && $row[$iField]) { 5513 $iParts = GeneralUtility::trimExplode(',
', $row[$iField], TRUE); 5514 $icon = '../
' . $iPath . '/
' . trim($iParts[0]); 5515 } elseif (GeneralUtility::inList('singlebox,checkbox
', $fieldValue['config
']['renderMode
'])) { 5516 $icon = IconUtility::mapRecordTypeToSpriteIconName($f_table, $row); 5522 $lPrefix . htmlspecialchars(BackendUtility::getRecordTitle($f_table, $row)), 5523 $uidPre . $row['uid
'], 5528 $db->sql_free_result($res); 5532 /******************************************** 5534 * Template functions 5536 ********************************************/ 5544 public function setNewBEDesign() { 5545 $template = GeneralUtility::getUrl(PATH_typo3 . $this->templateFile); 5546 // Wrapping all table rows for a particular record being edited: 5547 $this->totalWrap = HtmlParser::getSubpart($template, '###TOTALWRAP###
'); 5548 // Wrapping a single field: 5549 $this->fieldTemplate = HtmlParser::getSubpart($template, '###FIELDTEMPLATE###
'); 5550 $this->paletteFieldTemplate = HtmlParser::getSubpart($template, '###PALETTEFIELDTEMPLATE###
'); 5551 $this->palFieldTemplate = HtmlParser::getSubpart($template, '###PALETTE_FIELDTEMPLATE###
'); 5552 $this->palFieldTemplateHeader = HtmlParser::getSubpart($template, '###PALETTE_FIELDTEMPLATE_HEADER###
'); 5553 $this->sectionWrap = HtmlParser::getSubpart($template, '###SECTION_WRAP###
'); 5564 public function intoTemplate($inArr, $altTemplate = '') { 5565 // Put into template_ 5566 $fieldTemplateParts = explode('###FIELD_
', $this->rplColorScheme($altTemplate ? $altTemplate : $this->fieldTemplate)); 5567 $out = current($fieldTemplateParts); 5568 foreach ($fieldTemplateParts as $part) { 5569 list($key, $val) = explode('###
', $part, 2); 5570 $out .= $inArr[$key]; 5588 public function addUserTemplateMarkers($marker, $table, $field, $row, &$PA) { 5600 public function wrapLabels($str) { 5614 public function wrapTotal($c, $rec, $table) { 5615 $parts = $this->replaceTableWrap(explode('|
', $this->totalWrap, 2), $rec, $table); 5616 return $parts[0] . $c . $parts[1] . implode('', $this->hiddenFieldAccum); 5626 static public function getHiddenTokenField($formName = 'securityToken
', $tokenName = 'formToken
') { 5627 $formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(); 5628 return '<input type=
"hidden" name=
"' . $tokenName . '" value=
"' . $formprotection->generateToken($formName) . '" />
'; 5640 public function replaceTableWrap($arr, $rec, $table) { 5642 $lang = $this->getLanguageService(); 5643 if (strstr($rec['uid
'], 'NEW
')) { 5644 $newLabel = ' <span
class=
"typo3-TCEforms-newToken">
' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.new
', TRUE) . '</span>
'; 5645 // BackendUtility::fixVersioningPid Should not be used here because NEW records are not offline workspace versions... 5646 $truePid = BackendUtility::getTSconfig_pidValue($table, $rec['uid
'], $rec['pid
']); 5647 $prec = BackendUtility::getRecordWSOL('pages
', $truePid, 'title
'); 5648 $pageTitle = BackendUtility::getRecordTitle('pages
', $prec, TRUE, FALSE); 5649 $rLabel = '<em>[PID:
' . $truePid . ']
' . $pageTitle . '</em>
'; 5650 // Fetch translated title of the table 5651 $tableTitle = $lang->sL($GLOBALS['TCA
'][$table]['ctrl
']['title
']); 5652 if ($table === 'pages
') { 5653 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewPage
', TRUE); 5654 $pageTitle = sprintf($label, $tableTitle); 5656 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecord
', TRUE); 5657 if ($rec['pid
'] == 0) { 5658 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecordRootLevel
', TRUE); 5660 $pageTitle = sprintf($label, $tableTitle, $pageTitle); 5663 $newLabel = ' <span
class=
"typo3-TCEforms-recUid">[
' . $rec['uid
'] . ']</span>
'; 5664 $rLabel = BackendUtility::getRecordTitle($table, $rec, TRUE, FALSE); 5665 $prec = BackendUtility::getRecordWSOL('pages
', $rec['pid
'], 'uid,title
'); 5666 // Fetch translated title of the table 5667 $tableTitle = $lang->sL($GLOBALS['TCA
'][$table]['ctrl
']['title
']); 5668 if ($table === 'pages
') { 5669 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.editPage
', TRUE); 5670 // Just take the record title and prepend an edit label. 5671 $pageTitle = sprintf($label, $tableTitle, $rLabel); 5673 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecord
', TRUE); 5674 $pageTitle = BackendUtility::getRecordTitle('pages
', $prec, TRUE, FALSE); 5675 if ($rLabel === BackendUtility::getNoRecordTitle(TRUE)) { 5676 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordNoTitle
', TRUE); 5678 if ($rec['pid
'] == 0) { 5679 $label = $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordRootLevel
', TRUE); 5681 if ($rLabel !== BackendUtility::getNoRecordTitle(TRUE)) { 5682 // Just take the record title and prepend an edit label. 5683 $pageTitle = sprintf($label, $tableTitle, $rLabel, $pageTitle); 5685 // Leave out the record title since it is not set. 5686 $pageTitle = sprintf($label, $tableTitle, $pageTitle); 5690 foreach ($arr as $k => $v) { 5691 // Make substitutions: 5692 $arr[$k] = str_replace( 5695 '###ID_NEW_INDICATOR###
', 5696 '###RECORD_LABEL###
', 5697 '###TABLE_TITLE###
', 5704 htmlspecialchars($this->sL($GLOBALS['TCA
'][$table]['ctrl
']['title
'])), 5705 IconUtility::getSpriteIconForRecord($table, $rec, array('title
' => $this->getRecordPath($table, $rec))) 5721 public function wrapBorder(&$out_array, &$out_pointer) { 5722 if ($this->sectionWrap && $out_array[$out_pointer]) { 5724 $tableAttribs .= $this->borderStyle[0] ? ' style=
"' . htmlspecialchars($this->borderStyle[0]) . '"' : ''; 5725 $tableAttribs .= $this->borderStyle[2] ? ' background=
"' . htmlspecialchars(($this->backPath . $this->borderStyle[2])) . '"' : ''; 5726 $tableAttribs .= $this->borderStyle[3] ? ' class=
"' . htmlspecialchars($this->borderStyle[3]) . '"' : ''; 5727 if ($tableAttribs) { 5728 $tableAttribs = 'border=
"0" cellspacing=
"0" cellpadding=
"0" width=
"100%"' . $tableAttribs; 5729 $out_array[$out_pointer] = str_replace('###CONTENT###
', $out_array[$out_pointer], str_replace('###TABLE_ATTRIBS###
', $tableAttribs, $this->sectionWrap)); 5742 public function rplColorScheme($inTemplate) { 5747 '###BGCOLOR_HEAD###
', 5748 '###FONTCOLOR_HEAD###
', 5750 '###CLASSATTR_1###
', 5751 '###CLASSATTR_2###
', 5756 $this->colorScheme[0] ? ' bgcolor=
"' . $this->colorScheme[0] . '"' : '', 5757 $this->colorScheme[1] ? ' bgcolor=
"' . $this->colorScheme[1] . '"' : '', 5758 $this->colorScheme[3], 5760 $this->classScheme[0] ? ' class=
"' . $this->classScheme[0] . '"' : '', 5761 $this->classScheme[1] ? ' class=
"' . $this->classScheme[1] . '"' : '', 5762 $this->classScheme[3] ? ' class=
"' . $this->classScheme[3] . '"' : '' 5775 public function getDivider() { 5786 public function printPalette($palArr) { 5787 $fieldAttributes = ($labelAttributes = ''); 5788 // Init color/class attributes: 5789 if ($this->colorScheme[2]) { 5790 $labelAttributes .= ' bgcolor=
"' . $this->colorScheme[2] . '"'; 5792 if ($this->classScheme[2]) { 5793 $labelAttributes .= ' class=
"t3-form-palette-field-label ' . $this->classScheme[2] . '"'; 5795 $labelAttributes .= ' class=
"t3-form-palette-field-label"'; 5797 if ($this->colorScheme[4]) { 5798 $fieldAttributes .= ' style=
"color: ' . $this->colorScheme[4] . '"'; 5800 if ($this->classScheme[4]) { 5801 $fieldAttributes .= ' class=
"t3-form-palette-field ' . $this->classScheme[4] . '"'; 5805 $lastLineWasLinebreak = FALSE; 5806 // Traverse palette fields and render them into containers: 5807 foreach ($palArr as $content) { 5808 if ($content['NAME
'] === '--linebreak--
') { 5809 if (!$lastLineWasLinebreak) { 5811 $lastLineWasLinebreak = TRUE; 5814 $lastLineWasLinebreak = FALSE; 5816 $paletteMarkers = array( 5817 '###CONTENT_TABLE###
' => $content['TABLE
'], 5818 '###CONTENT_ID###
' => $content['ID
'], 5819 '###CONTENT_FIELD###
' => $content['FIELD
'], 5820 '###CONTENT_NAME###
' => $content['NAME
'], 5821 '###CONTENT_ITEM###
' => $content['ITEM
'], 5822 '###CONTENT_ITEM_NULLVALUE###
' => $content['ITEM_NULLVALUE
'], 5823 '###CONTENT_ITEM_DISABLED###
' => $content['ITEM_DISABLED
'], 5824 '###ATTRIBUTES_LABEL###
' => $labelAttributes, 5825 '###ATTRIBUTES_FIELD###
' => $fieldAttributes, 5827 $iRow[$row][] = HtmlParser::substituteMarkerArray( 5828 $this->paletteFieldTemplate, 5835 // Final wrapping into the fieldset: 5836 $out = '<fieldset
class=
"t3-form-palette-fieldset">
'; 5837 for ($i = 0; $i <= $row; $i++) { 5838 if (isset($iRow[$i])) { 5839 $out .= implode('', $iRow[$i]); 5840 $out .= $i < $row ? '<br />
' : ''; 5843 $out .= '</fieldset>
'; 5854 public function setColorScheme($scheme) { 5855 $this->colorScheme = $this->defColorScheme; 5856 $this->classScheme = $this->defClassScheme; 5857 $parts = GeneralUtility::trimExplode(',
', $scheme); 5858 foreach ($parts as $key => $col) { 5859 // Split for color|class: 5860 list($color, $class) = GeneralUtility::trimExplode('|
', $col); 5861 // Handle color values: 5863 $this->colorScheme[$key] = $color; 5865 if ($color == '-
') { 5866 $this->colorScheme[$key] = ''; 5868 // Handle class values: 5870 $this->classScheme[$key] = $class; 5872 if ($class == '-
') { 5873 $this->classScheme[$key] = ''; 5884 public function resetSchemes() { 5885 $this->setColorScheme($GLOBALS['TBE_STYLES
']['colorschemes
'][0]); 5886 $this->fieldStyle = $GLOBALS['TBE_STYLES
']['styleschemes
'][0]; 5887 $this->borderStyle = $GLOBALS['TBE_STYLES
']['borderschemes
'][0]; 5896 public function storeSchemes() { 5897 $this->savedSchemes['classScheme
'] = $this->classScheme; 5898 $this->savedSchemes['colorScheme
'] = $this->colorScheme; 5899 $this->savedSchemes['fieldStyle
'] = $this->fieldStyle; 5900 $this->savedSchemes['borderStyle
'] = $this->borderStyle; 5909 public function restoreSchemes() { 5910 $this->classScheme = $this->savedSchemes['classScheme
']; 5911 $this->colorScheme = $this->savedSchemes['colorScheme
']; 5912 $this->fieldStyle = $this->savedSchemes['fieldStyle
']; 5913 $this->borderStyle = $this->savedSchemes['borderStyle
']; 5916 /******************************************** 5918 * JavaScript related functions 5920 ********************************************/ 5927 public function JStop() { 5929 // Additional top HTML: 5930 if (count($this->additionalCode_pre)) { 5934 ', $this->additionalCode_pre); 5936 // Additional top JavaScript 5937 if (count($this->additionalJS_pre)) { 5942 JavaScript in top of page (before form):
5945 <script type=
"text/javascript">
5951 ', $this->additionalJS_pre) . ' 5979 public function JSbottom($formname = 'forms[0]
', $update = FALSE) { 5981 $elements = array(); 5984 foreach ($this->requiredFields as $itemImgName => $itemName) { 5986 if (preg_match('/^(.+)\\[((\\w|\\d|_)+)\\]$/
', $itemName, $match)) { 5987 $record = $match[1]; 5989 $elements[$record][$field]['required
'] = 1; 5990 $elements[$record][$field]['requiredImg
'] = $itemImgName; 5991 if (isset($this->requiredAdditional[$itemName]) && is_array($this->requiredAdditional[$itemName])) { 5992 $elements[$record][$field]['additional
'] = $this->requiredAdditional[$itemName]; 5997 foreach ($this->requiredElements as $itemName => $range) { 5998 if (preg_match('/^(.+)\\[((\\w|\\d|_)+)\\]$/
', $itemName, $match)) { 5999 $record = $match[1]; 6001 $elements[$record][$field]['range
'] = array($range[0], $range[1]); 6002 $elements[$record][$field]['rangeImg
'] = $range['imgName
']; 6005 $this->TBE_EDITOR_fieldChanged_func = 'TBE_EDITOR.fieldChanged_fName(fName,formObj[fName+
"_list"]);
'; 6007 if ($this->loadMD5_JS) { 6008 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/md5.js
'); 6010 $pageRenderer = $this->getPageRenderer(); 6011 // load the main module for FormEngine with all important JS functions 6013 $pageRenderer->loadPrototype(); 6014 $pageRenderer->loadJquery(); 6015 $pageRenderer->loadExtJS(); 6016 // Make textareas resizable and flexible 6017 $beUserAuth = $this->getBackendUserAuthentication(); 6018 if (!($beUserAuth->uc['resizeTextareas
'] == '0
' && $beUserAuth->uc['resizeTextareas_Flexible
'] == '0
')) { 6019 $pageRenderer->addCssFile($this->backPath . 'js/extjs/ux/resize.css
'); 6020 $this->loadJavascriptLib('js/extjs/ux/ext.resizable.js
'); 6022 $resizableSettings = array( 6023 'textareaMaxHeight
' => $beUserAuth->uc['resizeTextareas_MaxHeight
'] > 0 ? $beUserAuth->uc['resizeTextareas_MaxHeight
'] : '600
', 6024 'textareaFlexible
' => !$beUserAuth->uc['resizeTextareas_Flexible
'] == '0
', 6025 'textareaResize
' => !$beUserAuth->uc['resizeTextareas
'] == '0
' 6027 $pageRenderer->addInlineSettingArray('', $resizableSettings); 6028 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js
'); 6029 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js
'); 6030 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.placeholder.js
'); 6031 // Needed for tceform manipulation (date picker) 6032 $typo3Settings = array( 6033 'datePickerUSmode
' => $GLOBALS['TYPO3_CONF_VARS
']['SYS
']['USdateFormat
'] ? 1 : 0, 6034 'dateFormat
' => array('j-n-Y
', 'G:i j-n-Y
'), 6035 'dateFormatUS
' => array('n-j-Y
', 'G:i n-j-Y
') 6037 $pageRenderer->addInlineSettingArray('', $typo3Settings); 6038 $this->loadJavascriptLib('js/extjs/ux/Ext.ux.DateTimePicker.js
'); 6039 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/tceforms.js
'); 6040 // If IRRE fields were processed, add the JavaScript functions: 6041 if ($this->inline->inlineCount) { 6042 $pageRenderer->loadScriptaculous(); 6043 // We want to load jQuery-ui inside our js. Enable this using requirejs. 6044 $pageRenderer->loadRequireJs(); 6045 $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js
'); 6047 inline.setPrependFormFieldNames(
"' . $this->inline->prependNaming . '");
6048 inline.setNoTitleString(
"' . addslashes(BackendUtility::getNoRecordTitle(TRUE)) . '");
6050 // Always include JS functions for Suggest fields as we don't know what will come
6051 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/jsfunc.tceforms_suggest.js');
6052 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/jsfunc.tceforms_selectboxfilter.js');
6055 if ($this->suggest->suggestCount > 0) {
6056 $pageRenderer->loadScriptaculous();
6057 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/jsfunc.tceforms_suggest.js');
6059 if ($this->multiSelectFilterCount > 0) {
6060 $pageRenderer->loadScriptaculous();
6061 $this->
loadJavascriptLib(
'sysext/backend/Resources/Public/JavaScript/jsfunc.tceforms_selectboxfilter.js');
6068 function getOuterHTML(idTagPrefix) { // Function getting the outerHTML of an element with id 6069 var str=($(idTagPrefix).inspect()+$(idTagPrefix).innerHTML+"</"+$(idTagPrefix).tagName.toLowerCase()+">"); 6072 function flexFormToggle(id) { // Toggling flexform elements on/off: 6073 Element.toggle(""+id+"-content"); 6075 if (Element.visible(id+"-content")) { 6076 $(id+"-toggle").update(\'' . $toggleIcon_open .
'\');
6077 $(
id+
"-toggleClosed").value = 0;
6079 $(
id+
"-toggle").update(\
'' . $toggleIcon_close .
'\');
6080 $(
id+
"-toggleClosed").value = 1;
6083 var previewContent =
"";
6084 var children = $(
id+
"-content").getElementsByTagName(
"input");
6085 for (var i = 0, length = children.length; i < length; i++) {
6086 if (children[i].type==
"text" && children[i].value) previewContent+= (previewContent?
" / ":
"")+children[i].value;
6088 if (previewContent.length>80) {
6089 previewContent = previewContent.substring(0,67)+
"...";
6091 $(
id+
"-preview").update(previewContent);
6093 function flexFormToggleSubs(
id) {
6094 var descendants = $(id).immediateDescendants();
6098 for (var i = 0, length = descendants.length; i < length; i++) {
6099 if (descendants[i].
id) {
6100 if (Element.visible(descendants[i].id+
"-content")) {isOpen++;}
else {isClosed++;}
6105 for (var i = 0, length = descendants.length; i < length; i++) {
6106 if (descendants[i].
id) {
6107 if (isOpen!=0 && isClosed!=0) {
6108 if (Element.visible(descendants[i].id+
"-content")) {flexFormToggle(descendants[i].
id);}
6110 flexFormToggle(descendants[i].
id);
6115 function flexFormSortable(
id) {
6116 Position.includeScrollOffsets =
true;
6117 Sortable.create(
id, {tag:\
'div\',constraint: false, onChange:function(){ 6118 setActionStatus(id); 6121 function setActionStatus(id) { // Updates the "action"-status for a section. This is used to move and delete elements. 6122 var descendants = $(id).immediateDescendants(); 6124 // Traverse and find how many are open or closed: 6125 for (var i = 0, length = descendants.length; i < length; i++) { 6126 if (descendants[i].id) { 6127 $(descendants[i].id+"-action").value = descendants[i].visible() ? i : "DELETE"; 6132 TBE_EDITOR.images.req.src = "' .
IconUtility::skinImg($this->backPath,
'gfx/required_h.gif',
'', 1) .
'"; 6133 TBE_EDITOR.images.cm.src = "' .
IconUtility::skinImg($this->backPath,
'gfx/content_client.gif',
'', 1) .
'"; 6134 TBE_EDITOR.images.sel.src = "' .
IconUtility::skinImg($this->backPath,
'gfx/content_selected.gif',
'', 1) .
'"; 6135 TBE_EDITOR.images.clear.src = "' . $this->backPath .
'clear.gif"; 6137 TBE_EDITOR.auth_timeout_field = ' . (int)$beUserAuth->auth_timeout_field .
'; 6138 TBE_EDITOR.formname = "' . $formname .
'"; 6139 TBE_EDITOR.formnameUENC = "' . rawurlencode($formname) .
'"; 6140 TBE_EDITOR.backPath = "' . addslashes($this->backPath) .
'"; 6141 TBE_EDITOR.prependFormFieldNames = "' . $this->prependFormFieldNames .
'"; 6142 TBE_EDITOR.prependFormFieldNamesUENC = "' . rawurlencode($this->prependFormFieldNames) .
'"; 6143 TBE_EDITOR.prependFormFieldNamesCnt = ' . substr_count($this->prependFormFieldNames,
'[') .
'; 6144 TBE_EDITOR.isPalettedoc = ' . ($this->isPalettedoc ? addslashes($this->isPalettedoc) :
'null') .
'; 6145 TBE_EDITOR.doSaveFieldName = "' . ($this->doSaveFieldName ? addslashes($this->doSaveFieldName) :
'') .
'"; 6148 TBE_EDITOR.labels.refresh_login = ' .
GeneralUtility::quoteJSvalue($this->
getLL(
'm_refresh_login')) .
'; 6149 TBE_EDITOR.labels.onChangeAlert = ' .
GeneralUtility::quoteJSvalue($this->
getLL(
'm_onChangeAlert')) .
'; 6150 evalFunc.USmode = ' . (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'USdateFormat'] ?
'1' :
'0') .
'; 6151 TBE_EDITOR.backend_interface = "' . $beUserAuth->uc[
'interfaceSetup'] .
'"; 6153 TBE_EDITOR.customEvalFunctions = {}; 6158 if (count($this->inline->inlineData)) {
6160 inline.addToDataArray(' . json_encode($this->inline->inlineData) .
'); 6164 if (count($this->requiredNested)) {
6166 TBE_EDITOR.addNested(' . json_encode($this->requiredNested) .
'); 6170 if (count($elements)) {
6172 TBE_EDITOR.addElements(' . json_encode($elements) .
'); 6173 TBE_EDITOR.initRequired(); 6177 if ($this->additionalJS_submit) {
6184 $out .= LF . implode(LF, $this->additionalJS_post) . LF .
$this->extJSCODE;
6186 TBE_EDITOR.loginRefreshed(); 6215 public function printNeededJSFunctions() {
6220 $pageRenderer->addInlineSetting(
'FormEngine',
'formName', $this->formName);
6221 $pageRenderer->addInlineSetting(
'FormEngine',
'backPath', $this->backPath);
6224 if ($this->printNeededJS[
'dbFileIcons'] || $this->inline->inlineCount > 0 || $this->suggest->suggestCount > 0) {
6225 $pageRenderer->addInlineSetting(
'FormEngine',
'legacyFieldChangedCb',
'function() { ' . $this->TBE_EDITOR_fieldChanged_func .
' };');
6228 return $this->
JSbottom($this->formName);
6238 return $this->
JStop($this->formName);
6278 if ($pid < 0 &&
$GLOBALS[
'TCA'][$table][
'ctrl'][
'useColumnsForDefaultValues']) {
6282 if ($drow = $db->sql_fetch_assoc($res)) {
6284 $fArr = explode(
',',
$GLOBALS[
'TCA'][$table][
'ctrl'][
'useColumnsForDefaultValues']);
6285 foreach ($fArr as $theF) {
6286 if (
$GLOBALS[
'TCA'][$table][
'columns'][$theF]) {
6287 $row[$theF] = $drow[$theF];
6291 $db->sql_free_result($res);
6293 foreach (
$GLOBALS[
'TCA'][$table][
'columns'] as $field => $info) {
6294 if (isset($info[
'config'][
'default'])) {
6295 $row[$field] = $info[
'config'][
'default'];
6325 list($tscPID, $thePidValue) = $this->
getTSCpid($table, $rec[
'uid'], $rec[
'pid']);
6326 if ($thePidValue >= 0) {
6340 if (!$this->perms_clause_set) {
6342 $this->perms_clause_set = TRUE;
6354 public function sL($str) {
6370 switch (substr($str, 0, 2)) {
6372 $content = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.' . substr($str, 2));
6375 $content = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:mess.' . substr($str, 2));
6390 if (is_array(
$GLOBALS[
'TCA'][$table][
'palettes'][$palette]) &&
$GLOBALS[
'TCA'][$table][
'palettes'][$palette][
'isHiddenPalette']) {
6393 if (
$GLOBALS[
'TCA'][$table][
'ctrl'][
'canNotCollapse']) {
6396 if (is_array(
$GLOBALS[
'TCA'][$table][
'palettes'][$palette]) &&
$GLOBALS[
'TCA'][$table][
'palettes'][$palette][
'canNotCollapse']) {
6412 public function isDisplayCondition($displayCond, $row, $ffValueKey =
'') {
6416 return $elementConditionMatcher->match($displayCond, $row, $ffValueKey);
6431 $key = $table .
':' .
$uid .
':' . $pid;
6432 if (!isset($this->cache_getTSCpid[$key])) {
6435 return $this->cache_getTSCpid[$key];
6446 return $GLOBALS[
'TCA'][$table][
'interface'][
'always_description'];
6461 $res = $db->exec_SELECTquery(
'static_lang_isocode,title,uid',
'sys_language',
'pid=0 AND hidden=0' .
BackendUtility::deleteClause(
'sys_language'),
'',
'title');
6467 'title' =>
'Default language',
6471 while ($row = $db->sql_fetch_assoc($res)) {
6472 $output[$row[
'uid']] = $row;
6473 if ($isL && $row[
'static_lang_isocode']) {
6474 $rr = BackendUtility::getRecord(
'static_languages', $row[
'static_lang_isocode'],
'lg_iso_2');
6475 if ($rr[
'lg_iso_2']) {
6476 $output[$row[
'uid']][
'ISOcode'] = $rr[
'lg_iso_2'];
6479 if ($onlyIsoCoded && !$output[$row[
'uid']][
'ISOcode']) {
6480 unset($output[$row[
'uid']]);
6483 $db->sql_free_result($res);
6496 public function getLanguageIcon($table, $row, $sys_language_uid) {
6497 $mainKey = $table .
':' . $row[
'uid'];
6498 if (!isset($this->cachedLanguageFlag[$mainKey])) {
6500 list($tscPID) = $this->
getTSCpid($table, $row[
'uid'], $row[
'pid']);
6503 $this->cachedLanguageFlag[$mainKey] = $t8Tools->getSystemLanguages($tscPID, $this->backPath);
6507 foreach ($this->cachedLanguageFlag[$mainKey] as $rUid => $cD) {
6508 if (
'v' . $cD[
'ISOcode'] === $sys_language_uid) {
6509 $sys_language_uid = $rUid;
6514 if ($this->cachedLanguageFlag[$mainKey][$sys_language_uid][
'flagIcon']) {
6517 } elseif ($this->cachedLanguageFlag[$mainKey][$sys_language_uid][
'title']) {
6518 $out .=
'[' . $this->cachedLanguageFlag[$mainKey][$sys_language_uid][
'title'] .
']';
6535 if ($l10nMode ===
'mergeIfNotBlank') {
6536 $icon =
IconUtility::getSpriteIcon(
'actions-edit-merge-localization', array(
'title' => $this->
sL(
'LLL:EXT:lang/locallang_misc.xlf:localizeMergeIfNotBlank')));
6551 if ($config[
'config'][
'type'] ===
'group' && ($config[
'config'][
'internal_type'] ===
'file' || $config[
'config'][
'internal_type'] ===
'file_reference')) {
6553 if ($config[
'config'][
'internal_type'] ===
'file_reference') {
6554 $config[
'config'][
'uploadfolder'] =
'';
6556 $show_thumbs = TRUE;
6557 $table =
'tt_content';
6564 foreach ($itemArray as $imgRead) {
6565 $imgP = explode(
'|', $imgRead);
6566 $imgPath = rawurldecode($imgP[0]);
6568 $rowCopy[$field] = $imgPath;
6571 $fileInformation = pathinfo($imgPath);
6573 $imgs[] =
'<span class="nobr">' . BackendUtility::thumbCode($rowCopy, $table, $field, $this->backPath,
'thumbs.php', $config[
'config'][
'uploadfolder'], 0,
' align="middle"') . ($absFilePath ? $this->
getClickMenu($fileIcon, $absFilePath) : $fileIcon) . $imgPath .
'</span>';
6575 $thumbsnail = implode(
'<br />', $imgs);
6579 return nl2br(htmlspecialchars($value));
6590 if (!isset($this->cachedAdditionalPreviewLanguages)) {
6591 $this->cachedAdditionalPreviewLanguages = array();
6594 foreach ($uids as
$uid) {
6595 if ($sys_language_rec = BackendUtility::getRecord(
'sys_language', $uid)) {
6596 $this->cachedAdditionalPreviewLanguages[
$uid] = array(
'uid' => $uid);
6598 $staticLangRow = BackendUtility::getRecord(
'static_languages', $sys_language_rec[
'static_lang_isocode'],
'lg_iso_2');
6599 if ($staticLangRow[
'lg_iso_2']) {
6600 $this->cachedAdditionalPreviewLanguages[
$uid][
'uid'] =
$uid;
6601 $this->cachedAdditionalPreviewLanguages[
$uid][
'ISOcode'] = $staticLangRow[
'lg_iso_2'];
6621 $this->dynNestedStack[] = array($type, $ident);
6635 if ($type != NULL && $ident != NULL) {
6636 $last = end($this->dynNestedStack);
6637 if ($type == $last[0] && $ident == $last[1]) {
6638 array_pop($this->dynNestedStack);
6641 array_pop($this->dynNestedStack);
6674 if ($type ==
'field' && is_string($value)) {
6675 $this->requiredFields[$name] = $value;
6678 } elseif ($type ==
'range' && is_array($value)) {
6679 $this->requiredElements[$name] = $value;
6697 if (count(
$dynNestedStack) && preg_match(
'/^(.+\\])\\[(\\w+)\\]$/', $itemName, $match)) {
6698 array_shift($match);
6699 $this->requiredNested[$itemName] = array(
6716 $value = $this->getPlaceholderValue($table, $field, $config, $row);
6719 $value = htmlspecialchars(trim($this->
sL($value)));
6720 return empty($value) ?
'' :
' placeholder="' . $value .
'" ';
6732 protected function getPlaceholderValue($table, $field, array $config, array $row) {
6733 $value = trim($config[
'placeholder']);
6738 if (substr($value, 0, 6) ===
'__row|') {
6742 $value = $traverser->getTraversedFieldValue($traverseFields, $table, $row);
6757 public function addStyleSheet($key, $href, $title =
'', $relation =
'stylesheet') {
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static getRecordWSOL($table, $uid, $fields=' *', $where='', $useDeleteClause=TRUE, $unsetMovePointers=FALSE)
static getTCEFORM_TSconfig($table, $row)
static formatForTextarea($content)
static getTCAtypeValue($table, $row)
static isFirstPartOfStr($str, $partStr)
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
static canBeInterpretedAsInteger($var)
static modifyHTMLColorAll($color, $all)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
static hmac($input, $additionalSecret='')
static logDeprecatedFunction()
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
static getTSCpid($table, $uid, $pid)
static calcAge($seconds, $labels=' min|hrs|days|yrs|min|hour|day|year')
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
if(!defined('TYPO3_MODE')) if(TYPO3_MODE=='BE' &&!(TYPO3_REQUESTTYPE &TYPO3_REQUESTTYPE_INSTALL)) $icons
static wrapInHelp($table, $field, $text='', array $overloadHelpText=array())
static deprecationLog($msg)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
static isLoaded($key, $exitOnError=FALSE)
static removeDotsFromTS(array $ts)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static getTCAtypes($table, $rec, $useFieldNameAsKey=0)
static RTEsetup($RTEprop, $table, $field, $type='')
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
static formatSize($sizeInBytes, $labels='')
static getSpecConfParametersFromArray($pArr)
static fixed_lgd_cs($string, $chars, $appendString='...')
static fixVersioningPid($table, &$rr, $ignoreWorkspaceMatch=FALSE)
static getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit=0)
static getSpecConfParts($str, $defaultExtras)
static getSpriteIconForFile($fileExtension, array $options=array())
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static revExplode($delimiter, $string, $count=0)
static inList($list, $item)
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
static stripPathSitePrefix($path)
static evalWriteFile($pArr, $currentRecord)
static getPagesTSconfig($id, $rootLine=NULL, $returnPartArray=FALSE)
static deleteClause($table, $tableAlias='')
static wrapJS($string, $linebreak=TRUE)
static clientInfo($useragent='')
static keepItemsInArray(array $array, $keepItems, $getValueFunc=NULL)