| @@ 87-103 (lines=17) @@ | ||
| 84 | * @param int $templateUid |
|
| 85 | * @return bool |
|
| 86 | */ |
|
| 87 | public function initialize_editor($pageId, $templateUid = 0) |
|
| 88 | { |
|
| 89 | // Initializes the module. Done in this function because we may need to re-initialize if data is submitted! |
|
| 90 | $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class); |
|
| 91 | $this->templateService->init(); |
|
| 92 | ||
| 93 | // Gets the rootLine |
|
| 94 | $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId); |
|
| 95 | $rootLine = $rootlineUtility->get(); |
|
| 96 | ||
| 97 | // This generates the constants/config + hierarchy info for the template. |
|
| 98 | $this->templateService->runThroughTemplates($rootLine, $templateUid); |
|
| 99 | ||
| 100 | // Get the row of the first VISIBLE template of the page. whereclause like the frontend. |
|
| 101 | $this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $templateUid); |
|
| 102 | return is_array($this->templateRow); |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * Main |
|
| @@ 127-142 (lines=16) @@ | ||
| 124 | * @param int $template_uid |
|
| 125 | * @return bool |
|
| 126 | */ |
|
| 127 | public function initialize_editor($pageId, $template_uid = 0) |
|
| 128 | { |
|
| 129 | // Defined global here! |
|
| 130 | $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class); |
|
| 131 | $this->templateService->init(); |
|
| 132 | ||
| 133 | // Gets the rootLine |
|
| 134 | $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId); |
|
| 135 | $rootLine = $rootlineUtility->get(); |
|
| 136 | // This generates the constants/config + hierarchy info for the template. |
|
| 137 | $this->templateService->runThroughTemplates($rootLine, $template_uid); |
|
| 138 | ||
| 139 | // Get the row of the first VISIBLE template of the page. whereclause like the frontend. |
|
| 140 | $this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid); |
|
| 141 | return is_array($this->templateRow); |
|
| 142 | } |
|
| 143 | ||
| 144 | /** |
|
| 145 | * Main |
|