44 $this->inlineStructure = $structure;
60 $vector = [
'table',
'uid',
'field'];
63 $domObjectId = str_replace(
'---',
':', $domObjectId);
65 $pattern =
'/^data' .
'-' .
'(.+?)' .
'-' .
'(.+)$/';
67 if (preg_match($pattern, $domObjectId, $match)) {
68 $inlineFirstPid = $match[1];
69 $parts = explode(
'-', $match[2]);
70 $partsCnt = count($parts);
71 for ($i = 0; $i < $partsCnt; $i++) {
72 if ($i > 0 && $i % 3 == 0) {
75 $unstable[
'config'] =
$GLOBALS[
'TCA'][$unstable[
'table']][
'columns'][$unstable[
'field']][
'config'] ?? [];
80 if (!isset($TSconfig[
'disabled']) || !$TSconfig[
'disabled']) {
85 if (strpos($unstable[
'field'],
':') !==
false) {
86 $fieldParts = GeneralUtility::trimExplode(
':', $unstable[
'field']);
87 $unstable[
'field'] = array_shift($fieldParts);
89 if (!empty($fieldParts) && $fieldParts[0] ===
'data') {
90 $unstable[
'flexform'] = $fieldParts;
94 $this->inlineStructure[
'stable'][] = $unstable;
97 $unstable[$vector[$i % 3]] = $parts[$i];
99 if (!empty($unstable)) {
100 $this->inlineStructure[
'unstable'] = $unstable;
115 if (empty($config) || $level ===
false) {
118 $current = &$this->inlineStructure[
'stable'][$level];
119 $current[
'config'] = $config;
139 $this->inlineStructure[
'stable'][] = $structureItem;
150 $inlineFormName =
'';
152 if ($current !==
false) {
155 return $inlineFormName;
167 $inlineDomObjectId =
'';
169 if ($current !==
false) {
170 $inlineDomObjectId =
'data' .
'-' . $inlineFirstPid .
'-' . $this->
getStructurePath();
172 return $inlineDomObjectId;
188 if ($level !==
false) {
189 return $this->inlineStructure[
'stable'][$level];
203 if (!isset($this->inlineStructure[
'unstable'])) {
204 throw new \RuntimeException(
'No unstable inline structure found', 1428582655);
206 return $this->inlineStructure[
'unstable'];
220 $level = $structureCount + $level;
222 if ($level >= 0 && $level < $structureCount) {
237 $structureLevels = [];
239 if ($structureDepth < 0 || $structureDepth > $structureCount) {
240 $structureDepth = $structureCount;
242 for ($i = 1; $i <= $structureDepth; $i++) {
245 return implode(
'-', $structureLevels);
256 if (!isset($this->inlineStructure[
'stable']) || !is_array($this->inlineStructure[
'stable'])) {
259 return count($this->inlineStructure[
'stable']);
273 if (is_array($levelData)) {
274 $parts = [$levelData[
'table'], $levelData[
'uid']];
276 if (!empty($levelData[
'field'])) {
277 $parts[] = $levelData[
'field'];
281 if ($disposal ===
'Disposal_AttributeName') {
282 if (!empty($levelData[
'field']) && !empty($levelData[
'flexform']) && $this->
getStructureLevel(-1) === $levelData) {
283 $parts[] = implode(
'][', $levelData[
'flexform']);
285 $name =
'[' . implode(
'][', $parts) .
']';
288 $name = implode(
'-', $parts);
290 if (!empty($levelData[
'field']) && !empty($levelData[
'flexform'])) {
291 array_unshift($levelData[
'flexform'], $name);
292 $name = implode(
'---', $levelData[
'flexform']);