39 'pObj' =>
'Using TemplateAnalyzerModuleFunctionController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
40 'function_key' =>
'Using TemplateAnalyzerModuleFunctionController::$function_key is deprecated, property will be removed in TYPO3 v10.0.',
41 'extClassConf' =>
'Using TemplateAnalyzerModuleFunctionController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
42 'localLangFile' =>
'Using TemplateAnalyzerModuleFunctionController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
49 'initialize_editor' =>
'Using TemplateAnalyzerModuleFunctionController::initialize_editor() is deprecated and will not be possible anymore in TYPO3 v10.0.',
50 'modMenu' =>
'Using TemplateAnalyzerModuleFunctionController::modMenu() is deprecated and will not be possible anymore in TYPO3 v10.0.',
51 'handleExternalFunctionValue' =>
'Using TemplateAnalyzerModuleFunctionController::handleExternalFunctionValue() is deprecated, method will be removed in TYPO3 v10.0.',
118 if (!empty($this->localLangFile)) {
123 $this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
124 $this->localLanguageFilePath =
'EXT:tstemplate/Resources/Private/Language/locallang_analyzer.xlf';
125 $this->pObj->modMenu_setDefaultList .=
',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax';
126 $this->
id = (int)GeneralUtility::_GP(
'id');
137 'ts_analyzer_checkSetup' =>
'1',
138 'ts_analyzer_checkConst' =>
'1',
139 'ts_analyzer_checkLinenum' =>
'1',
140 'ts_analyzer_checkComments' =>
'1',
141 'ts_analyzer_checkCrop' =>
'1',
142 'ts_analyzer_checkSyntax' =>
'1'
156 $this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
159 $rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
160 $rootLine = $rootlineUtility->get();
163 $this->templateService->runThroughTemplates($rootLine, $templateUid);
166 $this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $templateUid);
167 return is_array($this->templateRow);
175 public function main()
182 $assigns[
'manyTemplatesMenu'] = $this->pObj->templateMenu();
183 $assigns[
'LLPrefix'] =
'LLL:' . $this->localLanguageFilePath .
':';
184 if ($assigns[
'manyTemplatesMenu']) {
185 $template_uid = $this->pObj->MOD_SETTINGS[
'templatesOnPage'];
189 if ($assigns[
'existTemplate']) {
190 $assigns[
'siteTitle'] = trim($this->templateRow[
'sitetitle']);
192 $assigns[
'linkWrappedTemplateTitle'] = $this->pObj->linkWrapTemplateTitle($this->templateRow[
'title']);
195 $this->templateService->clearList_const_temp = array_flip($this->templateService->clearList_const);
196 $this->templateService->clearList_setup_temp = array_flip($this->templateService->clearList_setup);
197 $pointer = count($this->templateService->hierarchyInfo);
198 $hierarchyInfo = $this->templateService->ext_process_hierarchyInfo([], $pointer);
199 $assigns[
'hierarchy'] = implode(
'', array_reverse($this->templateService->ext_getTemplateHierarchyArr(
211 $uriBuilder = GeneralUtility::makeInstance(\
TYPO3\CMS\Backend\Routing\UriBuilder::class);
212 $assigns[
'moduleLink'] = (string)$uriBuilder->buildUriFromRoute(
'web_ts', $urlParameters);
214 $assigns[
'template'] = $template = GeneralUtility::_GET(
'template');
215 $addParams = $template ?
'&template=' . $template :
'';
216 $assigns[
'checkboxes'] = [
217 'ts_analyzer_checkLinenum' => [
218 'id' =>
'checkTs_analyzer_checkLinenum',
219 'll' =>
'lineNumbers'
221 'ts_analyzer_checkSyntax' => [
222 'id' =>
'checkTs_analyzer_checkSyntax',
223 'll' =>
'syntaxHighlight'
227 if (!$this->pObj->MOD_SETTINGS[
'ts_analyzer_checkSyntax']) {
228 $assigns[
'checkboxes'][
'ts_analyzer_checkComments'] = [
229 'id' =>
'checkTs_analyzer_checkComments',
232 $assigns[
'checkboxes'][
'ts_analyzer_checkCrop'] = [
233 'id' =>
'checkTs_analyzer_checkCrop',
238 foreach ($assigns[
'checkboxes'] as $key => $conf) {
242 $this->pObj->MOD_SETTINGS[$key],
245 'id="' . $conf[
'id'] .
'"'
250 $this->templateService->ext_lineNumberOffset = 0;
251 $this->templateService->ext_lineNumberOffset_mode =
'const';
252 $assigns[
'constants'] = [];
253 foreach ($this->templateService->constants as $key => $val) {
254 $currentTemplateId = $this->templateService->hierarchyInfo[$key][
'templateID'];
255 if ($currentTemplateId == $template || $template ===
'all') {
256 $assigns[
'constants'][] = [
257 'title' => $this->templateService->hierarchyInfo[$key][
'title'],
258 'content' => $this->templateService->ext_outputTS(
260 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkLinenum'],
261 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkComments'],
262 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkCrop'],
263 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkSyntax'],
267 if ($template !==
'all') {
271 $this->templateService->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
275 $this->templateService->ext_lineNumberOffset = 0;
276 $this->templateService->ext_lineNumberOffset_mode =
'setup';
277 $assigns[
'setups'] = [];
278 foreach ($this->templateService->config as $key => $val) {
279 $currentTemplateId = $this->templateService->hierarchyInfo[$key][
'templateID'];
280 if ($currentTemplateId == $template || $template ===
'all') {
281 $assigns[
'setups'][] = [
282 'title' => $this->templateService->hierarchyInfo[$key][
'title'],
283 'content' => $this->templateService->ext_outputTS(
285 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkLinenum'],
286 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkComments'],
287 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkCrop'],
288 $this->pObj->MOD_SETTINGS[
'ts_analyzer_checkSyntax'],
292 if ($template !==
'all') {
296 $this->templateService->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
300 $view = GeneralUtility::makeInstance(StandaloneView::class);
301 $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
302 'EXT:tstemplate/Resources/Private/Templates/TemplateAnalyzerModuleFunction.html'
304 $view->assignMultiple($assigns);
306 return $view->render();
319 if ($this->function_key) {
320 $this->extClassConf = $this->pObj->getExternalItemConfig(
'web_ts', $this->function_key, $this->pObj->MOD_SETTINGS[$this->function_key]);