145 public function init(&$formEngine) {
146 $this->fObj = $formEngine;
147 $this->backPath = &$formEngine->backPath;
148 $this->prependFormFieldNames = &$this->fObj->prependFormFieldNames;
149 $this->prependCmdFieldNames = &$this->fObj->prependCmdFieldNames;
150 $this->inlineStyles[
'margin-right'] =
'5';
162 $this->hookObjects = array();
163 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms_inline.php'][
'tceformsInlineHook'])) {
164 $tceformsInlineHook = &
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms_inline.php'][
'tceformsInlineHook'];
165 if (is_array($tceformsInlineHook)) {
166 foreach ($tceformsInlineHook as $classData) {
169 throw new \UnexpectedValueException(
'$processObject must implement interface TYPO3\\CMS\\Backend\\Form\\Element\\InlineElementHookInterface', 1202072000);
171 $processObject->init($this);
172 $this->hookObjects[] = $processObject;
194 $localizationLinks =
'';
196 $this->inlineCount++;
198 $config = $PA[
'fieldConf'][
'config'];
199 $foreign_table = $config[
'foreign_table'];
202 $language = (int)$row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']];
210 $this->fObj->requiredElements[$PA[
'itemFormElName']] = array($minitems, $maxitems,
'imgName' => $table .
'_' . $row[
'uid'] .
'_' . $field);
213 if (!isset($this->inlineFirstPid)) {
218 $this->inlineView =
$inlineView[$table][$row[
'uid']];
221 if ($table ==
'pages') {
223 $this->inlineFirstPid = is_null($liveVersionId) ? $row[
'uid'] : $liveVersionId;
224 } elseif ($row[
'pid'] < 0) {
225 $prevRec = BackendUtility::getRecord($table, abs($row[
'pid']));
226 $this->inlineFirstPid = $prevRec[
'pid'];
228 $this->inlineFirstPid = $row[
'pid'];
232 $this->
pushStructure($table, $row[
'uid'], $field, $config, $PA);
234 $nameForm = $this->inlineNames[
'form'];
236 $nameObject = $this->inlineNames[
'object'];
238 $relatedRecords = $this->getRelatedRecords($table, $field, $row, $PA, $config);
240 $relatedRecordsUids = array_keys($relatedRecords[
'records']);
241 $config[
'inline'][
'first'] = reset($relatedRecordsUids);
242 $config[
'inline'][
'last'] = end($relatedRecordsUids);
245 $this->inlineData[
'config'][$nameObject] = array(
246 'table' => $foreign_table,
247 'md5' => md5($nameObject)
249 $this->inlineData[
'config'][$nameObject . self::Structure_Separator . $foreign_table] = array(
252 'sortable' => $config[
'appearance'][
'useSortable'],
254 'table' => $top[
'table'],
263 $this->inlineData[
'nested'][$nameObject] = $this->fObj->getDynNestedStack(FALSE, $this->isAjaxCall);
265 if ($config[
'foreign_unique']) {
269 $uniqueIds = $this->
getUniqueIds($relatedRecords[
'records'], $config, $selConfig[
'type'] ==
'groupdb');
270 $possibleRecords = $this->
getPossibleRecords($table, $field, $row, $config,
'foreign_unique');
271 $uniqueMax = $config[
'appearance'][
'useCombination'] || $possibleRecords === FALSE ? -1 : count($possibleRecords);
272 $this->inlineData[
'unique'][$nameObject . self::Structure_Separator . $foreign_table] = array(
274 'used' => $uniqueIds,
275 'type' => $selConfig[
'type'],
276 'table' => $config[
'foreign_table'],
277 'elTable' => $selConfig[
'table'],
279 'field' => $config[
'foreign_unique'],
280 'selector' => $selConfig[
'selector'],
287 if (isset($config[
'appearance'][
'showAllLocalizationLink']) && $config[
'appearance'][
'showAllLocalizationLink']) {
288 $localizationLinks .=
' ' . $this->
getLevelInteractionLink(
'localize', $nameObject . self::Structure_Separator . $foreign_table, $config);
291 if (isset($config[
'appearance'][
'showSynchronizationLink']) && $config[
'appearance'][
'showSynchronizationLink']) {
292 $localizationLinks .=
' ' . $this->
getLevelInteractionLink(
'synchronize', $nameObject . self::Structure_Separator . $foreign_table, $config);
296 if ($config[
'foreign_selector'] && $config[
'appearance'][
'showPossibleRecordsSelector'] !== FALSE) {
298 if (!$config[
'foreign_unique']) {
300 $uniqueIds = array();
303 $item .= $selectorBox . $localizationLinks;
306 $levelLinks = $this->
getLevelInteractionLink(
'newRecord', $nameObject . self::Structure_Separator . $foreign_table, $config);
309 $item .=
'<div id="' . $nameObject .
'">';
311 if ($relatedRecords[
'count'] >= $maxitems || $uniqueMax > 0 && $relatedRecords[
'count'] >= $uniqueMax) {
312 $config[
'inline'][
'inlineNewButtonStyle'] =
'display: none;';
315 if (in_array($config[
'appearance'][
'levelLinksPosition'], array(
'both',
'top'))) {
316 $item .= $levelLinks . $localizationLinks;
318 $item .=
'<div id="' . $nameObject .
'_records">';
319 $relationList = array();
320 if (count($relatedRecords[
'records'])) {
321 foreach ($relatedRecords[
'records'] as $rec) {
323 if (!isset($rec[
'__virtual']) || !$rec[
'__virtual']) {
324 $relationList[] = $rec[
'uid'];
330 if (in_array($config[
'appearance'][
'levelLinksPosition'], array(
'both',
'bottom'))) {
331 $item .= $levelLinks . $localizationLinks;
333 if (is_array($config[
'customControls'])) {
334 $item .=
'<div id="' . $nameObject .
'_customControls">';
335 foreach ($config[
'customControls'] as $customControlConfig) {
340 'nameObject' => $nameObject,
341 'nameForm' => $nameForm,
349 if (count($relationList) > 1 && $config[
'appearance'][
'useSortable']) {
353 $item .=
'<input type="hidden" name="' . $nameForm .
'" value="' . implode(
',', $relationList) .
'" class="inlineRecord" />';
360 unset($this->inlineFirstPid);
381 $foreign_table = $config[
'foreign_table'];
382 $foreign_selector = $config[
'foreign_selector'];
385 if (isset($parent[
'localizationMode']) && $parent[
'localizationMode'] != FALSE) {
386 $this->fObj->registerDefaultLanguageData($foreign_table, $rec);
390 $this->inlineData[
'map'][$this->inlineNames[
'form']] = $this->inlineNames[
'object'];
394 $isVirtualRecord = isset($rec[
'__virtual']) && $rec[
'__virtual'];
396 if ($foreign_selector) {
397 $rec[$foreign_selector] = $this->
normalizeUid($rec[$foreign_selector]);
399 if (!$this->
checkAccess(($isNewRecord ?
'new' :
'edit'), $foreign_table, $rec[
'uid'])) {
403 $nameObject = $this->inlineNames[
'object'];
404 $appendFormFieldNames =
'[' . $foreign_table .
'][' . $rec[
'uid'] .
']';
405 $objectId = $nameObject . self::Structure_Separator . $foreign_table . self::Structure_Separator . $rec[
'uid'];
407 $this->fObj->pushToDynNestedStack(
'inline', $objectId);
409 if (!$isVirtualRecord) {
411 $collapseAll = isset($config[
'appearance'][
'collapseAll']) && $config[
'appearance'][
'collapseAll'];
412 $expandAll = isset($config[
'appearance'][
'collapseAll']) && !$config[
'appearance'][
'collapseAll'];
413 $ajaxLoad = isset($config[
'appearance'][
'ajaxLoad']) && !$config[
'appearance'][
'ajaxLoad'] ? FALSE : TRUE;
416 $isExpanded = $expandAll || (!$collapseAll ? 1 : 0);
418 $isExpanded = $config[
'renderFieldsOnly'] || !$collapseAll && $this->
getExpandedCollapsedState($foreign_table, $rec[
'uid']) || $expandAll;
421 if ($isNewRecord || $isExpanded || !$ajaxLoad) {
423 $overruleTypesArray = isset($config[
'foreign_types']) ? $config[
'foreign_types'] : array();
424 $fields = $this->
renderMainFields($foreign_table, $rec, $overruleTypesArray);
428 if (isset($ajaxArguments[2]) && trim($ajaxArguments[2]) !=
'') {
429 $fields = str_replace(
'P[returnUrl]=%2F' . rawurlencode(TYPO3_mainDir) .
'ajax.php',
'P[returnUrl]=' . rawurlencode($ajaxArguments[2]), $fields);
434 $fields =
'<!--notloaded-->';
439 $ucFieldName =
'uc[inlineView][' . $top[
'table'] .
'][' . $top[
'uid'] .
']' . $appendFormFieldNames;
441 $fields .=
'<input type="hidden" name="' . $this->prependFormFieldNames . $appendFormFieldNames .
'[pid]" value="' . $rec[
'pid'] .
'"/>';
442 $fields .=
'<input type="hidden" name="' . $ucFieldName .
'" value="' . $isExpanded .
'" />';
445 $fields .=
'<input type="hidden" name="' . $this->prependCmdFieldNames . $appendFormFieldNames .
'[delete]" value="1" disabled="disabled" />';
447 && !empty(
$GLOBALS[
'TCA'][$foreign_table][
'ctrl'][
'enablecolumns'][
'disabled'])
450 $checked = !empty($rec[
'hidden']) ?
' checked="checked"' :
'';
451 $fields .=
'<input type="checkbox" name="' . $this->prependFormFieldNames . $appendFormFieldNames .
'[hidden]_0" value="1"' . $checked .
' />';
452 $fields .=
'<input type="input" name="' . $this->prependFormFieldNames . $appendFormFieldNames .
'[hidden]" value="' . $rec[
'hidden'] .
'" />';
457 $class =
't3-form-field-container-inline-collapsed';
460 if ($config[
'renderFieldsOnly']) {
461 $out = $fields . $combination;
464 if ($isVirtualRecord) {
465 $class .=
' t3-form-field-container-inline-placeHolder';
467 if (isset($rec[
'hidden']) && (
int)$rec[
'hidden']) {
468 $class .=
' t3-form-field-container-inline-hidden';
470 $out =
'<div class="t3-form-field-record-inline" id="' . $objectId .
'_fields" data-expandSingle="' . ($config[
'appearance'][
'expandSingle'] ? 1 : 0) .
'" data-returnURL="' . htmlspecialchars(
GeneralUtility::getIndpEnv(
'REQUEST_URI')) .
'">' . $fields . $combination .
'</div>';
473 $out =
'<div class="t3-form-field-header-inline" id="' . $objectId .
'_header">' . $header .
'</div>' . $out;
475 $classMSIE = $this->fObj->clientInfo[
'BROWSER'] ==
'msie' && $this->fObj->clientInfo[
'VERSION'] < 8 ?
'MSIE' :
'';
476 $class .=
' inlineDiv' . $classMSIE . ($isNewRecord ?
' inlineIsNewRecord' :
'');
477 $out =
'<div id="' . $objectId .
'_div" class="t3-form-field-container-inline ' . trim($class) .
'">' . $out .
'</div>';
480 $this->fObj->popFromDynNestedStack();
492 protected function renderMainFields($table, array $row, array $overruleTypesArray = array()) {
494 $depth = $this->fObj->renderDepth;
496 if (isset($this->fObj->palettesRendered[$depth][$table])) {
497 $palettesRendered = $this->fObj->palettesRendered[$depth][$table];
500 $content = $this->fObj->getMainFields($table, $row, $depth, $overruleTypesArray);
502 if (isset($palettesRendered)) {
503 $this->fObj->palettesRendered[$depth][$table] = $palettesRendered;
522 $objectId = $this->inlineNames[
'object'] . self::Structure_Separator . $foreign_table . self::Structure_Separator . $rec[
'uid'];
526 $hasForeignLabel = !$isOnSymmetricSide && $config[
'foreign_label'] ? TRUE : FALSE;
527 $hasSymmetricLabel = $isOnSymmetricSide && $config[
'symmetric_label'] ? TRUE : FALSE;
531 if (isset(
$GLOBALS[
'TCA'][$foreign_table][
'ctrl'][
'formattedLabel_userFunc'])) {
533 'table' => $foreign_table,
536 'isOnSymmetricSide' => $isOnSymmetricSide,
537 'options' => isset(
$GLOBALS[
'TCA'][$foreign_table][
'ctrl'][
'formattedLabel_userFunc_options'])
538 ?
$GLOBALS[
'TCA'][$foreign_table][
'ctrl'][
'formattedLabel_userFunc_options']
548 $recTitle = $params[
'title'];
551 } elseif (isset(
$GLOBALS[
'TCA'][$foreign_table][
'ctrl'][
'label_userFunc'])) {
553 'table' => $foreign_table,
556 'isOnSymmetricSide' => $isOnSymmetricSide,
565 $recTitle = $params[
'title'];
566 } elseif ($hasForeignLabel || $hasSymmetricLabel) {
567 $titleCol = $hasForeignLabel ? $config[
'foreign_label'] : $config[
'symmetric_label'];
570 if ($foreignConfig[
'type'] !=
'groupdb') {
580 if (trim($recTitle) ===
'') {
589 $label =
'<span id="' . $objectId .
'_label">' . $recTitle .
'</span>';
594 if (!empty($config[
'appearance'][
'headerThumbnail'][
'field'])) {
595 $fieldValue = $rec[$config[
'appearance'][
'headerThumbnail'][
'field']];
599 if (!empty($fileUid)) {
601 if ($fileObject && $fileObject->isMissing()) {
602 $flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
603 $thumbnail = $flashMessage->render();
604 } elseif($fileObject) {
605 $imageSetup = $config[
'appearance'][
'headerThumbnail'];
606 unset($imageSetup[
'field']);
607 $imageSetup = array_merge(array(
'width' =>
'45',
'height' =>
'45c'), $imageSetup);
610 if (!$processedImage->usesOriginalFile()) {
611 $imageUrl = $processedImage->getPublicUrl(TRUE);
612 $thumbnail =
'<img class="t3-form-field-header-inline-thumbnail-image" src="' . $imageUrl .
'" alt="' . htmlspecialchars($altText) .
'" title="' . htmlspecialchars($altText) .
'">';
618 if (!empty($config[
'appearance'][
'headerThumbnail'][
'field']) && $thumbnail) {
619 $headerClasses =
' t3-form-field-header-inline-has-thumbnail';
620 $mediaContainer =
'<div class="t3-form-field-header-inline-thumbnail" id="' . $objectId .
'_thumbnailcontainer">' . $thumbnail .
'</div>';
622 $headerClasses =
' t3-form-field-header-inline-has-icon';
623 $mediaContainer =
'<div class="t3-form-field-header-inline-icon" id="' . $objectId .
'_iconcontainer">' . $iconImg .
'</div>';
626 $header =
'<div class="t3-form-field-header-inline-wrap' . $headerClasses .
'">' 627 .
'<div class="t3-form-field-header-inline-ctrl">' . $ctrl .
'</div>' 628 .
'<div class="t3-form-field-header-inline-body">' 630 .
'<div class="t3-form-field-header-inline-summary">' . $label .
'</div>' 653 $isNewItem = substr($rec[
'uid'], 0, 3) ==
'NEW';
655 $tcaTableCtrl = &
$GLOBALS[
'TCA'][$foreign_table][
'ctrl'];
656 $tcaTableCols = &
$GLOBALS[
'TCA'][$foreign_table][
'columns'];
657 $isPagesTable = $foreign_table ==
'pages' ? TRUE : FALSE;
658 $isSysFileReferenceTable = $foreign_table ===
'sys_file_reference';
660 $enableManualSorting = $tcaTableCtrl[
'sortby'] || $config[
'MM'] || !$isOnSymmetricSide && $config[
'foreign_sortby'] || $isOnSymmetricSide && $config[
'symmetric_sortby'] ? TRUE : FALSE;
661 $nameObject = $this->inlineNames[
'object'];
662 $nameObjectFt = $nameObject . self::Structure_Separator . $foreign_table;
663 $nameObjectFtId = $nameObjectFt . self::Structure_Separator . $rec[
'uid'];
666 $localCalcPerms = FALSE;
668 $localCalcPerms =
$GLOBALS[
'BE_USER']->calcPerms(BackendUtility::getRecord(
'pages', $rec[
'uid']));
671 $permsEdit = $isPagesTable && $localCalcPerms & 2 || !$isPagesTable && $calcPerms & 16;
673 $enabledControls = $config[
'appearance'][
'enabledControls'];
675 foreach ($this->hookObjects as $hookObj) {
676 $hookObj->renderForeignRecordHeaderControl_preProcess($parentUid, $foreign_table, $rec, $config, $isVirtualRecord, $enabledControls);
679 $cells[
'required'] =
'<img name="' . $nameObjectFtId .
'_req" src="clear.gif" width="10" height="10" hspace="4" vspace="3" alt="" />';
680 if (isset($rec[
'__create'])) {
681 $cells[
'localize.isLocalizable'] =
IconUtility::getSpriteIcon(
'actions-edit-localize-status-low', array(
'title' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_misc.xlf:localize.isLocalizable', TRUE)));
682 } elseif (isset($rec[
'__remove'])) {
683 $cells[
'localize.wasRemovedInOriginal'] =
IconUtility::getSpriteIcon(
'actions-edit-localize-status-high', array(
'title' =>
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_misc.xlf:localize.wasRemovedInOriginal', TRUE)));
686 if ($enabledControls[
'info'] && !$isNewItem) {
687 if ($rec[
'table_local'] ===
'sys_file') {
688 $uid = (int)substr($rec[
'uid_local'], 9);
692 $table = $foreign_table;
694 $cells[
'info'] =
'<a href="#" onclick="' . htmlspecialchars((
'top.launchView(\'' . $table .
'\', \
'' .
$uid .
'\');
return false;
')) . '">' . IconUtility::getSpriteIcon('status-dialog-information', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:showInfo', TRUE))) . '</a>'; 696 // If the table is NOT a read-only table, then show these links: 697 if (!$tcaTableCtrl['readOnly'] && !$isVirtualRecord) { 698 // "New record after
" link (ONLY if the records in the table are sorted by a "sortby
"-row or if default values can depend on previous record): 699 if ($enabledControls['new'] && ($enableManualSorting || $tcaTableCtrl['useColumnsForDefaultValues'])) { 700 if (!$isPagesTable && $calcPerms & 16 || $isPagesTable && $calcPerms & 8) { 701 $onClick = 'return inline.createNewRecord(\'' . $nameObjectFt . '\',\'' . $rec['uid'] . '\')'; 702 $class = ' class="inlineNewButton
' . $this->inlineData['config
'][$nameObject]['md5
'] . '"'; 703 if ($config['inline']['inlineNewButtonStyle']) { 704 $style = ' style="' . $config['inline']['inlineNewButtonStyle
'] . '"'; 706 $cells['new'] = '<a href="#
" onclick="' . htmlspecialchars($onClick) . '"' . $class . $style . '>' . IconUtility::getSpriteIcon(('actions-' . ($isPagesTable ? 'page' : 'document') . '-new'), array( 707 'title' => $GLOBALS['LANG']->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:new' . ($isPagesTable ? 'Page' : 'Record')), TRUE) 712 if ($enabledControls['sort'] && $permsEdit && $enableManualSorting) { 713 $onClick = 'return inline.changeSorting(\'' . $nameObjectFtId . '\', \'1\')'; 715 $style = $config['inline']['first'] == $rec['uid'] ? 'style="visibility: hidden;
"' : ''; 716 $cells['sort.up'] = '<a href="#
" onclick="' . htmlspecialchars($onClick) . '" class="sortingUp
" ' . $style . '>' . IconUtility::getSpriteIcon('actions-move-up', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:moveUp', TRUE))) . '</a>'; 717 $onClick = 'return inline.changeSorting(\'' . $nameObjectFtId . '\', \'-1\')'; 719 $style = $config['inline']['last'] == $rec['uid'] ? 'style="visibility: hidden;
"' : ''; 720 $cells['sort.down'] = '<a href="#
" onclick="' . htmlspecialchars($onClick) . '" class="sortingDown
" ' . $style . '>' . IconUtility::getSpriteIcon('actions-move-down', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:moveDown', TRUE))) . '</a>'; 723 if ($enabledControls['delete'] && ($isPagesTable && $localCalcPerms & 4 724 || !$isPagesTable && $calcPerms & 16 725 || $isSysFileReferenceTable && $calcPerms & 2)) { 727 $onClick = 'inline.deleteRecord(\'' . $nameObjectFtId . '\');'; 728 $cells['delete'] = '<a href="#
" onclick="' . htmlspecialchars(('if (confirm(
' . GeneralUtility::quoteJSvalue($GLOBALS['LANG
']->getLL('deleteWarning
')) . ')) {
' . $onClick . ' }
return false;
')) . '">' . IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:delete', TRUE))) . '</a>'; 731 // "Hide/Unhide
" links: 732 $hiddenField = $tcaTableCtrl['enablecolumns']['disabled']; 733 if ($enabledControls['hide'] && $permsEdit && $hiddenField && $tcaTableCols[$hiddenField] && (!$tcaTableCols[$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $foreign_table . ':' . $hiddenField))) { 734 $onClick = 'return inline.enableDisableRecord(\'' . $nameObjectFtId . '\')'; 735 if ($rec[$hiddenField]) { 736 $cells['hide.unhide'] = '<a href="#
" class="hiddenHandle
" onclick="' . htmlspecialchars($onClick) . '">' . IconUtility::getSpriteIcon('actions-edit-unhide', array( 737 'title' => $GLOBALS['LANG']->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:unHide' . ($isPagesTable ? 'Page' : '')), TRUE), 738 'id' => ($nameObjectFtId . '_disabled') 741 $cells['hide.hide'] = '<a href="#
" class="hiddenHandle
" onclick="' . htmlspecialchars($onClick) . '">' . IconUtility::getSpriteIcon('actions-edit-hide', array( 742 'title' => $GLOBALS['LANG']->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:hide' . ($isPagesTable ? 'Page' : '')), TRUE), 743 'id' => ($nameObjectFtId . '_disabled') 747 // Drag&Drop Sorting: Sortable handler for script.aculo.us 748 if ($enabledControls['dragdrop'] && $permsEdit && $enableManualSorting && $config['appearance']['useSortable']) { 749 $cells['dragdrop'] = IconUtility::getSpriteIcon('actions-move-move', array('data-id' => $rec['uid'], 'class' => 'sortableHandle', 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.move', TRUE))); 751 } elseif ($isVirtualRecord && $isParentExisting) { 752 if ($enabledControls['localize'] && isset($rec['__create'])) { 753 $onClick = 'inline.synchronizeLocalizeRecords(\'' . $nameObjectFt . '\', ' . $rec['uid'] . ');'; 754 $cells['localize'] = '<a href="#
" onclick="' . htmlspecialchars($onClick) . '">' . IconUtility::getSpriteIcon('actions-document-localize', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_misc.xlf:localize', TRUE))) . '</a>'; 757 // If the record is edit-locked by another user, we will show a little warning sign: 758 if ($lockInfo = BackendUtility::isRecordLocked($foreign_table, $rec['uid'])) { 759 $cells['locked'] = '<a href="#
" onclick="alert(
' . GeneralUtility::quoteJSvalue($lockInfo['msg
']) . ');
return false;
">' . IconUtility::getSpriteIcon('status-warning-in-use', array('title' => $lockInfo['msg'])) . '</a>'; 761 // Hook: Post-processing of single controls for specific child records: 762 foreach ($this->hookObjects as $hookObj) { 763 $hookObj->renderForeignRecordHeaderControl_postProcess($parentUid, $foreign_table, $rec, $config, $isVirtualRecord, $cells); 765 return '<!-- CONTROL PANEL: ' . $foreign_table . ':' . $rec['uid'] . ' -->' . implode('', $cells); 779 public function renderCombinationTable(&$rec, $appendFormFieldNames, $config = array()) { 780 $foreign_table = $config['foreign_table']; 781 $foreign_selector = $config['foreign_selector']; 782 if ($foreign_selector && $config['appearance']['useCombination']) { 783 $comboConfig = $GLOBALS['TCA'][$foreign_table]['columns'][$foreign_selector]['config']; 784 // If record does already exist, load it: 785 if ($rec[$foreign_selector] && MathUtility::canBeInterpretedAsInteger($rec[$foreign_selector])) { 786 $comboRecord = $this->getRecord($this->inlineFirstPid, $comboConfig['foreign_table'], $rec[$foreign_selector]); 787 $isNewRecord = FALSE; 789 $comboRecord = $this->getNewRecord($this->inlineFirstPid, $comboConfig['foreign_table']); 792 $flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:warning.inline_use_combination'), '', FlashMessage::WARNING); 793 $out = $flashMessage->render(); 794 // Get the FormEngine interpretation of the TCA of the child table 795 $out .= $this->renderMainFields($comboConfig['foreign_table'], $comboRecord); 796 $out = $this->wrapFormsSection($out, array(), array()); 797 // If this is a new record, add a pid value to store this record and the pointer value for the intermediate table 799 $comboFormFieldName = $this->prependFormFieldNames . '[' . $comboConfig['foreign_table'] . '][' . $comboRecord['uid'] . '][pid]'; 800 $out .= '<input type="hidden
" name="' . $comboFormFieldName . '" value="' . $comboRecord['pid
'] . '" />'; 802 // If the foreign_selector field is also responsible for uniqueness, tell the browser the uid of the "other
" side of the relation 803 if ($isNewRecord || $config['foreign_unique'] == $foreign_selector) { 804 $parentFormFieldName = $this->prependFormFieldNames . $appendFormFieldNames . '[' . $foreign_selector . ']'; 805 $out .= '<input type="hidden
" name="' . $parentFormFieldName . '" value="' . $comboRecord['uid
'] . '" />'; 821 public function renderPossibleRecordsSelector($selItems, $conf, $uniqueIds = array()) { 822 $foreign_selector = $conf['foreign_selector']; 823 $selConfig = $this->getPossibleRecordsSelectorConfig($conf, $foreign_selector); 824 if ($selConfig['type'] == 'select') { 825 $item = $this->renderPossibleRecordsSelectorTypeSelect($selItems, $conf, $selConfig['PA'], $uniqueIds); 826 } elseif ($selConfig['type'] == 'groupdb') { 827 $item = $this->renderPossibleRecordsSelectorTypeGroupDB($conf, $selConfig['PA']); 843 public function renderPossibleRecordsSelectorTypeSelect($selItems, $conf, &$PA, $uniqueIds = array()) { 844 $foreign_table = $conf['foreign_table']; 845 $foreign_selector = $conf['foreign_selector']; 847 $PA['fieldConf'] = $GLOBALS['TCA'][$foreign_table]['columns'][$foreign_selector]; 848 $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ?: $PA['fieldConf']['config']['type']; 849 // Using "form_type
" locally in this script 850 $PA['fieldTSConfig'] = $this->fObj->setTSconfig($foreign_table, array(), $foreign_selector); 851 $config = $PA['fieldConf']['config']; 852 //TODO: $disabled is not present - should be read from config? 855 // Create option tags: 857 $styleAttrValue = ''; 858 foreach ($selItems as $p) { 859 if ($config['iconsInOptionTags']) { 860 $styleAttrValue = $this->fObj->optionTagStyle($p[2]); 862 if (!in_array($p[1], $uniqueIds)) { 863 $opt[] = '<option value="' . htmlspecialchars($p[1]) . '"' . ' style="' . (in_array($p[1], $uniqueIds) ? '' : '') . ($styleAttrValue ? ' style=
"' . htmlspecialchars($styleAttrValue) : '') . '">
' . htmlspecialchars($p[0]) . '</option>
'; 866 // Put together the selector box: 867 $selector_itemListStyle = isset($config['itemListStyle
']) ? ' style=
"' . htmlspecialchars($config['itemListStyle']) . '"' : ' style=
"' . $this->fObj->defaultMultipleSelectorStyle . '"'; 868 $size = (int)$conf['size
']; 869 $size = $conf['autoSizeMax
'] ? MathUtility::forceIntegerInRange(count($selItems) + 1, MathUtility::forceIntegerInRange($size, 1), $conf['autoSizeMax
']) : $size; 870 $onChange = 'return inline.importNewRecord(\
'' . $this->inlineNames[
'object'] . self::Structure_Separator . $conf[
'foreign_table'] .
'\')
'; 872 <select
id=
"' . $this->inlineNames['object'] . self::Structure_Separator . $conf['foreign_table'] . '_selector"' . $this->fObj->insertDefStyle('select
') . ($size ? ' size=
"' . $size . '"' : '') . ' onchange=
"' . htmlspecialchars($onChange) . '"' . $PA['onFocus
'] . $selector_itemListStyle . ($conf['foreign_unique
'] ? ' isunique=
"isunique"' : '') . '>
876 // Add a "Create new relation" link for adding new relations 877 // This is necessary, if the size of the selector is "1" or if 878 // there is only one record item in the select-box, that is selected by default 879 // The selector-box creates a new relation on using a onChange event (see some line above) 880 if (!empty($conf['appearance
']['createNewRelationLinkTitle
'])) { 881 $createNewRelationText = $GLOBALS['LANG
']->sL($conf['appearance
']['createNewRelationLinkTitle
'], TRUE); 883 $createNewRelationText = $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation
', TRUE); 885 $item .= ' <a href=
"#" class=
"t3-button" onclick=
"' . htmlspecialchars($onChange) . '" align=
"abstop">
' . IconUtility::getSpriteIcon('actions-document-
new', array('title
' => $createNewRelationText)) . $createNewRelationText . '</a>
'; 886 $item = '<div
class=
"t3-form-field-group">
' . $item . '</div>
'; 900 public function renderPossibleRecordsSelectorTypeGroupDB($conf, &$PA) { 901 $config = $PA['fieldConf
']['config
']; 902 ArrayUtility::mergeRecursiveWithOverrule($config, $conf); 903 $foreign_table = $config['foreign_table
']; 904 $allowed = $config['allowed
']; 905 $objectPrefix = $this->inlineNames['object'] . self::Structure_Separator . $foreign_table; 908 if (!empty($config['appearance
']['createNewRelationLinkTitle
'])) { 909 $createNewRelationText = $GLOBALS['LANG
']->sL($config['appearance
']['createNewRelationLinkTitle
'], TRUE); 911 $createNewRelationText = $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation
', TRUE); 913 if (is_array($config['appearance
'])) { 914 if (isset($config['appearance
']['elementBrowserType
'])) { 915 $mode = $config['appearance
']['elementBrowserType
']; 917 if ($mode === 'file
') { 920 if (isset($config['appearance
']['fileUploadAllowed
'])) { 921 $showUpload = (bool)$config['appearance
']['fileUploadAllowed
']; 923 if (isset($config['appearance
']['elementBrowserAllowed
'])) { 924 $allowed = $config['appearance
']['elementBrowserAllowed
']; 927 $browserParams = '|||
' . $allowed . '|
' . $objectPrefix . '|
inline.checkUniqueElement||
inline.importElement
'; 928 $onClick = 'setFormValueOpenBrowser(\
'' . $mode .
'\', \
'' . $browserParams .
'\');
return false;
'; 930 $item = '<a href=
"#" class=
"t3-button" onclick=
"' . htmlspecialchars($onClick) . '">
'; 931 $item .= IconUtility::getSpriteIcon('actions-insert-record
', array('title
' => $createNewRelationText)); 932 $item .= $createNewRelationText . '</a>
'; 934 if ($showUpload && $this->fObj->edit_docModuleUpload) { 935 $folder = $GLOBALS['BE_USER
']->getDefaultUploadFolder(); 936 if ($folder instanceof \TYPO3\CMS\Core\Resource\Folder) { 937 $maxFileSize = GeneralUtility::getMaxUploadFileSize() * 1024; 938 $item .= ' <a href=
"#" class=
"t3-button t3-drag-uploader" 940 data-dropzone-target=
"#' . htmlspecialchars($this->inlineNames['object']) . '" 941 data-insert-dropzone-before=
"1" 942 data-file-irre-
object=
"' . htmlspecialchars($objectPrefix) . '" 943 data-file-allowed=
"' . htmlspecialchars($allowed) . '" 944 data-target-folder=
"' . htmlspecialchars($folder->getCombinedIdentifier()) . '" 945 data-max-file-size=
"' . htmlspecialchars($maxFileSize) . '" 946 ><span
class=
"t3-icon t3-icon-actions t3-icon-actions-edit t3-icon-edit-upload"> </span>
'; 947 $item .= $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.select-and-submit
', TRUE); 950 $this->loadDragUploadJs(); 960 protected function loadDragUploadJs() { 963 $pageRenderer = $GLOBALS['SOBE
']->doc->getPageRenderer(); 964 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileListLocalisation
'); 965 $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DragUploader
'); 966 $pageRenderer->addInlineLanguagelabelFile( 967 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('lang
') . 'locallang_core.xlf
', 981 protected function getLevelInteractionLink($type, $objectPrefix, $conf = array()) { 982 $nameObject = $this->inlineNames['object']; 983 $attributes = array(); 986 $title = $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew
', TRUE); 987 $icon = 'actions-document-
new'; 988 $className = 'typo3-newRecordLink
'; 989 $attributes['class'] = 't3-button inlineNewButton
' . $this->inlineData['config
'][$nameObject]['md5
']; 990 $attributes['onclick
'] = 'return inline.createNewRecord(\
'' . $objectPrefix .
'\')
'; 991 if (!empty($conf['inline']['inlineNewButtonStyle
'])) { 992 $attributes['style
'] = $conf['inline']['inlineNewButtonStyle
']; 994 if (!empty($conf['appearance
']['newRecordLinkAddTitle
'])) { 996 $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew.link
', TRUE), 997 $GLOBALS['LANG
']->sL($GLOBALS['TCA
'][$conf['foreign_table
']]['ctrl
']['title
'], TRUE) 999 } elseif (isset($conf['appearance
']['newRecordLinkTitle
']) && $conf['appearance
']['newRecordLinkTitle
'] !== '') { 1000 $title = $GLOBALS['LANG
']->sL($conf['appearance
']['newRecordLinkTitle
'], TRUE); 1004 $title = $GLOBALS['LANG
']->sL('LLL:EXT:lang/locallang_misc.xlf:localizeAllRecords
', 1); 1005 $icon = 'actions-document-localize
'; 1006 $className = 'typo3-localizationLink
'; 1007 $attributes['class'] = 't3-button
'; 1008 $attributes['onclick
'] = 'return inline.synchronizeLocalizeRecords(\
'' . $objectPrefix .
'\', \
'localize\')';
1011 $title =
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_misc.xlf:synchronizeWithOriginalLanguage', TRUE);
1012 $icon =
'actions-document-synchronize';
1013 $className =
'typo3-synchronizationLink';
1014 $attributes[
'class'] =
't3-button inlineNewButton ' . $this->inlineData[
'config'][$nameObject][
'md5'];
1015 $attributes[
'onclick'] =
'return inline.synchronizeLocalizeRecords(\'' . $objectPrefix .
'\', \
'synchronize\')';
1025 return '<div' . ($className ?
' class="' . $className .
'"' :
'') .
'>' . $link .
'</div>';
1036 $this->fObj->additionalJS_post[] =
' 1037 inline.createDragAndDropSorting("' . $objectId .
'"); 1056 $ajaxIdParts = explode(
'::',
$GLOBALS[
'ajaxID'], 2);
1057 if (isset($ajaxArguments) && is_array($ajaxArguments) && count($ajaxArguments)) {
1058 $ajaxMethod = $ajaxIdParts[1];
1059 switch ($ajaxMethod) {
1060 case 'createNewRecord':
1062 case 'synchronizeLocalizeRecords':
1064 case 'getRecordDetails':
1065 $this->isAjaxCall = TRUE;
1072 $ajaxObj->setContentFormat(
'jsonbody');
1073 $ajaxObj->setContent(call_user_func_array(array(&$this, $ajaxMethod), $ajaxArguments));
1075 case 'setExpandedCollapsedState':
1076 $ajaxObj->setContentFormat(
'jsonbody');
1077 call_user_func_array(array(&$this, $ajaxMethod), $ajaxArguments);
1093 if (empty($ajaxArguments[
'context']) || $level === FALSE) {
1097 $current = &$this->inlineStructure[
'stable'][$level];
1098 $context = json_decode($ajaxArguments[
'context'], TRUE);
1104 $current[
'config'] = $context[
'config'];
1122 $GLOBALS[
'LANG']->includeLLFile(
'EXT:lang/locallang_alt_doc.xlf');
1124 $GLOBALS[
'SOBE'] = new \stdClass();
1125 $GLOBALS[
'SOBE']->MOD_MENU = array(
1126 'showPalettes' =>
'',
1127 'showDescriptions' =>
'',
1131 $GLOBALS[
'SOBE']->MCONF[
'name'] =
'xMOD_alt_doc.php';
1139 $GLOBALS[
'SOBE']->tceforms->inline = $this;
1140 $GLOBALS[
'SOBE']->tceforms->RTEcounter = (int)array_shift($ajaxArguments);
1141 $GLOBALS[
'SOBE']->tceforms->initDefaultBEMode();
1142 $GLOBALS[
'SOBE']->tceforms->palettesCollapsed = !
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'showPalettes'];
1143 $GLOBALS[
'SOBE']->tceforms->disableRTE =
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'disableRTE'];
1144 $GLOBALS[
'SOBE']->tceforms->enableClickMenu = TRUE;
1145 $GLOBALS[
'SOBE']->tceforms->enableTabMenu = TRUE;
1150 $GLOBALS[
'SOBE']->tceforms->clipObj->initializeClipboard();
1163 $jsonArray[
'headData'] = $headTags;
1166 $jsonArray[
'scriptCall'][] = $this->fObj->JSbottom($this->fObj->formName, TRUE);
1168 if ($config[
'appearance'][
'useSortable']) {
1169 $jsonArray[
'scriptCall'][] =
'inline.createDragAndDropSorting(\'' . $this->inlineNames[
'object'] .
'_records\');';
1172 if ($this->fObj->extJSCODE) {
1173 $jsonArray[
'scriptCall'][] = $this->fObj->extJSCODE;
1176 $jsonArray[
'scriptCall'][] =
'changeTextareaElements();';
1188 'scriptCall' => array(
1189 'alert("' . $message .
'");' 1206 $current = $this->inlineStructure[
'unstable'];
1209 $config = $parent[
'config'];
1214 $collapseAll = isset($config[
'appearance'][
'collapseAll']) && $config[
'appearance'][
'collapseAll'];
1215 $expandSingle = isset($config[
'appearance'][
'expandSingle']) && $config[
'appearance'][
'expandSingle'];
1217 $this->fObj->pushToDynNestedStack(
'inline', $this->inlineNames[
'object']);
1220 $record = $this->
getNewRecord($this->inlineFirstPid, $current[
'table']);
1222 if (isset($config[
'foreign_record_defaults']) && is_array($config[
'foreign_record_defaults'])) {
1223 $foreignTableConfig =
$GLOBALS[
'TCA'][$current[
'table']];
1225 $notSettableFields = array(
1226 'uid',
'pid',
't3ver_oid',
't3ver_id',
't3ver_label',
't3ver_wsid',
't3ver_state',
't3ver_stage',
1227 't3ver_count',
't3ver_tstamp',
't3ver_move_id' 1229 $configurationKeysForNotSettableFields = array(
1230 'crdate',
'cruser_id',
'delete',
'origUid',
'transOrigDiffSourceField',
'transOrigPointerField',
1233 foreach ($configurationKeysForNotSettableFields as $configurationKey) {
1234 if (isset($foreignTableConfig[
'ctrl'][$configurationKey])) {
1235 $notSettableFields[] = $foreignTableConfig[
'ctrl'][$configurationKey];
1238 foreach ($config[
'foreign_record_defaults'] as $fieldName => $defaultValue) {
1239 if (isset($foreignTableConfig[
'columns'][$fieldName]) && !in_array($fieldName, $notSettableFields)) {
1240 $record[$fieldName] = $defaultValue;
1245 if ($parent[
'localizationMode'] ===
'select') {
1246 $parentRecord = $this->getRecord(0, $parent[
'table'], $parent[
'uid']);
1247 $parentLanguageField =
$GLOBALS[
'TCA'][$parent[
'table']][
'ctrl'][
'languageField'];
1248 $childLanguageField =
$GLOBALS[
'TCA'][$current[
'table']][
'ctrl'][
'languageField'];
1249 if ($parentRecord[$parentLanguageField] > 0) {
1250 $record[$childLanguageField] = $parentRecord[$parentLanguageField];
1254 $record = $this->getRecord($this->inlineFirstPid, $current[
'table'], $foreignUid);
1259 if ($config[
'foreign_selector'] && $foreignUid) {
1262 $record[$config[
'foreign_selector']] = $selConfig[
'type'] !=
'groupdb' ?
'' : $selConfig[
'table'] .
'_';
1263 $record[$config[
'foreign_selector']] .= $foreignUid;
1266 $objectPrefix = $this->inlineNames[
'object'] . self::Structure_Separator . $current[
'table'];
1267 $objectId = $objectPrefix . self::Structure_Separator . $record[
'uid'];
1270 if ($item === FALSE) {
1273 if (!$current[
'uid']) {
1276 'scriptCall' => array(
1277 'inline.domAddNewRecord(\'bottom\',\'' . $this->inlineNames[
'object'] .
'_records\',\'' . $objectPrefix .
'\',json.data);
', 1278 'inline.memorizeAddRecord(\
'' . $objectPrefix .
'\',\
'' . $record[
'uid'] .
'\',null,\
'' . $foreignUid .
'\');
' 1284 'scriptCall
' => array( 1285 'inline.domAddNewRecord(\
'after\',\'' . $domObjectId .
'_div' .
'\',\
'' . $objectPrefix .
'\',json.data);
', 1286 'inline.memorizeAddRecord(\
'' . $objectPrefix .
'\',\
'' . $record[
'uid'] .
'\',\
'' . $current[
'uid'] .
'\',\
'' . $foreignUid .
'\');
' 1290 $this->getCommonScriptCalls($jsonArray, $config); 1291 // Collapse all other records if requested: 1292 if (!$collapseAll && $expandSingle) { 1293 $jsonArray['scriptCall
'][] = 'inline.collapseAllRecords(\
'' . $objectId .
'\', \
'' . $objectPrefix .
'\', \
'' . $record[
'uid'] .
'\');
'; 1295 // Tell the browser to scroll to the newly created record 1296 $jsonArray['scriptCall
'][] = 'Element.scrollTo(\
'' . $objectId .
'_div\');';
1298 $jsonArray[
'scriptCall'][] =
'inline.fadeOutFadeIn(\'' . $objectId .
'_div\');';
1300 $this->fObj->popFromDynNestedStack();
1312 protected function synchronizeLocalizeRecords($_, $type) {
1317 $parentRecord = $this->getRecord(0, $parent[
'table'], $parent[
'uid']);
1319 $cmd[$parent[
'table']][$parent[
'uid']][
'inlineLocalizeSynchronize'] = $parent[
'field'] .
',' . $type;
1322 $tce->stripslashes_values = FALSE;
1323 $tce->start(array(), $cmd);
1324 $tce->process_cmdmap();
1325 $newItemList = $tce->registerDBList[$parent[
'table']][$parent[
'uid']][$parent[
'field']];
1344 $current = $this->inlineStructure[
'unstable'];
1351 $config = $parent[
'config'];
1353 $config[
'renderFieldsOnly'] = TRUE;
1354 $collapseAll = isset($config[
'appearance'][
'collapseAll']) && $config[
'appearance'][
'collapseAll'];
1355 $expandSingle = isset($config[
'appearance'][
'expandSingle']) && $config[
'appearance'][
'expandSingle'];
1357 $this->fObj->pushToDynNestedStack(
'inline', $this->inlineNames[
'object']);
1358 $record = $this->getRecord($this->inlineFirstPid, $current[
'table'], $current[
'uid']);
1360 $objectPrefix = $this->inlineNames[
'object'] . self::Structure_Separator . $current[
'table'];
1361 $objectId = $objectPrefix . self::Structure_Separator . $record[
'uid'];
1363 if ($item === FALSE) {
1368 'scriptCall' => array(
1369 'inline.domAddRecordDetails(\'' . $domObjectId .
'\',\
'' . $objectPrefix .
'\',
' . ($expandSingle ? '1
' : '0
') . ',json.data);
' 1372 if ($config['foreign_unique
']) { 1373 $jsonArray['scriptCall
'][] = 'inline.removeUsed(\
'' . $objectPrefix .
'\',\
'' . $record[
'uid'] .
'\');
'; 1375 $this->getCommonScriptCalls($jsonArray, $config); 1376 // Collapse all other records if requested: 1377 if (!$collapseAll && $expandSingle) { 1378 $jsonArray['scriptCall
'][] = 'inline.collapseAllRecords(\
'' . $objectId .
'\',\
'' . $objectPrefix .
'\',\
'' . $record[
'uid'] .
'\');
'; 1380 // Remove the current level also from the dynNestedStack of FormEngine: 1381 $this->fObj->popFromDynNestedStack(); 1382 // Return the JSON array: 1393 protected function getExecuteChangesJsonArray($oldItemList, $newItemList) { 1395 $parent = $this->getStructureLevel(-1); 1396 $current = $this->inlineStructure['unstable
']; 1397 $jsonArray = array('scriptCall
' => array()); 1398 $jsonArrayScriptCall = &$jsonArray['scriptCall
']; 1399 $nameObject = $this->inlineNames['object']; 1400 $nameObjectForeignTable = $nameObject . self::Structure_Separator . $current['table
']; 1401 // Get the name of the field pointing to the original record: 1402 $transOrigPointerField = $GLOBALS['TCA
'][$current['table
']]['ctrl
']['transOrigPointerField
']; 1403 // Get the name of the field used as foreign selector (if any): 1404 $foreignSelector = isset($parent['config
']['foreign_selector
']) && $parent['config
']['foreign_selector
'] ? $parent['config
']['foreign_selector
'] : FALSE; 1405 // Convert lists to array with uids of child records: 1406 $oldItems = $this->getRelatedRecordsUidArray($oldItemList); 1407 $newItems = $this->getRelatedRecordsUidArray($newItemList); 1408 // Determine the items that were localized or localized: 1409 $removedItems = array_diff($oldItems, $newItems); 1410 $localizedItems = array_diff($newItems, $oldItems); 1411 // Set the items that should be removed in the forms view: 1412 foreach ($removedItems as $item) { 1413 $jsonArrayScriptCall[] = 'inline.deleteRecord(\
'' . $nameObjectForeignTable . self::Structure_Separator . $item .
'\', {forceDirectRemoval:
true});
'; 1415 // Set the items that should be added in the forms view: 1416 foreach ($localizedItems as $item) { 1417 $row = $this->getRecord($this->inlineFirstPid, $current['table
'], $item); 1418 $selectedValue = $foreignSelector ? '\
'' . $row[$foreignSelector] .
'\'' :
'null';
1420 $jsonArrayScriptCall[] =
'inline.memorizeAddRecord(\'' . $nameObjectForeignTable .
'\', \
'' . $item .
'\', null,
' . $selectedValue . ');
'; 1421 // Remove possible virtual records in the form which showed that a child records could be localized: 1422 if (isset($row[$transOrigPointerField]) && $row[$transOrigPointerField]) { 1423 $jsonArrayScriptCall[] = 'inline.fadeAndRemove(\
'' . $nameObjectForeignTable . self::Structure_Separator . $row[$transOrigPointerField] .
'_div' .
'\');
'; 1427 $jsonArray['data
'] = $data; 1428 array_unshift($jsonArrayScriptCall, 'inline.domAddNewRecord(\
'bottom\', \'' . $nameObject .
'_records\', \'' . $nameObjectForeignTable .
'\', json.data);
'); 1442 public function setExpandedCollapsedState($domObjectId, $expand, $collapse) { 1443 // Parse the DOM identifier (string), add the levels to the structure stack (array), but don't load TCA config
1446 $current = $this->inlineStructure[
'unstable'];
1452 $inlineViewCurrent = &
$inlineView[$top[
'table']][$top[
'uid']];
1456 foreach ($expandUids as
$uid) {
1457 $inlineViewCurrent[$current[
'table']][] =
$uid;
1460 foreach ($collapseUids as $uid) {
1461 $inlineViewCurrent[$current[
'table']] = $this->
removeFromArray($uid, $inlineViewCurrent[$current[
'table']]);
1464 if (is_array($inlineViewCurrent[$current[
'table']])) {
1465 $inlineViewCurrent[$current[
'table']] = array_unique($inlineViewCurrent[$current[
'table']]);
1490 public function getRelatedRecords($table, $field, $row, &$PA, $config) {
1493 $elements = $PA[
'itemFormElValue'];
1494 $foreignTable = $config[
'foreign_table'];
1496 if ($localizationMode != FALSE) {
1497 $language = (int)$row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'languageField']];
1498 $transOrigPointer = (int)$row[
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField']];
1501 if ($language > 0 && $transOrigPointer) {
1503 if ($localizationMode ==
'keep') {
1504 $transOrigRec = $this->getRecord(0, $transOrigTable, $transOrigPointer);
1505 $elements = $transOrigRec[$field];
1506 $pid = $transOrigRec[
'pid'];
1507 } elseif ($localizationMode ==
'select') {
1508 $transOrigRec = $this->getRecord(0, $transOrigTable, $transOrigPointer);
1509 $pid = $transOrigRec[
'pid'];
1510 $fieldValue = $transOrigRec[$field];
1513 if (
$GLOBALS[
'TCA'][$table][
'columns'][$field][
'config'][
'type'] ===
'flex') {
1518 $flexFormFieldValue = $flexFormTools->getArrayValueByPath($flexFormParts, $flexData);
1520 if ($flexFormFieldValue !== NULL) {
1521 $fieldValue = $flexFormFieldValue;
1530 $relatedRecords = array(
'records' => $records,
'count' => count($records));
1532 if (!empty($recordsOriginal)) {
1534 'showPossible' => isset($config[
'appearance'][
'showPossibleLocalizationRecords']) && $config[
'appearance'][
'showPossibleLocalizationRecords'],
1535 'showRemoved' => isset($config[
'appearance'][
'showRemovedLocalizationRecords']) && $config[
'appearance'][
'showRemovedLocalizationRecords']
1538 if ($options[
'showPossible'] || $options[
'showRemoved']) {
1543 if (!empty(
$GLOBALS[
'TCA'][$foreignTable][
'ctrl'][
'transOrigPointerField'])) {
1544 $foreignLanguageField =
$GLOBALS[
'TCA'][$foreignTable][
'ctrl'][
'languageField'];
1546 if (!empty(
$GLOBALS[
'TCA'][$foreignTable][
'ctrl'][
'transOrigPointerField'])) {
1547 $foreignTranslationPointerField =
$GLOBALS[
'TCA'][$foreignTable][
'ctrl'][
'transOrigPointerField'];
1550 foreach ($recordsOriginal as $record) {
1551 if (!empty($foreignLanguageField)) {
1552 $record[$foreignLanguageField] = $language;
1554 if (!empty($foreignTranslationPointerField)) {
1555 $record[$foreignTranslationPointerField] = $record[
'uid'];
1557 $newId = uniqid(
'NEW', TRUE);
1558 $record[
'uid'] = $newId;
1560 $relatedRecords[
'records'][$newId] = $record;
1564 return $relatedRecords;
1579 foreach ($itemArray as $uid) {
1581 if ($record = $this->getRecord($pid, $table, $uid)) {
1582 $records[
$uid] = $record;
1599 foreach ($itemArray as $key => &$value) {
1600 $parts = explode(
'|', $value, 2);
1620 $transOrigPointerField =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'transOrigPointerField'];
1622 foreach ($recordsLocalization as $uid => $row) {
1624 if (isset($row[$transOrigPointerField]) && $row[$transOrigPointerField] > 0) {
1625 $transOrigPointer = $row[$transOrigPointerField];
1626 if (isset($recordsOriginal[$transOrigPointer])) {
1627 unset($recordsOriginal[$transOrigPointer]);
1628 } elseif ($options[
'showRemoved']) {
1629 $row[
'__remove'] = TRUE;
1632 $records[
$uid] = $row;
1635 if ($options[
'showPossible']) {
1636 foreach ($recordsOriginal as $uid => $row) {
1637 $row[
'__create'] = TRUE;
1638 $row[
'__virtual'] = TRUE;
1639 $records[
$uid] = $row;
1657 public function getPossibleRecords($table, $field, $row, $conf, $checkForConfField =
'foreign_selector') {
1659 $tcaTableCtrl =
$GLOBALS[
'TCA'][$table][
'ctrl'];
1661 $foreign_check = $conf[$checkForConfField];
1663 $PA = $foreignConfig[
'PA'];
1664 $config = $PA[
'fieldConf'][
'config'];
1665 if ($foreignConfig[
'type'] ==
'select') {
1667 $selItems = $this->fObj->addSelectOptionsToItemArray($this->fObj->initItemArray($PA[
'fieldConf']), $PA[
'fieldConf'], $this->fObj->setTSconfig($table, $row), $field);
1672 $PA[
'fieldTSConfig'][
'keepItems'],
1679 $selItems = $this->fObj->addItems($selItems, $PA[
'fieldTSConfig'][
'addItems.']);
1680 if (isset($config[
'itemsProcFunc']) && $config[
'itemsProcFunc']) {
1681 $selItems = $this->fObj->procItems($selItems, $PA[
'fieldTSConfig'][
'itemsProcFunc.'], $config, $table, $row, $field);
1685 foreach ($selItems as $tk => $p) {
1687 $languageDeny = $tcaTableCtrl[
'languageField'] && (string)$tcaTableCtrl[
'languageField'] === $field && !
$GLOBALS[
'BE_USER']->checkLanguageAccess($p[1]);
1688 $authModeDeny = $config[
'form_type'] ==
'select' && $config[
'authMode'] && !
$GLOBALS[
'BE_USER']->checkAuthMode($table, $field, $p[1], $config[
'authMode']);
1689 if (in_array($p[1], $removeItems) || $languageDeny || $authModeDeny) {
1690 unset($selItems[$tk]);
1691 } elseif (isset($PA[
'fieldTSConfig'][
'altLabels.'][$p[1]])) {
1692 $selItems[$tk][0] = htmlspecialchars($this->fObj->sL($PA[
'fieldTSConfig'][
'altLabels.'][$p[1]]));
1695 if (($table ===
'pages' || $table ===
'pages_language_overlay') && $field ===
'doktype') {
1697 unset($selItems[$tk]);
1716 public function getUniqueIds($records, $conf = array(), $splitValue = FALSE) {
1717 $uniqueIds = array();
1718 if (isset($conf[
'foreign_unique']) && $conf[
'foreign_unique'] && count($records)) {
1719 foreach ($records as $rec) {
1721 if (!isset($rec[
'__virtual']) || !$rec[
'__virtual']) {
1722 $value = $rec[$conf[
'foreign_unique']];
1726 $itemParts = explode(
'_', $valueParts[0]);
1728 'uid' => array_pop($itemParts),
1729 'table' => implode(
'_', $itemParts)
1732 $uniqueIds[$rec[
'uid']] = $value;
1751 $newRecordPid = $pageTS[
'TCAdefaults.'][$table .
'.'][
'pid'];
1753 $newRecordPid = $parentPid;
1755 return $newRecordPid;
1770 public function getRecord($_, $table, $uid, $cmd =
'') {
1774 if ($workspaceVersion !== FALSE) {
1779 $uid = $workspaceVersion[
'uid'];
1784 $trData->addRawData = TRUE;
1785 $trData->lockRecords = 1;
1786 $trData->disableRTE =
$GLOBALS[
'SOBE']->MOD_SETTINGS[
'disableRTE'];
1788 $trData->fetchRecord($table, $uid, $cmd ===
'new' ?
'new' :
'');
1789 $rec = reset($trData->regTableItems_data);
1802 $rec = $this->getRecord($pid, $table, $pid,
'new');
1803 $rec[
'uid'] = uniqid(
'NEW', TRUE);
1830 'config' => $config,
1839 if ($flexFormParts !== NULL) {
1840 $structure[
'flexform'] = $flexFormParts;
1844 $this->inlineStructure[
'stable'][] = $structure;
1857 if (count($this->inlineStructure[
'stable'])) {
1858 $popItem = array_pop($this->inlineStructure[
'stable']);
1876 if ($current !== FALSE) {
1877 $this->inlineNames = array(
1878 'form' => $this->prependFormFieldNames . $this->
getStructureItemName($current, self::Disposal_AttributeName),
1879 'object' => $this->prependNaming . self::Structure_Separator . $this->inlineFirstPid . self::Structure_Separator . $this->
getStructurePath()
1882 $this->inlineNames = array();
1897 if (is_array($levelData)) {
1898 $parts = array($levelData[
'table'], $levelData[
'uid']);
1900 if (!empty($levelData[
'field'])) {
1901 $parts[] = $levelData[
'field'];
1905 if ($disposal === self::Disposal_AttributeName) {
1906 if (!empty($levelData[
'field']) && !empty($levelData[
'flexform']) && $this->
getStructureLevel(-1) === $levelData) {
1907 $parts[] = implode(
'][', $levelData[
'flexform']);
1909 $name =
'[' . implode(
'][', $parts) .
']';
1912 $name = implode(self::Structure_Separator, $parts);
1914 if (!empty($levelData[
'field']) && !empty($levelData[
'flexform'])) {
1915 array_unshift($levelData[
'flexform'], $name);
1916 $name = implode(self::FlexForm_Separator, $levelData[
'flexform']);
1936 if ($level !== FALSE) {
1937 return $this->inlineStructure[
'stable'][$level];
1952 $inlineStructureCount = count($this->inlineStructure[
'stable']);
1954 $level = $inlineStructureCount + $level;
1956 if ($level >= 0 && $level < $inlineStructureCount) {
1972 $structureLevels = array();
1973 $structureCount = count($this->inlineStructure[
'stable']);
1974 if ($structureDepth < 0 || $structureDepth > $structureCount) {
1975 $structureDepth = $structureCount;
1977 for ($i = 1; $i <= $structureDepth; $i++) {
1980 return implode(self::Structure_Separator, $structureLevels);
1997 $unstable = array();
1998 $vector = array(
'table',
'uid',
'field');
2001 $domObjectId = str_replace(self::FlexForm_Separator, self::FlexForm_Substitute, $domObjectId);
2003 $pattern =
'/^' . $this->prependNaming . self::Structure_Separator .
'(.+?)' . self::Structure_Separator .
'(.+)$/';
2005 if (preg_match($pattern, $domObjectId, $match)) {
2006 $this->inlineFirstPid = $match[1];
2007 $parts = explode(self::Structure_Separator, $match[2]);
2008 $partsCnt = count($parts);
2009 for ($i = 0; $i < $partsCnt; $i++) {
2010 if ($i > 0 && $i % 3 == 0) {
2013 $unstable[
'config'] =
$GLOBALS[
'TCA'][$unstable[
'table']][
'columns'][$unstable[
'field']][
'config'];
2015 $TSconfig = $this->fObj->setTSconfig($unstable[
'table'], array(
'uid' => $unstable[
'uid'],
'pid' => $this->inlineFirstPid), $unstable[
'field']);
2017 if (!$TSconfig[
'disabled']) {
2018 $unstable[
'config'] = $this->fObj->overrideFieldConf($unstable[
'config'], $TSconfig);
2024 if (strpos($unstable[
'field'], self::FlexForm_Substitute) !== FALSE) {
2026 $unstable[
'field'] = array_shift($fieldParts);
2028 if (count($fieldParts) > 0 && $fieldParts[0] ===
'data') {
2029 $unstable[
'flexform'] = $fieldParts;
2033 $this->inlineStructure[
'stable'][] = $unstable;
2034 $unstable = array();
2036 $unstable[$vector[$i % 3]] = $parts[$i];
2039 if (count($unstable)) {
2040 $this->inlineStructure[
'unstable'] = $unstable;
2058 $foreign_table = $config[
'foreign_table'];
2060 if (!$foreign_table || !is_array(
$GLOBALS[
'TCA'][$foreign_table])) {
2064 if (!isset($config[
'appearance']) || !is_array($config[
'appearance'])) {
2065 $config[
'appearance'] = array();
2068 if (isset($config[
'foreign_selector']) && $config[
'foreign_selector'] && (!isset($config[
'appearance'][
'useCombination']) || !$config[
'appearance'][
'useCombination'])) {
2069 $config[
'appearance'][
'levelLinksPosition'] =
'none';
2070 } elseif (!isset($config[
'appearance'][
'levelLinksPosition']) || !in_array($config[
'appearance'][
'levelLinksPosition'], array(
'top',
'bottom',
'both',
'none'))) {
2071 $config[
'appearance'][
'levelLinksPosition'] =
'top';
2074 $enabledControls = array(
2083 if (isset($config[
'appearance'][
'enabledControls']) && is_array($config[
'appearance'][
'enabledControls'])) {
2084 $config[
'appearance'][
'enabledControls'] = array_merge($enabledControls, $config[
'appearance'][
'enabledControls']);
2086 $config[
'appearance'][
'enabledControls'] = $enabledControls;
2106 if (
$GLOBALS[
'BE_USER']->isAdmin()) {
2110 if ($cmd ==
'new') {
2113 $calcPRec = BackendUtility::getRecord(
'pages', $this->inlineFirstPid);
2114 if (!is_array($calcPRec)) {
2118 $CALC_PERMS =
$GLOBALS[
'BE_USER']->calcPerms($calcPRec);
2120 if ($table ==
'pages') {
2122 $hasAccess = $CALC_PERMS & 8 ? 1 : 0;
2125 $hasAccess = $CALC_PERMS & 16 ? 1 : 0;
2127 if ($table ===
'sys_file_reference' && $this->
isMediaOnPages($theUid)) {
2128 $hasAccess = (bool)($CALC_PERMS & 2);
2132 $hasAccess = (bool)($CALC_PERMS & 16);
2140 $calcPRec = BackendUtility::getRecord($table, $theUid);
2142 if (is_array($calcPRec)) {
2144 if ($table ==
'pages') {
2145 $CALC_PERMS =
$GLOBALS[
'BE_USER']->calcPerms($calcPRec);
2146 $hasAccess = $CALC_PERMS & 2 ? 1 : 0;
2149 $CALC_PERMS =
$GLOBALS[
'BE_USER']->calcPerms(BackendUtility::getRecord(
'pages', $calcPRec[
'pid']));
2150 if ($table ===
'sys_file_reference' && $this->
isMediaOnPages($theUid)) {
2151 $hasAccess = (bool)($CALC_PERMS & 2);
2154 $hasAccess = (bool)($CALC_PERMS & 16);
2159 if ($hasAccess || (
int)$calcPRec[
'pid'] === 0 && $isRootLevelRestrictionIgnored) {
2160 $hasAccess =
$GLOBALS[
'BE_USER']->recordEditAccessInternals($table, $calcPRec);
2164 if (!
$GLOBALS[
'BE_USER']->check(
'tables_modify', $table)) {
2168 !empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms_inline.php'][
'checkAccess'])
2169 && is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms_inline.php'][
'checkAccess'])
2171 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/class.t3lib_tceforms_inline.php'][
'checkAccess'] as $_funcRef) {
2176 'hasAccess' => $hasAccess
2182 $deniedAccessReason =
$GLOBALS[
'BE_USER']->errorMsg;
2183 if ($deniedAccessReason) {
2184 debug($deniedAccessReason);
2187 return $hasAccess ? TRUE : FALSE;
2213 $parts = explode(
'|', $string);
2229 foreach ($styleAttrs as $key => $value) {
2230 $style .= ($style ?
' ' :
'') . $key .
': ' . htmlspecialchars($value) .
'; ';
2233 $style =
' style="' . $style .
'"';
2235 if (!$tableAttrs[
'background'] && $this->fObj->borderStyle[2]) {
2236 $tableAttrs[
'background'] = $this->backPath . $this->borderStyle[2];
2238 if (!$tableAttrs[
'class'] && $this->borderStyle[3]) {
2239 $tableAttrs[
'class'] = $this->borderStyle[3];
2241 foreach ($tableAttrs as $key => $value) {
2242 $table .= ($table ?
' ' :
'') . $key .
'="' . htmlspecialchars($value) .
'"';
2244 $out =
'<table ' . $table . $style .
'>' . $section .
'</table>';
2260 if ($level[
'config'][
'foreign_label']) {
2261 $label = $level[
'config'][
'foreign_label'];
2263 $label =
$GLOBALS[
'TCA'][$table][
'ctrl'][
'label'];
2265 return $level[
'config'][
'foreign_table'] === $table && $label == $field ? TRUE : FALSE;
2276 return count($this->inlineStructure[
'stable']);
2315 if (is_array($searchArray) && count($searchArray)) {
2318 reset($searchArray);
2319 $type = key($searchArray);
2320 $searchArray = current($searchArray);
2323 $type = strtoupper($type);
2325 foreach ($searchArray as $key => $value) {
2328 if ($key ==
'%OR') {
2330 } elseif ($key ==
'%AND') {
2334 } elseif (is_array($value)) {
2337 if (isset($subjectArray[$key]) && isset($value)) {
2339 if (is_bool($value)) {
2340 $localMatches += !($subjectArray[$key] xor $value) ? 1 : 0;
2341 } elseif (is_numeric($subjectArray[$key]) && is_numeric($value)) {
2342 $localMatches += $subjectArray[$key] == $value ? 1 : 0;
2344 $localMatches += $subjectArray[$key] === $value ? 1 : 0;
2349 if ($type ==
'%OR' && $localMatches > 0) {
2353 if ($type ==
'%AND' && $localMatches == 0) {
2359 return $localEntries == $localMatches ? TRUE : FALSE;
2370 return is_array($object) && count($object) && array_keys($object) !== range(0,
sizeof($object) - 1) ? TRUE : FALSE;
2383 $pos = array_search($needle, $haystack, $strict);
2384 if ($pos !== FALSE) {
2385 unset($haystack[$pos]);
2401 if (is_array($possibleRecords)) {
2403 foreach ($possibleRecords as $record) {
2404 $flat[$record[1]] = $record[0];
2419 $foreign_table = $conf[
'foreign_table'];
2420 $foreign_selector = $conf[
'foreign_selector'];
2427 $PA[
'fieldConf'] =
$GLOBALS[
'TCA'][$foreign_table][
'columns'][$field];
2428 if ($PA[
'fieldConf'] && $conf[
'foreign_selector_fieldTcaOverride']) {
2431 $PA[
'fieldConf'][
'config'][
'form_type'] = $PA[
'fieldConf'][
'config'][
'form_type'] ?: $PA[
'fieldConf'][
'config'][
'type'];
2433 $PA[
'fieldTSConfig'] = $this->fObj->setTSconfig($foreign_table, array(), $field);
2434 $config = $PA[
'fieldConf'][
'config'];
2438 $table = $type ==
'select' ? $config[
'foreign_table'] : $config[
'allowed'];
2440 if ($foreign_selector && $foreign_selector == $field && $type) {
2448 'selector' => $selector
2461 if ($config[
'type'] ==
'select') {
2463 } elseif ($config[
'type'] ==
'group' && $config[
'internal_type'] ==
'db') {
2481 $skipThisField = FALSE;
2483 $searchArray = array(
2488 'foreign_table' => $table,
2491 'appearance' => array(
'useCombination' => TRUE),
2492 'foreign_selector' => $field
2494 'MM' => $config[
'MM']
2500 'foreign_table' => $config[
'foreign_table'],
2501 'foreign_selector' => $config[
'foreign_field']
2511 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'symmetric_field'] = $field;
2512 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'symmetric_sortby'] = $field;
2514 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'foreign_field'] = $field;
2515 $searchArray[
'%OR'][
'config'][0][
'%AND'][
'%OR'][
'foreign_sortby'] = $field;
2519 return $skipThisField;
2531 if (isset($this->inlineView[$table]) && is_array($this->inlineView[$table])) {
2532 if (in_array($uid, $this->inlineView[$table]) !== FALSE) {
2548 if (isset($uc[
'inlineView']) && is_array($uc[
'inlineView'])) {
2550 foreach ($uc[
'inlineView'] as $topTable => $topRecords) {
2551 foreach ($topRecords as $topUid => $childElements) {
2552 foreach ($childElements as $childTable => $childRecords) {
2553 $uids = array_keys($tce->substNEWwithIDs_table, $childTable);
2555 $newExpandedChildren = array();
2556 foreach ($childRecords as $childUid => $state) {
2557 if ($state && in_array($childUid, $uids)) {
2558 $newChildUid = $tce->substNEWwithIDs[$childUid];
2559 $newExpandedChildren[] = $newChildUid;
2563 if (count($newExpandedChildren)) {
2564 $inlineViewCurrent = &
$inlineView[$topTable][$topUid][$childTable];
2565 if (is_array($inlineViewCurrent)) {
2566 $inlineViewCurrent = array_unique(array_merge($inlineViewCurrent, $newExpandedChildren));
2568 $inlineViewCurrent = $newExpandedChildren;
2587 $margin = ($this->inlineStyles[
'margin-right'] + 1) * 2;
2597 $headTags = array();
2598 $headDataRaw = $this->fObj->JStop() . $this->getJavaScriptAndStyleSheetsOfPageRenderer();
2603 $headDataRaw = str_replace(array(
'/*<![CDATA[*/',
'/*]]>*/'),
'', $headDataRaw);
2605 $headDataRaw = trim(preg_replace(
'/(^|\\r|\\n)( |\\t)+/',
'$1', $headDataRaw));
2607 $tags = array_merge($parseObj->getAllParts($parseObj->splitTags(
'link', $headDataRaw)), $parseObj->getAllParts($parseObj->splitIntoBlock(
'script', $headDataRaw)));
2608 foreach ($tags as $tagData) {
2609 $tagAttributes = $parseObj->get_tag_attributes($parseObj->getFirstTag($tagData), TRUE);
2610 $headTags[] = array(
2611 'name' => $parseObj->getFirstTagName($tagData),
2612 'attributes' => $tagAttributes[0],
2613 'innerHTML' => $parseObj->removeFirstAndLastTag($tagData)
2628 protected function getJavaScriptAndStyleSheetsOfPageRenderer() {
2630 $pageRenderer = clone
$GLOBALS[
'SOBE']->doc->getPageRenderer();
2631 $pageRenderer->setCharSet(
$GLOBALS[
'LANG']->charSet);
2632 $pageRenderer->setTemplateFile(
'EXT:backend/Resources/Private/Templates/helper_javascript_css.html');
2633 $javaScriptAndStyleSheets = $pageRenderer->render();
2634 return $javaScriptAndStyleSheets;
2646 $link = trim($link);
2647 $result =
'<a href="' . ($link ?:
'#') .
'"';
2648 foreach ($attributes as $key => $value) {
2649 $result .=
' ' . $key .
'="' . htmlspecialchars(trim($value)) .
'"';
2651 $result .=
'>' . $text .
'</a>';
2663 $flexFormParts = NULL;
2666 $prefix = preg_quote($this->fObj->prependFormFieldNames,
'#');
2668 if (preg_match(
'#^' . $prefix .
'(?:\[[^]]+\]){3}(\[data\](?:\[[^]]+\]){4,})$#', $formElementName, $matches)) {
2671 trim($matches[1],
'[]')
2675 return $flexFormParts;
2685 if (strpos($theUid,
'NEW') === 0) {
2688 $row = BackendUtility::getRecord(
'sys_file_reference', $theUid);
2689 return ($row[
'fieldname'] ===
'media') && ($row[
'tablenames'] ===
'pages');
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
static getRecordWSOL($table, $uid, $fields=' *', $where='', $useDeleteClause=TRUE, $unsetMovePointers=FALSE)
static readPageAccess($id, $perms_clause)
static getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields=' *')
static isTableWorkspaceEnabled($table)
static getNoRecordTitle($prep=FALSE)
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static canBeInterpretedAsInteger($var)
static getIndpEnv($getEnvName)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
const CONTEXT_IMAGECROPSCALEMASK
static hmac($input, $additionalSecret='')
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
static getProcessedValueExtra($table, $fN, $fV, $fixed_lgd_chars=0, $uid=0, $forceResult=TRUE)
static getRecordTitle($table, $row, $prep=FALSE, $forceResult=TRUE)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getLiveVersionIdOfRecord($table, $uid)
static getInlineLocalizationMode($table, $fieldOrConfig)
static isOnSymmetricSide($parentUid, $parentConf, $childRec)
static isRootLevelRestrictionIgnored($table)
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 getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
debug($variable='', $name=' *variable *', $line=' *line *', $file=' *file *', $recursiveDepth=3, $debugLevel=E_DEBUG)
static getRecordIconAltText($row, $table='pages')
static fixVersioningPid($table, &$rr, $ignoreWorkspaceMatch=FALSE)
static getOriginalTranslationTable($table)
static getRecordTitlePrep($title, $titleLength=0)
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 xml2array($string, $NSprefix='', $reportDocTag=FALSE)
static getPagesTSconfig($id, $rootLine=NULL, $returnPartArray=FALSE)
static isTableLocalizable($table)
static splitTable_Uid($str)
if($ajaxRegistryEntry !==NULL) $ajaxObj
static keepItemsInArray(array $array, $keepItems, $getValueFunc=NULL)