2 namespace TYPO3\CMS\Backend\Form;
45 $this->inlineStructure = $structure;
62 $vector = array(
'table',
'uid',
'field');
65 $domObjectId = str_replace(
'---',
':', $domObjectId);
67 $pattern =
'/^data' .
'-' .
'(.+?)' .
'-' .
'(.+)$/';
69 if (preg_match($pattern, $domObjectId, $match)) {
70 $inlineFirstPid = $match[1];
71 $parts = explode(
'-', $match[2]);
72 $partsCnt = count($parts);
73 for ($i = 0; $i < $partsCnt; $i++) {
74 if ($i > 0 && $i % 3 == 0) {
77 $unstable[
'config'] =
$GLOBALS[
'TCA'][$unstable[
'table']][
'columns'][$unstable[
'field']][
'config'];
82 if (!$TSconfig[
'disabled']) {
88 if (strpos($unstable[
'field'],
':') !==
false) {
90 $unstable[
'field'] = array_shift($fieldParts);
92 if (!empty($fieldParts) && $fieldParts[0] ===
'data') {
93 $unstable[
'flexform'] = $fieldParts;
97 $this->inlineStructure[
'stable'][] = $unstable;
100 $unstable[$vector[$i % 3]] = $parts[$i];
102 if (!empty($unstable)) {
103 $this->inlineStructure[
'unstable'] = $unstable;
120 if (empty($contextString) || $level ===
false) {
123 $current = &$this->inlineStructure[
'stable'][$level];
124 $context = json_decode($contextString,
true);
128 $current[
'config'] = $context[
'config'];
153 $this->inlineStructure[
'stable'][] = $structureItem;
164 $inlineFormName =
'';
166 if ($current !==
false) {
169 return $inlineFormName;
181 $inlineDomObjectId =
'';
183 if ($current !==
false) {
184 $inlineDomObjectId =
'data' .
'-' . $inlineFirstPid .
'-' . $this->
getStructurePath();
186 return $inlineDomObjectId;
202 if ($level !==
false) {
203 return $this->inlineStructure[
'stable'][$level];
218 if (!isset($this->inlineStructure[
'unstable'])) {
219 throw new \RuntimeException(
'No unstable inline structure found', 1428582655);
221 return $this->inlineStructure[
'unstable'];
233 $inlineStructureCount = count($this->inlineStructure[
'stable']);
235 $level = $inlineStructureCount + $level;
237 if ($level >= 0 && $level < $inlineStructureCount) {
252 $structureLevels = array();
254 if ($structureDepth < 0 || $structureDepth > $structureCount) {
255 $structureDepth = $structureCount;
257 for ($i = 1; $i <= $structureDepth; $i++) {
260 return implode(
'-', $structureLevels);
271 return count($this->inlineStructure[
'stable']);
285 if (is_array($levelData)) {
286 $parts = array($levelData[
'table'], $levelData[
'uid']);
288 if (!empty($levelData[
'field'])) {
289 $parts[] = $levelData[
'field'];
293 if ($disposal ===
'Disposal_AttributeName') {
294 if (!empty($levelData[
'field']) && !empty($levelData[
'flexform']) && $this->
getStructureLevel(-1) === $levelData) {
295 $parts[] = implode(
'][', $levelData[
'flexform']);
297 $name =
'[' . implode(
'][', $parts) .
']';
300 $name = implode(
'-', $parts);
302 if (!empty($levelData[
'field']) && !empty($levelData[
'flexform'])) {
303 array_unshift($levelData[
'flexform'], $name);
304 $name = implode(
'---', $levelData[
'flexform']);