first commit

This commit is contained in:
salam committed 2026-10-19 08:18:39 +02:00
commit 1218dd1517
12716 files changed
+989233

No files matched your search

@@ -0,0 +1,331 @@
<?php
namespace TYPO3\CMS\Tstemplate\Controller;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\RootlineUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
* TypoScript template analyzer
* @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.
*/
class TemplateAnalyzerModuleFunctionController
{
use PublicPropertyDeprecationTrait;
use PublicMethodDeprecationTrait;
/**
* @var array
*/
private $deprecatedPublicProperties = [
'pObj' => 'Using TemplateAnalyzerModuleFunctionController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
'function_key' => 'Using TemplateAnalyzerModuleFunctionController::$function_key is deprecated, property will be removed in TYPO3 v10.0.',
'extClassConf' => 'Using TemplateAnalyzerModuleFunctionController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
'localLangFile' => 'Using TemplateAnalyzerModuleFunctionController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
];
/**
* @var array
*/
private $deprecatedPublicMethods = [
'initialize_editor' => 'Using TemplateAnalyzerModuleFunctionController::initialize_editor() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'modMenu' => 'Using TemplateAnalyzerModuleFunctionController::modMenu() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'handleExternalFunctionValue' => 'Using TemplateAnalyzerModuleFunctionController::handleExternalFunctionValue() is deprecated, method will be removed in TYPO3 v10.0.',
];
/**
* @var TypoScriptTemplateModuleController
*/
protected $pObj;
/**
* @var string
*/
protected $localLanguageFilePath;
/**
* The currently selected sys_template record
* @var array
*/
protected $templateRow;
/**
* @var ExtendedTemplateService
*/
protected $templateService;
/**
* @var int GET/POST var 'id'
*/
protected $id;
/**
* Can be hardcoded to the name of a locallang.xlf file (from the same directory as the class file) to use/load
* and is included / added to $GLOBALS['LOCAL_LANG']
*
* @see init()
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $localLangFile = '';
/**
* Contains module configuration parts from TBE_MODULES_EXT if found
*
* @see handleExternalFunctionValue()
* @var array
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $extClassConf;
/**
* If this value is set it points to a key in the TBE_MODULES_EXT array (not on the top level..) where another classname/filepath/title can be defined for sub-subfunctions.
* This is a little hard to explain, so see it in action; it used in the extension 'func_wizards' in order to provide yet a layer of interfacing with the backend module.
* The extension 'func_wizards' has this description: 'Adds the 'Wizards' item to the function menu in Web>Func. This is just a framework for wizard extensions.' - so as you can see it is designed to allow further connectivity - 'level 2'
*
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $function_key = '';
/**
* Init, called from parent object
*
* @param TypoScriptTemplateModuleController $pObj
*/
public function init($pObj)
{
$this->pObj = $pObj;
// Local lang:
if (!empty($this->localLangFile)) {
// @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
$this->getLanguageService()->includeLLFile($this->localLangFile);
}
// Setting MOD_MENU items as we need them for logging:
$this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
$this->localLanguageFilePath = 'EXT:tstemplate/Resources/Private/Language/locallang_analyzer.xlf';
$this->pObj->modMenu_setDefaultList .= ',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax';
$this->id = (int)GeneralUtility::_GP('id');
}
/**
* Mod menu
*
* @return array
*/
protected function modMenu()
{
return [
'ts_analyzer_checkSetup' => '1',
'ts_analyzer_checkConst' => '1',
'ts_analyzer_checkLinenum' => '1',
'ts_analyzer_checkComments' => '1',
'ts_analyzer_checkCrop' => '1',
'ts_analyzer_checkSyntax' => '1'
];
}
/**
* Initialize editor
*
* @param int $pageId
* @param int $templateUid
* @return bool
*/
protected function initialize_editor($pageId, $templateUid = 0)
{
// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
$this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
// Gets the rootLine
$rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
$rootLine = $rootlineUtility->get();
// This generates the constants/config + hierarchy info for the template.
$this->templateService->runThroughTemplates($rootLine, $templateUid);
// Get the row of the first VISIBLE template of the page. whereclause like the frontend.
$this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $templateUid);
return is_array($this->templateRow);
}
/**
* Main, called from parent object
*
* @return string
*/
public function main()
{
// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
// Checking for more than one template an if, set a menu...
$assigns = [];
$template_uid = 0;
$assigns['manyTemplatesMenu'] = $this->pObj->templateMenu();
$assigns['LLPrefix'] = 'LLL:' . $this->localLanguageFilePath . ':';
if ($assigns['manyTemplatesMenu']) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
$assigns['existTemplate'] = $this->initialize_editor($this->id, $template_uid);
if ($assigns['existTemplate']) {
$assigns['siteTitle'] = trim($this->templateRow['sitetitle']);
$assigns['templateRecord'] = $this->templateRow;
$assigns['linkWrappedTemplateTitle'] = $this->pObj->linkWrapTemplateTitle($this->templateRow['title']);
}
$this->templateService->clearList_const_temp = array_flip($this->templateService->clearList_const);
$this->templateService->clearList_setup_temp = array_flip($this->templateService->clearList_setup);
$pointer = count($this->templateService->hierarchyInfo);
$hierarchyInfo = $this->templateService->ext_process_hierarchyInfo([], $pointer);
$assigns['hierarchy'] = implode('', array_reverse($this->templateService->ext_getTemplateHierarchyArr(
$hierarchyInfo,
'',
[],
1
)));
$urlParameters = [
'id' => $this->id,
'template' => 'all'
];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$assigns['moduleLink'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
$assigns['template'] = $template = GeneralUtility::_GET('template');
$addParams = $template ? '&template=' . $template : '';
$assigns['checkboxes'] = [
'ts_analyzer_checkLinenum' => [
'id' => 'checkTs_analyzer_checkLinenum',
'll' => 'lineNumbers'
],
'ts_analyzer_checkSyntax' => [
'id' => 'checkTs_analyzer_checkSyntax',
'll' => 'syntaxHighlight'
]
];
if (!$this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax']) {
$assigns['checkboxes']['ts_analyzer_checkComments'] = [
'id' => 'checkTs_analyzer_checkComments',
'll' => 'comments'
];
$assigns['checkboxes']['ts_analyzer_checkCrop'] = [
'id' => 'checkTs_analyzer_checkCrop',
'll' => 'cropLines'
];
}
foreach ($assigns['checkboxes'] as $key => $conf) {
$assigns['checkboxes'][$key]['label'] = BackendUtility::getFuncCheck(
$this->id,
'SET[' . $key . ']',
$this->pObj->MOD_SETTINGS[$key],
'',
$addParams,
'id="' . $conf['id'] . '"'
);
}
if ($template) {
$this->templateService->ext_lineNumberOffset = 0;
$this->templateService->ext_lineNumberOffset_mode = 'const';
$assigns['constants'] = [];
foreach ($this->templateService->constants as $key => $val) {
$currentTemplateId = $this->templateService->hierarchyInfo[$key]['templateID'];
if ($currentTemplateId == $template || $template === 'all') {
$assigns['constants'][] = [
'title' => $this->templateService->hierarchyInfo[$key]['title'],
'content' => $this->templateService->ext_outputTS(
[$val],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'],
0
)
];
if ($template !== 'all') {
break;
}
}
$this->templateService->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
}
// Output Setup
$this->templateService->ext_lineNumberOffset = 0;
$this->templateService->ext_lineNumberOffset_mode = 'setup';
$assigns['setups'] = [];
foreach ($this->templateService->config as $key => $val) {
$currentTemplateId = $this->templateService->hierarchyInfo[$key]['templateID'];
if ($currentTemplateId == $template || $template === 'all') {
$assigns['setups'][] = [
'title' => $this->templateService->hierarchyInfo[$key]['title'],
'content' => $this->templateService->ext_outputTS(
[$val],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'],
$this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'],
0
)
];
if ($template !== 'all') {
break;
}
}
$this->templateService->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
}
}
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
'EXT:tstemplate/Resources/Private/Templates/TemplateAnalyzerModuleFunction.html'
));
$view->assignMultiple($assigns);
return $view->render();
}
/**
* If $this->function_key is set (which means there are two levels of object connectivity) then
* $this->extClassConf is loaded with the TBE_MODULES_EXT configuration for that sub-sub-module
*
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected function handleExternalFunctionValue()
{
// Must clean first to make sure the correct key is set...
$this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), 'web_ts');
if ($this->function_key) {
$this->extClassConf = $this->pObj->getExternalItemConfig('web_ts', $this->function_key, $this->pObj->MOD_SETTINGS[$this->function_key]);
}
}
/**
* @return LanguageService
*/
protected function getLanguageService(): LanguageService
{
return $GLOBALS['LANG'];
}
}
@@ -0,0 +1,269 @@
<?php
namespace TYPO3\CMS\Tstemplate\Controller;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\RootlineUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
* TypoScript Constant editor
* @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.
*/
class TypoScriptTemplateConstantEditorModuleFunctionController
{
use PublicPropertyDeprecationTrait;
use PublicMethodDeprecationTrait;
/**
* @var array
*/
private $deprecatedPublicProperties = [
'pObj' => 'Using TypoScriptTemplateConstantEditorModuleFunctionController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
'function_key' => 'Using TypoScriptTemplateConstantEditorModuleFunctionController::$function_key is deprecated, property will be removed in TYPO3 v10.0.',
'extClassConf' => 'Using TypoScriptTemplateConstantEditorModuleFunctionController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
'localLangFile' => 'Using TypoScriptTemplateConstantEditorModuleFunctionController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
];
/**
* @var array
*/
private $deprecatedPublicMethods = [
'initialize_editor' => 'Using TypoScriptTemplateConstantEditorModuleFunctionController::initialize_editor() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'handleExternalFunctionValue' => 'Using TypoScriptTemplateConstantEditorModuleFunctionController::handleExternalFunctionValue() is deprecated, method will be removed in TYPO3 v10.0.',
];
/**
* @var TypoScriptTemplateModuleController
*/
protected $pObj;
/**
* The currently selected sys_template record
* @var array
*/
protected $templateRow;
/**
* @var ExtendedTemplateService
*/
protected $templateService;
/**
* @var array
*/
protected $constants;
/**
* @var int GET/POST var 'id'
*/
protected $id;
/**
* Can be hardcoded to the name of a locallang.xlf file (from the same directory as the class file) to use/load
* and is included / added to $GLOBALS['LOCAL_LANG']
*
* @see init()
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $localLangFile = '';
/**
* Contains module configuration parts from TBE_MODULES_EXT if found
*
* @see handleExternalFunctionValue()
* @var array
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $extClassConf;
/**
* If this value is set it points to a key in the TBE_MODULES_EXT array (not on the top level..) where another classname/filepath/title can be defined for sub-subfunctions.
* This is a little hard to explain, so see it in action; it used in the extension 'func_wizards' in order to provide yet a layer of interfacing with the backend module.
* The extension 'func_wizards' has this description: 'Adds the 'Wizards' item to the function menu in Web>Func. This is just a framework for wizard extensions.' - so as you can see it is designed to allow further connectivity - 'level 2'
*
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $function_key = '';
/**
* Init, called from parent object
*
* @param TypoScriptTemplateModuleController $pObj A reference to the parent (calling) object
*/
public function init($pObj)
{
$this->pObj = $pObj;
// Local lang:
if (!empty($this->localLangFile)) {
// @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
$this->getLanguageService()->includeLLFile($this->localLangFile);
}
$this->id = (int)GeneralUtility::_GP('id');
}
/**
* Initialize editor
*
* Initializes the module.
* Done in this function because we may need to re-initialize if data is submitted!
*
* @param int $pageId
* @param int $template_uid
* @return bool
*/
protected function initialize_editor($pageId, $template_uid = 0)
{
$this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
// Get the row of the first VISIBLE template of the page. whereclause like the frontend.
$this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid);
// IF there was a template...
if (is_array($this->templateRow)) {
// Gets the rootLine
$rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
$rootLine = $rootlineUtility->get();
// This generates the constants/config + hierarchy info for the template.
$this->templateService->runThroughTemplates($rootLine, $template_uid);
// The editable constants are returned in an array.
$this->constants = $this->templateService->generateConfig_constants();
// The returned constants are sorted in categories, that goes into the $tmpl->categories array
$this->templateService->ext_categorizeEditableConstants($this->constants);
// This array will contain key=[expanded constant name], value=line number in template.
$this->templateService->ext_regObjectPositions($this->templateRow['constants']);
return true;
}
return false;
}
/**
* Main, called from parent object
*
* @return string
*/
public function main()
{
$assigns = [];
$assigns['LLPrefix'] = 'LLL:EXT:tstemplate/Resources/Private/Language/locallang_ceditor.xlf:';
// Create extension template
$this->pObj->createTemplate($this->id);
// Checking for more than one template an if, set a menu...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
// initialize
$existTemplate = $this->initialize_editor($this->id, $template_uid);
if ($existTemplate) {
$assigns['siteTitle'] = trim($this->templateRow['sitetitle']);
$assigns['templateRecord'] = $this->templateRow;
if ($manyTemplatesMenu) {
$assigns['manyTemplatesMenu'] = $manyTemplatesMenu;
}
$saveId = $this->templateRow['_ORIG_uid'] ?: $this->templateRow['uid'];
// Update template ?
if (GeneralUtility::_POST('_savedok')) {
$this->templateService->changed = 0;
$this->templateService->ext_procesInput(GeneralUtility::_POST(), [], $this->constants, $this->templateRow);
if ($this->templateService->changed) {
// Set the data to be saved
$recData = [];
$recData['sys_template'][$saveId]['constants'] = implode(LF, $this->templateService->raw);
// Create new tce-object
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->start($recData, []);
$tce->process_datamap();
// Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
$tce->clear_cacheCmd('all');
// re-read the template ...
// re-read the constants as they have changed
$this->initialize_editor($this->id, $template_uid);
}
}
// Resetting the menu (start). I wonder if this in any way is a violation of the menu-system. Haven't checked. But need to do it here, because the menu is dependent on the categories available.
$this->pObj->MOD_MENU['constant_editor_cat'] = $this->templateService->ext_getCategoryLabelArray();
$this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), 'web_ts');
// Resetting the menu (stop)
$assigns['title'] = $this->pObj->linkWrapTemplateTitle($this->templateRow['title'], 'constants');
if (!empty($this->pObj->MOD_MENU['constant_editor_cat'])) {
$assigns['constantsMenu'] = BackendUtility::getDropdownMenu($this->id, 'SET[constant_editor_cat]', $this->pObj->MOD_SETTINGS['constant_editor_cat'], $this->pObj->MOD_MENU['constant_editor_cat']);
}
// Category and constant editor config:
$category = $this->pObj->MOD_SETTINGS['constant_editor_cat'];
$printFields = trim($this->templateService->ext_printFields($this->constants, $category));
foreach ($this->templateService->getInlineJavaScript() as $name => $inlineJavaScript) {
$this->getPageRenderer()->addJsInlineCode($name, $inlineJavaScript);
}
if ($printFields) {
$assigns['printFields'] = $printFields;
}
// Rendering of the output via fluid
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
'EXT:tstemplate/Resources/Private/Templates/ConstantEditor.html'
));
$view->assignMultiple($assigns);
$theOutput = $view->render();
} else {
$theOutput = $this->pObj->noTemplate(1);
}
return $theOutput;
}
/**
* If $this->function_key is set (which means there are two levels of object connectivity) then
* $this->extClassConf is loaded with the TBE_MODULES_EXT configuration for that sub-sub-module
*
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected function handleExternalFunctionValue()
{
// Must clean first to make sure the correct key is set...
$this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), 'web_ts');
if ($this->function_key) {
$this->extClassConf = $this->pObj->getExternalItemConfig('web_ts', $this->function_key, $this->pObj->MOD_SETTINGS[$this->function_key]);
}
}
/**
* @return LanguageService
*/
protected function getLanguageService(): LanguageService
{
return $GLOBALS['LANG'];
}
/**
* @return PageRenderer
*/
protected function getPageRenderer(): PageRenderer
{
return GeneralUtility::makeInstance(PageRenderer::class);
}
}
@@ -0,0 +1,287 @@
<?php
namespace TYPO3\CMS\Tstemplate\Controller;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\HttpUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
* This class displays the Info/Modify screen of the Web > Template module
* @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.
*/
class TypoScriptTemplateInformationModuleFunctionController
{
use PublicPropertyDeprecationTrait;
use PublicMethodDeprecationTrait;
/**
* @var array
*/
private $deprecatedPublicProperties = [
'pObj' => 'Using TypoScriptTemplateInformationModuleFunctionController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
'function_key' => 'Using TypoScriptTemplateInformationModuleFunctionController::$function_key is deprecated, property will be removed in TYPO3 v10.0.',
'extClassConf' => 'Using TypoScriptTemplateInformationModuleFunctionController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
'localLangFile' => 'Using TypoScriptTemplateInformationModuleFunctionController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
'tce_processed' => 'Using TypoScriptTemplateInformationModuleFunctionController::$tce_processed is deprecated, property will be removed in TYPO3 v10.0.',
];
/**
* @var array
*/
private $deprecatedPublicMethods = [
'initialize_editor' => 'Using TypoScriptTemplateInformationModuleFunctionController::initialize_editor() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'tableRowData' => 'Using TypoScriptTemplateInformationModuleFunctionController::tableRowData() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'handleExternalFunctionValue' => 'Using TypoScriptTemplateInformationModuleFunctionController::handleExternalFunctionValue() is deprecated, method will be removed in TYPO3 v10.0.',
];
/**
* Indicator for t3editor, whether data is stored
*
* @var bool
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $tce_processed = false;
/**
* @var TypoScriptTemplateModuleController
*/
protected $pObj;
/**
* The currently selected sys_template record
* @var array
*/
protected $templateRow;
/**
* @var ExtendedTemplateService
*/
protected $templateService;
/**
* @var int GET/POST var 'id'
*/
protected $id;
/**
* Can be hardcoded to the name of a locallang.xlf file (from the same directory as the class file) to use/load
* and is included / added to $GLOBALS['LOCAL_LANG']
*
* @see init()
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $localLangFile = '';
/**
* Contains module configuration parts from TBE_MODULES_EXT if found
*
* @see handleExternalFunctionValue()
* @var array
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $extClassConf;
/**
* If this value is set it points to a key in the TBE_MODULES_EXT array (not on the top level..) where another classname/filepath/title can be defined for sub-subfunctions.
* This is a little hard to explain, so see it in action; it used in the extension 'func_wizards' in order to provide yet a layer of interfacing with the backend module.
* The extension 'func_wizards' has this description: 'Adds the 'Wizards' item to the function menu in Web>Func. This is just a framework for wizard extensions.' - so as you can see it is designed to allow further connectivity - 'level 2'
*
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $function_key = '';
/**
* Init, called from parent object
*
* @param TypoScriptTemplateModuleController $pObj A reference to the parent (calling) object
*/
public function init($pObj)
{
$this->pObj = $pObj;
// Local lang:
if (!empty($this->localLangFile)) {
// @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
$this->getLanguageService()->includeLLFile($this->localLangFile);
}
$this->id = (int)GeneralUtility::_GP('id');
}
/**
* Gets the data for a row of a HTML table in the fluid template
*
* @param string $label The label to be shown (e.g. 'Title:', 'Sitetitle:')
* @param string $data The data/information to be shown (e.g. 'Template for my site')
* @param string $field The field/variable to be sent on clicking the edit icon (e.g. 'title', 'sitetitle')
* @param int $id The field/variable to be sent on clicking the edit icon (e.g. 'title', 'sitetitle')
* @return array Data for a row of a HTML table
*/
protected function tableRowData($label, $data, $field, $id)
{
$urlParameters = [
'id' => $this->id,
'edit' => [
'sys_template' => [
$id => 'edit'
]
],
'columnsOnly' => $field,
'createExtension' => 0,
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
return [
'url' => $url,
'data' => $data,
'label' => $label
];
}
/**
* Create an instance of \TYPO3\CMS\Core\TypoScript\ExtendedTemplateService
* and looks for the first (visible) template
* record. If $template_uid was given and greater than zero, this record will be checked.
*
* Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
*
* @param int $pageId The uid of the current page
* @param int $template_uid The uid of the template record to be rendered (only if more than one template on the current page)
* @return bool Returns TRUE if a template record was found, otherwise FALSE
*/
protected function initialize_editor($pageId, $template_uid = 0)
{
$this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
// Get the row of the first VISIBLE template of the page. where clause like the frontend.
$this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid);
if (is_array($this->templateRow)) {
return true;
}
return false;
}
/**
* Main, called from parent object
*
* @return string Information of the template status or the taken actions as HTML string
*/
public function main()
{
// Checking for more than one template an if, set a menu...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
// Initialize
$existTemplate = $this->initialize_editor($this->id, $template_uid);
$saveId = 0;
if ($existTemplate) {
$saveId = $this->templateRow['_ORIG_uid'] ?: $this->templateRow['uid'];
}
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
// Create extension template
$newId = $this->pObj->createTemplate($this->id, $saveId);
if ($newId) {
// Switch to new template
$urlParameters = [
'id' => $this->id,
'SET[templatesOnPage]' => $newId
];
$url = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
HttpUtility::redirect($url);
}
$tce = null;
if ($existTemplate) {
$lang = $this->getLanguageService();
$lang->includeLLFile('EXT:tstemplate/Resources/Private/Language/locallang_info.xlf');
$assigns = [];
$assigns['LLPrefix'] = 'LLL:EXT:tstemplate/Resources/Private/Language/locallang_info.xlf:';
$assigns['title'] = trim($this->templateRow['title']);
$assigns['siteTitle'] = trim($this->templateRow['sitetitle']);
$assigns['templateRecord'] = $this->templateRow;
if ($manyTemplatesMenu) {
$assigns['manyTemplatesMenu'] = $manyTemplatesMenu;
}
// Processing:
$tableRows = [];
$tableRows[] = $this->tableRowData($lang->getLL('title'), $this->templateRow['title'], 'title', $this->templateRow['uid']);
$tableRows[] = $this->tableRowData($lang->getLL('sitetitle'), $this->templateRow['sitetitle'], 'sitetitle', $this->templateRow['uid']);
$tableRows[] = $this->tableRowData($lang->getLL('description'), $this->templateRow['description'], 'description', $this->templateRow['uid']);
$tableRows[] = $this->tableRowData($lang->getLL('constants'), sprintf($lang->getLL('editToView'), trim($this->templateRow['constants']) ? count(explode(LF, $this->templateRow['constants'])) : 0), 'constants', $this->templateRow['uid']);
$tableRows[] = $this->tableRowData($lang->getLL('setup'), sprintf($lang->getLL('editToView'), trim($this->templateRow['config']) ? count(explode(LF, $this->templateRow['config'])) : 0), 'config', $this->templateRow['uid']);
$assigns['tableRows'] = $tableRows;
// Edit all icon:
$urlParameters = [
'edit' => [
'sys_template' => [
$this->templateRow['uid'] => 'edit'
]
],
'createExtension' => 0,
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
];
$assigns['editAllUrl'] = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);
// Rendering of the output via fluid
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
'EXT:tstemplate/Resources/Private/Templates/InformationModule.html'
));
$view->assignMultiple($assigns);
$theOutput = $view->render();
} else {
$theOutput = $this->pObj->noTemplate(1);
}
return $theOutput;
}
/**
* If $this->function_key is set (which means there are two levels of object connectivity) then
* $this->extClassConf is loaded with the TBE_MODULES_EXT configuration for that sub-sub-module
*
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected function handleExternalFunctionValue()
{
// Must clean first to make sure the correct key is set...
$this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), 'web_ts');
if ($this->function_key) {
$this->extClassConf = $this->pObj->getExternalItemConfig('web_ts', $this->function_key, $this->pObj->MOD_SETTINGS[$this->function_key]);
}
}
/**
* @return LanguageService
*/
protected function getLanguageService(): LanguageService
{
return $GLOBALS['LANG'];
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,511 @@
<?php
namespace TYPO3\CMS\Tstemplate\Controller;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Compatibility\PublicMethodDeprecationTrait;
use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Exception;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\RootlineUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
* This class displays the submodule "TypoScript Object Browser" inside the Web > Template module
* @internal This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.
*/
class TypoScriptTemplateObjectBrowserModuleFunctionController
{
use PublicPropertyDeprecationTrait;
use PublicMethodDeprecationTrait;
/**
* @var array
*/
private $deprecatedPublicProperties = [
'pObj' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::$pObj is deprecated and will not be possible anymore in TYPO3 v10.0.',
'function_key' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::$function_key is deprecated, property will be removed in TYPO3 v10.0.',
'extClassConf' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::$extClassConf is deprecated, property will be removed in TYPO3 v10.0.',
'localLangFile' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::$localLangFile is deprecated, property will be removed in TYPO3 v10.0.',
];
/**
* @var array
*/
private $deprecatedPublicMethods = [
'initialize_editor' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::initialize_editor() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'modMenu' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::modMenu() is deprecated and will not be possible anymore in TYPO3 v10.0.',
'handleExternalFunctionValue' => 'Using TypoScriptTemplateObjectBrowserModuleFunctionController::handleExternalFunctionValue() is deprecated, method will be removed in TYPO3 v10.0.',
];
/**
* @var string
*/
protected $localLanguageFilePath;
/**
* @var TypoScriptTemplateModuleController
*/
protected $pObj;
/**
* The currently selected sys_template record
* @var array
*/
protected $templateRow;
/**
* @var ExtendedTemplateService
*/
protected $templateService;
/**
* @var int GET/POST var 'id'
*/
protected $id;
/**
* Can be hardcoded to the name of a locallang.xlf file (from the same directory as the class file) to use/load
* and is included / added to $GLOBALS['LOCAL_LANG']
*
* @see init()
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $localLangFile = '';
/**
* Contains module configuration parts from TBE_MODULES_EXT if found
*
* @see handleExternalFunctionValue()
* @var array
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $extClassConf;
/**
* If this value is set it points to a key in the TBE_MODULES_EXT array (not on the top level..) where another classname/filepath/title can be defined for sub-subfunctions.
* This is a little hard to explain, so see it in action; it used in the extension 'func_wizards' in order to provide yet a layer of interfacing with the backend module.
* The extension 'func_wizards' has this description: 'Adds the 'Wizards' item to the function menu in Web>Func. This is just a framework for wizard extensions.' - so as you can see it is designed to allow further connectivity - 'level 2'
*
* @var string
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected $function_key = '';
/**
* Init, called from parent object
*
* @param TypoScriptTemplateModuleController $pObj
*/
public function init($pObj)
{
$this->pObj = $pObj;
// Local lang:
if (!empty($this->localLangFile)) {
// @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
$this->getLanguageService()->includeLLFile($this->localLangFile);
}
// Setting MOD_MENU items as we need them for logging:
$this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
$this->pObj->modMenu_dontValidateList .= ',ts_browser_toplevel_setup,ts_browser_toplevel_const,ts_browser_TLKeys_setup,ts_browser_TLKeys_const';
$this->pObj->modMenu_setDefaultList .= ',ts_browser_fixedLgd,ts_browser_showComments';
$this->localLanguageFilePath = 'EXT:tstemplate/Resources/Private/Language/locallang_objbrowser.xlf';
$this->id = (int)GeneralUtility::_GP('id');
}
/**
* Mod menu
*
* @return array
*/
protected function modMenu()
{
$lang = $this->getLanguageService();
$lang->includeLLFile('EXT:tstemplate/Resources/Private/Language/locallang_objbrowser.xlf');
$modMenu = [
'ts_browser_type' => [
'const' => $lang->getLL('constants'),
'setup' => $lang->getLL('setup')
],
'ts_browser_toplevel_setup' => [
'0' => mb_strtolower($lang->getLL('all'), 'utf-8')
],
'ts_browser_toplevel_const' => [
'0' => mb_strtolower($lang->getLL('all'), 'utf-8')
],
'ts_browser_const' => [
'0' => $lang->getLL('plainSubstitution'),
'subst' => $lang->getLL('substitutedGreen'),
'const' => $lang->getLL('unsubstitutedGreen')
],
'ts_browser_regexsearch' => '1',
'ts_browser_fixedLgd' => '1',
'ts_browser_showComments' => '1',
'ts_browser_alphaSort' => '1'
];
foreach (['setup', 'const'] as $bType) {
$addKey = GeneralUtility::_GET('addKey');
// If any plus-signs were clicked, it's registered.
if (is_array($addKey)) {
reset($addKey);
if (current($addKey)) {
$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][key($addKey)] = key($addKey);
} else {
unset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][key($addKey)]);
}
$this->getBackendUserAuthentication()->pushModuleData('web_ts', $this->pObj->MOD_SETTINGS);
}
if (!empty($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType])) {
$modMenu['ts_browser_toplevel_' . $bType]['-'] = '---';
$modMenu['ts_browser_toplevel_' . $bType] = $modMenu['ts_browser_toplevel_' . $bType] + $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType];
}
}
return $modMenu;
}
/**
* Initialize editor
*
* Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
*
* @param int $pageId
* @param int $template_uid
* @return bool
*/
protected function initialize_editor($pageId, $template_uid = 0)
{
// Defined global here!
$this->templateService = GeneralUtility::makeInstance(ExtendedTemplateService::class);
// Gets the rootLine
$rootlineUtility = GeneralUtility::makeInstance(RootlineUtility::class, $pageId);
$rootLine = $rootlineUtility->get();
// This generates the constants/config + hierarchy info for the template.
$this->templateService->runThroughTemplates($rootLine, $template_uid);
// Get the row of the first VISIBLE template of the page. whereclause like the frontend.
$this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid);
return is_array($this->templateRow);
}
/**
* Main, called from parent object
*
* @return string
*/
public function main()
{
$lang = $this->getLanguageService();
$POST = GeneralUtility::_POST();
// Checking for more than one template an if, set a menu...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
$bType = $this->pObj->MOD_SETTINGS['ts_browser_type'];
$existTemplate = $this->initialize_editor($this->id, $template_uid);
// initialize
$assigns = [];
$assigns['LLPrefix'] = 'LLL:' . $this->localLanguageFilePath . ':';
$assigns['existTemplate'] = $existTemplate;
$assigns['tsBrowserType'] = $this->pObj->MOD_SETTINGS['ts_browser_type'];
if ($existTemplate) {
$assigns['templateRecord'] = $this->templateRow;
$assigns['linkWrapTemplateTitle'] = $this->pObj->linkWrapTemplateTitle($this->templateRow['title'], ($bType === 'setup' ? 'config' : 'constants'));
$assigns['manyTemplatesMenu'] = $manyTemplatesMenu;
if ($POST['add_property'] || $POST['update_value'] || $POST['clear_object']) {
// add property
$line = '';
if (is_array($POST['data'])) {
$name = key($POST['data']);
if ($POST['data'][$name]['name'] !== '') {
// Workaround for this special case: User adds a key and submits by pressing the return key. The form however will use "add_property" which is the name of the first submit button in this form.
unset($POST['update_value']);
$POST['add_property'] = 'Add';
}
if ($POST['add_property']) {
$property = trim($POST['data'][$name]['name']);
if (preg_replace('/[^a-zA-Z0-9_\\.]*/', '', $property) != $property) {
$badPropertyMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noSpaces') . $lang->getLL('nothingUpdated'), $lang->getLL('badProperty'), FlashMessage::ERROR);
$this->addFlashMessage($badPropertyMessage);
} else {
$pline = $name . '.' . $property . ' = ' . trim($POST['data'][$name]['propertyValue']);
$propertyAddedMessage = GeneralUtility::makeInstance(FlashMessage::class, $pline, $lang->getLL('propertyAdded'));
$this->addFlashMessage($propertyAddedMessage);
$line .= LF . $pline;
}
} elseif ($POST['update_value']) {
$pline = $name . ' = ' . trim($POST['data'][$name]['value']);
$updatedMessage = GeneralUtility::makeInstance(FlashMessage::class, $pline, $lang->getLL('valueUpdated'));
$this->addFlashMessage($updatedMessage);
$line .= LF . $pline;
} elseif ($POST['clear_object']) {
if ($POST['data'][$name]['clearValue']) {
$pline = $name . ' >';
$objectClearedMessage = GeneralUtility::makeInstance(FlashMessage::class, $pline, $lang->getLL('objectCleared'));
$this->addFlashMessage($objectClearedMessage);
$line .= LF . $pline;
}
}
}
if ($line) {
$saveId = $this->templateRow['_ORIG_uid'] ?: $this->templateRow['uid'];
// Set the data to be saved
$recData = [];
$field = $bType === 'setup' ? 'config' : 'constants';
$recData['sys_template'][$saveId][$field] = $this->templateRow[$field] . $line;
// Create new tce-object
$tce = GeneralUtility::makeInstance(DataHandler::class);
// Initialize
$tce->start($recData, []);
// Saved the stuff
$tce->process_datamap();
// Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
$tce->clear_cacheCmd('all');
// re-read the template ...
$this->initialize_editor($this->id, $template_uid);
}
}
}
$tsbr = GeneralUtility::_GET('tsbr');
$update = 0;
if (is_array($tsbr)) {
// If any plus-signs were clicked, it's registred.
$this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType] = $this->templateService->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]);
$update = 1;
}
if ($POST['Submit']) {
// If any POST-vars are send, update the condition array
$this->pObj->MOD_SETTINGS['tsbrowser_conditions'] = $POST['conditions'];
$update = 1;
}
if ($update) {
$this->getBackendUserAuthentication()->pushModuleData('web_ts', $this->pObj->MOD_SETTINGS);
}
$this->templateService->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
$this->templateService->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy';
// This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match.
$this->templateService->constantMode = $this->pObj->MOD_SETTINGS['ts_browser_const'];
// "sObj" is set by ExtendedTemplateService to edit single keys
$sObj = GeneralUtility::_GP('sObj');
if (!empty($sObj) && $this->templateService->constantMode) {
$this->templateService->constantMode = 'untouched';
}
$this->templateService->regexMode = $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'];
$this->templateService->fixedLgd = $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'];
$this->templateService->linkObjects = true;
$this->templateService->ext_regLinenumbers = true;
$this->templateService->ext_regComments = $this->pObj->MOD_SETTINGS['ts_browser_showComments'];
$this->templateService->bType = $bType;
if ($this->pObj->MOD_SETTINGS['ts_browser_type'] === 'const') {
$this->templateService->ext_constants_BRP = (int)GeneralUtility::_GP('breakPointLN');
} else {
$this->templateService->ext_config_BRP = (int)GeneralUtility::_GP('breakPointLN');
}
$this->templateService->generateConfig();
if ($bType === 'setup') {
$theSetup = $this->templateService->setup;
} else {
$theSetup = $this->templateService->setup_constants;
}
// EDIT A VALUE:
$assigns['typoScriptPath'] = $sObj;
if (!empty($sObj)) {
list($theSetup, $theSetupValue) = $this->templateService->ext_getSetup($theSetup, $sObj);
$assigns['theSetupValue'] = $theSetupValue;
if ($existTemplate === false) {
$noTemplateMessage = GeneralUtility::makeInstance(FlashMessage::class, $lang->getLL('noCurrentTemplate'), $lang->getLL('edit'), FlashMessage::ERROR);
$this->addFlashMessage($noTemplateMessage);
}
// Links:
$urlParameters = [
'id' => $this->id
];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
$assigns['moduleUrl'] = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
$assigns['isNotInTopLevelKeyList'] = !isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$sObj]);
$assigns['hasProperties'] = !empty($theSetup);
if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$sObj]) {
if (!empty($theSetup)) {
$assigns['moduleUrlObjectListAction'] = $aHref . '&addKey[' . rawurlencode($sObj) . ']=1&SET[ts_browser_toplevel_' . $bType . ']=' . rawurlencode($sObj);
}
} else {
$assigns['moduleUrlObjectListAction'] = $aHref . '&addKey[' . rawurlencode($sObj) . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0';
}
} else {
$this->templateService->tsbrowser_depthKeys = $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType];
if (GeneralUtility::_POST('search') && GeneralUtility::_POST('search_field')) {
// If any POST-vars are send, update the condition array
$searchString = GeneralUtility::_POST('search_field');
try {
$this->templateService->tsbrowser_depthKeys =
$this->templateService->ext_getSearchKeys(
$theSetup,
'',
$searchString,
[]
);
} catch (Exception $e) {
$this->addFlashMessage(
GeneralUtility::makeInstance(FlashMessage::class, sprintf($lang->getLL('error.' . $e->getCode()), $searchString), '', FlashMessage::ERROR)
);
}
}
$assigns['hasTsBrowserTypes'] = is_array($this->pObj->MOD_MENU['ts_browser_type']) && count($this->pObj->MOD_MENU['ts_browser_type']) > 1;
if (is_array($this->pObj->MOD_MENU['ts_browser_type']) && count($this->pObj->MOD_MENU['ts_browser_type']) > 1) {
$assigns['browserTypeDropdownMenu'] = BackendUtility::getDropdownMenu($this->id, 'SET[ts_browser_type]', $bType, $this->pObj->MOD_MENU['ts_browser_type']);
}
$assigns['hasTopLevelInObjectList'] = is_array($this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) && count($this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) > 1;
if (is_array($this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) && count($this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]) > 1) {
$assigns['objectListDropdownMenu'] = BackendUtility::getDropdownMenu($this->id, 'SET[ts_browser_toplevel_' . $bType . ']', $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType], $this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]);
}
$assigns['regexSearchCheckbox'] = BackendUtility::getFuncCheck($this->id, 'SET[ts_browser_regexsearch]', $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'], '', '', 'id="checkTs_browser_regexsearch"');
$assigns['postSearchField'] = $POST['search_field'];
$theKey = $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType];
if (!$theKey || !str_replace('-', '', $theKey)) {
$theKey = '';
}
list($theSetup, $theSetupValue) = $this->templateService->ext_getSetup($theSetup, $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ? $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] : '');
$tree = $this->templateService->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort']);
$tree = $this->templateService->substituteCMarkers($tree);
$urlParameters = [
'id' => $this->id
];
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$aHref = (string)$uriBuilder->buildUriFromRoute('web_ts', $urlParameters);
// Parser Errors:
$pEkey = $bType === 'setup' ? 'config' : 'constants';
$assigns['hasParseErrors'] = !empty($this->templateService->parserErrors[$pEkey]);
if (!empty($this->templateService->parserErrors[$pEkey])) {
$assigns['showErrorDetailsUri'] = $aHref . '&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TemplateAnalyzerModuleFunctionController&template=all&SET[ts_analyzer_checkLinenum]=1#line-';
$assigns['parseErrors'] = $this->templateService->parserErrors[$pEkey];
}
if (isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$theKey])) {
$assigns['moduleUrlRemoveFromObjectList'] = $aHref . '&addKey[' . $theKey . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0';
}
$assigns['hasKeySelected'] = $theKey !== '';
if ($theKey) {
$assigns['treeLabel'] = $theKey;
} else {
$assigns['rootLLKey'] = $bType === 'setup' ? 'setupRoot' : 'constantRoot';
}
$assigns['tsTree'] = $tree;
// second row options
$assigns['isSetupAndCropLinesDisabled'] = $bType === 'setup' && !$this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'];
$assigns['checkBoxShowComments'] = BackendUtility::getFuncCheck($this->id, 'SET[ts_browser_showComments]', $this->pObj->MOD_SETTINGS['ts_browser_showComments'], '', '', 'id="checkTs_browser_showComments"');
$assigns['checkBoxAlphaSort'] = BackendUtility::getFuncCheck($this->id, 'SET[ts_browser_alphaSort]', $this->pObj->MOD_SETTINGS['ts_browser_alphaSort'], '', '', 'id="checkTs_browser_alphaSort"');
$assigns['checkBoxCropLines'] = BackendUtility::getFuncCheck($this->id, 'SET[ts_browser_fixedLgd]', $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'], '', '', 'id="checkTs_browser_fixedLgd"');
if ($bType === 'setup' && !$this->pObj->MOD_SETTINGS['ts_browser_fixedLgd']) {
$assigns['dropdownDisplayConstants'] = BackendUtility::getDropdownMenu($this->id, 'SET[ts_browser_const]', $this->pObj->MOD_SETTINGS['ts_browser_const'], $this->pObj->MOD_MENU['ts_browser_const']);
}
// Conditions:
$assigns['hasConditions'] = is_array($this->templateService->sections) && !empty($this->templateService->sections);
if (is_array($this->templateService->sections) && !empty($this->templateService->sections)) {
$tsConditions = [];
foreach ($this->templateService->sections as $key => $val) {
$tsConditions[] = [
'key' => $key,
'value' => $val,
'label' => $this->templateService->substituteCMarkers(htmlspecialchars($val)),
'isSet' => $this->pObj->MOD_SETTINGS['tsbrowser_conditions'][$key] ? true : false
];
}
$assigns['tsConditions'] = $tsConditions;
}
// Ending section displayoptions
}
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Tooltip');
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName(
'EXT:tstemplate/Resources/Private/Templates/TemplateObjectBrowserModuleFunction.html'
));
$view->assignMultiple($assigns);
return $view->render();
}
/**
* Add flash message to queue
*
* @param FlashMessage $flashMessage
*/
protected function addFlashMessage(FlashMessage $flashMessage)
{
/** @var FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
}
/**
* If $this->function_key is set (which means there are two levels of object connectivity) then
* $this->extClassConf is loaded with the TBE_MODULES_EXT configuration for that sub-sub-module
*
* @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0.
*/
protected function handleExternalFunctionValue()
{
// Must clean first to make sure the correct key is set...
$this->pObj->MOD_SETTINGS = BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), 'web_ts');
if ($this->function_key) {
$this->extClassConf = $this->pObj->getExternalItemConfig('web_ts', $this->function_key, $this->pObj->MOD_SETTINGS[$this->function_key]);
}
}
/**
* @return LanguageService
*/
protected function getLanguageService(): LanguageService
{
return $GLOBALS['LANG'];
}
/**
* @return BackendUserAuthentication
*/
protected function getBackendUserAuthentication(): BackendUserAuthentication
{
return $GLOBALS['BE_USER'];
}
/**
* @return PageRenderer
*/
protected function getPageRenderer(): PageRenderer
{
return GeneralUtility::makeInstance(PageRenderer::class);
}
}
+345
View File
@@ -0,0 +1,345 @@
Some icons used in the TYPO3 project are retrieved from the "Silk" icon set of
Mark James, which can be found at http://famfamfam.com/lab/icons/silk/. This
set is distributed under a Creative Commons Attribution 2.5 License. The
license can be found at http://creativecommons.org/licenses/by/2.5/.
---------------------------------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415815007" source-language="en" datatype="plaintext" original="EXT:tstemplate/Resources/Private/Language/locallang.xlf" date="2011-10-17T20:22:37Z" product-name="tstemplate">
<header/>
<body>
<trans-unit id="moduleTitle" resname="moduleTitle">
<source>Template tools</source>
</trans-unit>
<trans-unit id="templateAnalyzer" resname="templateAnalyzer">
<source>Template Analyzer</source>
</trans-unit>
<trans-unit id="constantEditor" resname="constantEditor">
<source>Constant Editor</source>
</trans-unit>
<trans-unit id="infoModify" resname="infoModify">
<source>Info/Modify</source>
</trans-unit>
<trans-unit id="objectBrowser" resname="objectBrowser">
<source>TypoScript Object Browser</source>
</trans-unit>
<trans-unit id="viewTemplates" resname="viewTemplates">
<source>Viewing templates of</source>
</trans-unit>
<trans-unit id="pageName" resname="pageName">
<source>Page name</source>
</trans-unit>
<trans-unit id="templates" resname="templates">
<source>Templates</source>
</trans-unit>
<trans-unit id="isRoot" resname="isRoot">
<source>Is Root?</source>
</trans-unit>
<trans-unit id="isExt" resname="isExt">
<source>Is Ext?</source>
</trans-unit>
<trans-unit id="overview" resname="overview">
<source>This is an overview of the pages in the database containing one or more template records. Click a page title to go to the page.</source>
</trans-unit>
<trans-unit id="areYouSure" resname="areYouSure">
<source>Are you sure you want to do this?</source>
</trans-unit>
<trans-unit id="noTemplate" resname="noTemplate">
<source>No template</source>
</trans-unit>
<trans-unit id="noTemplateDescription" resname="noTemplateDescription">
<source>There was no template on this page!</source>
</trans-unit>
<trans-unit id="createTemplate" resname="createTemplate">
<source>Create a template record first in order to edit constants!</source>
</trans-unit>
<trans-unit id="createTemplateToEditConfiguration" resname="createTemplateToEditConfiguration">
<source>You need to create a template record below in order to edit your configuration.</source>
</trans-unit>
<trans-unit id="newWebsite" resname="newWebsite">
<source>Create new website</source>
</trans-unit>
<trans-unit id="newWebsiteDescription" resname="newWebsiteDescription">
<source>If you want this page to be the root of a new website, optionally based on one of the standard templates, then press the button below</source>
</trans-unit>
<trans-unit id="newWebsiteAction" resname="newWebsiteAction">
<source>Create template for a new site</source>
</trans-unit>
<trans-unit id="extTemplate" resname="extTemplate">
<source>Create extension template</source>
</trans-unit>
<trans-unit id="extTemplateDescription" resname="extTemplateDescription">
<source>An extension template allows you to enter TypoScript values that will affect only this page and subpages.</source>
</trans-unit>
<trans-unit id="extTemplateAction" resname="extTemplateAction">
<source>Click here to create an extension template.</source>
</trans-unit>
<trans-unit id="goToClosest" resname="goToClosest">
<source>Go to closest page with template</source>
</trans-unit>
<trans-unit id="goToClosestDescription" resname="goToClosestDescription">
<source>Closest template is on page '%s' (uid %s).</source>
</trans-unit>
<trans-unit id="goToClosestAction" resname="goToClosestAction">
<source>Click here to go.</source>
</trans-unit>
<trans-unit id="titleNewSiteStandard" resname="titleNewSiteStandard">
<source>NEW SITE, based on standard</source>
</trans-unit>
<trans-unit id="titleNewSite" resname="titleNewSite">
<source>NEW SITE</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415815003" source-language="en" datatype="plaintext" original="EXT:tstemplate/Resources/Private/Language/locallang_analyzer.xlf" date="2011-10-17T20:22:37Z" product-name="tstemplate">
<header/>
<body>
<trans-unit id="currentTemplate" resname="currentTemplate">
<source>Current template</source>
</trans-unit>
<trans-unit id="title" resname="title">
<source>Title</source>
</trans-unit>
<trans-unit id="rootlevel" resname="rootlevel">
<source>Rootlevel</source>
</trans-unit>
<trans-unit id="clearSetup" resname="clearSetup">
<source>Clear Setup</source>
</trans-unit>
<trans-unit id="clearConstants" resname="clearConstants">
<source>Clear Constants</source>
</trans-unit>
<trans-unit id="pid" resname="pid">
<source>PID</source>
</trans-unit>
<trans-unit id="rootline" resname="rootline">
<source>Rootline</source>
</trans-unit>
<trans-unit id="nextLevel" resname="nextLevel">
<source>Next Level</source>
</trans-unit>
<trans-unit id="templateHierarchy" resname="templateHierarchy">
<source>Template hierarchy</source>
</trans-unit>
<trans-unit id="displayOptions" resname="displayOptions">
<source>Display Options</source>
</trans-unit>
<trans-unit id="lineNumbers" resname="lineNumbers">
<source>Line numbers</source>
</trans-unit>
<trans-unit id="syntaxHighlight" resname="syntaxHighlight">
<source>Syntax highlight</source>
</trans-unit>
<trans-unit id="comments" resname="comments">
<source>Comments</source>
</trans-unit>
<trans-unit id="cropLines" resname="cropLines">
<source>Crop lines</source>
</trans-unit>
<trans-unit id="blockMode" resname="blockMode">
<source>Block mode</source>
</trans-unit>
<trans-unit id="constants" resname="constants">
<source>Constants</source>
</trans-unit>
<trans-unit id="setup" resname="setup">
<source>Setup</source>
</trans-unit>
<trans-unit id="viewCompleteTS" resname="viewCompleteTS">
<source>View the complete TS Listing</source>
</trans-unit>
<trans-unit id="completeTS" resname="completeTS">
<source>Complete TS</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415815004" source-language="en" datatype="plaintext" original="EXT:tstemplate/Resources/Private/Language/locallang_ceditor.xlf" date="2011-10-17T20:22:37Z" product-name="tstemplate">
<header/>
<body>
<trans-unit id="editConstants" resname="editConstants">
<source>Edit constants for template</source>
</trans-unit>
<trans-unit id="category" resname="category">
<source>Category</source>
</trans-unit>
<trans-unit id="noConstants" resname="noConstants">
<source>No constants available</source>
</trans-unit>
<trans-unit id="noConstantsDescription" resname="noConstantsDescription">
<source>There are no editable constants available for the Constant Editor.</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415815005" source-language="en" datatype="plaintext" original="EXT:tstemplate/Resources/Private/Language/locallang_info.xlf" date="2011-10-17T20:22:37Z" product-name="tstemplate">
<header/>
<body>
<trans-unit id="delete" resname="delete">
<source>Delete</source>
</trans-unit>
<trans-unit id="toTop" resname="toTop">
<source>To top</source>
</trans-unit>
<trans-unit id="fileChanged" resname="fileChanged">
<source>File changed</source>
</trans-unit>
<trans-unit id="resourceUpdated" resname="resourceUpdated">
<source>Resource '%s' has been updated.</source>
</trans-unit>
<trans-unit id="templateInformation" resname="templateInformation">
<source>Template information</source>
</trans-unit>
<trans-unit id="title" resname="title">
<source>Title</source>
</trans-unit>
<trans-unit id="sitetitle" resname="sitetitle">
<source>Sitetitle</source>
</trans-unit>
<trans-unit id="description" resname="description">
<source>Description</source>
</trans-unit>
<trans-unit id="allowedExtensions" resname="allowedExtensions">
<source>Allowed extensions</source>
</trans-unit>
<trans-unit id="maxFilesize" resname="maxFilesize">
<source>Max filesize</source>
</trans-unit>
<trans-unit id="uploadResource" resname="uploadResource">
<source>Upload resource</source>
</trans-unit>
<trans-unit id="newTextResource" resname="newTextResource">
<source>New text resource (enter name)</source>
</trans-unit>
<trans-unit id="copyResource" resname="copyResource">
<source>Make a copy of resource</source>
</trans-unit>
<trans-unit id="updateResourceList" resname="updateResourceList">
<source>Update resource list</source>
</trans-unit>
<trans-unit id="constants" resname="constants">
<source>Constants</source>
</trans-unit>
<trans-unit id="file" resname="file">
<source>File</source>
</trans-unit>
<trans-unit id="editResource" resname="editResource">
<source>Edit Resource</source>
</trans-unit>
<trans-unit id="filesizeExceeded" resname="filesizeExceeded">
<source>Filesize exceeded %s KBytes</source>
</trans-unit>
<trans-unit id="notAllowed" resname="notAllowed">
<source>Files larger than %s KBytes are not allowed to be edited.</source>
</trans-unit>
<trans-unit id="setup" resname="setup">
<source>Setup</source>
</trans-unit>
<trans-unit id="resources" resname="resources">
<source>Resources</source>
</trans-unit>
<trans-unit id="editToView" resname="editToView">
<source>(edit to view, %s lines)</source>
</trans-unit>
<trans-unit id="editTemplateRecord" resname="editTemplateRecord">
<source>Edit the whole template record</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415815008" source-language="en" datatype="plaintext" original="EXT:tstemplate/Resources/Private/Language/locallang_mod.xlf" date="2011-10-17T20:22:37Z" product-name="tstemplate">
<header/>
<body>
<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
<source>Template tools</source>
</trans-unit>
<trans-unit id="mlang_labels_tabdescr" resname="mlang_labels_tabdescr">
<source>Here you manage the TypoScript templates which are in charge of the look of your website on the frontend. The module provides specialized features like an object browser, a constant editor and raw editing facilities.&lt;br /&gt;&lt;em&gt;Access for 'admin' users only!&lt;/em&gt;</source>
</trans-unit>
<trans-unit id="mlang_tabs_tab" resname="mlang_tabs_tab">
<source>Template</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0" xmlns:t3="http://typo3.org/schemas/xliff">
<file t3:id="1415815006" source-language="en" datatype="plaintext" original="EXT:tstemplate/Resources/Private/Language/locallang_objbrowser.xlf" date="2011-10-17T20:22:37Z" product-name="tstemplate">
<header/>
<body>
<trans-unit id="constants" resname="constants">
<source>Constants</source>
</trans-unit>
<trans-unit id="setup" resname="setup">
<source>Setup</source>
</trans-unit>
<trans-unit id="all" resname="all">
<source>All</source>
</trans-unit>
<trans-unit id="plainSubstitution" resname="plainSubstitution">
<source>Plain substitution (default)</source>
</trans-unit>
<trans-unit id="substitutedGreen" resname="substitutedGreen">
<source>Substituted constants in green</source>
</trans-unit>
<trans-unit id="unsubstitutedGreen" resname="unsubstitutedGreen">
<source>UN-substituted constants in green</source>
</trans-unit>
<trans-unit id="currentTemplate" resname="currentTemplate">
<source>Current template</source>
</trans-unit>
<trans-unit id="badProperty" resname="badProperty">
<source>Bad property!</source>
</trans-unit>
<trans-unit id="noSpaces" resname="noSpaces">
<source>You must enter a property with characters a-z, A-Z and 0-9, no spaces!</source>
</trans-unit>
<trans-unit id="nothingUpdated" resname="nothingUpdated">
<source>Nothing was updated!</source>
</trans-unit>
<trans-unit id="propertyAdded" resname="propertyAdded">
<source>Property added</source>
</trans-unit>
<trans-unit id="valueUpdated" resname="valueUpdated">
<source>Value updated</source>
</trans-unit>
<trans-unit id="objectCleared" resname="objectCleared">
<source>Object cleared</source>
</trans-unit>
<trans-unit id="updateButton" resname="updateButton">
<source>Update</source>
</trans-unit>
<trans-unit id="editProperty" resname="editProperty">
<source>Edit object/property value</source>
</trans-unit>
<trans-unit id="addButton" resname="addButton">
<source>Add</source>
</trans-unit>
<trans-unit id="addProperty" resname="addProperty">
<source>Add object property</source>
</trans-unit>
<trans-unit id="clear" resname="clear">
<source>Clear?</source>
</trans-unit>
<trans-unit id="clearButton" resname="clearButton">
<source>Clear</source>
</trans-unit>
<trans-unit id="clearObject" resname="clearObject">
<source>Clear object</source>
</trans-unit>
<trans-unit id="edit" resname="edit">
<source>Edit</source>
</trans-unit>
<trans-unit id="noCurrentTemplate" resname="noCurrentTemplate">
<source>You cannot edit properties and values, if there's no current template.</source>
</trans-unit>
<trans-unit id="addKey" resname="addKey">
<source>Add key &quot;%s&quot; to Object List</source>
</trans-unit>
<trans-unit id="back" resname="back">
<source>Back</source>
</trans-unit>
<trans-unit id="browse" resname="browse">
<source>Browse</source>
</trans-unit>
<trans-unit id="objectList" resname="objectList">
<source>Object List</source>
</trans-unit>
<trans-unit id="search" resname="search">
<source>Search</source>
</trans-unit>
<trans-unit id="regExp" resname="regExp">
<source>Regular expressions</source>
</trans-unit>
<trans-unit id="errorsWarnings" resname="errorsWarnings">
<source>Errors and warnings</source>
</trans-unit>
<trans-unit id="errorShowDetails" resname="errorShowDetails">
<source>Show details</source>
</trans-unit>
<trans-unit id="removeKey" resname="removeKey">
<source>Remove key from OL</source>
</trans-unit>
<trans-unit id="setupRoot" resname="setupRoot">
<source>setup root</source>
</trans-unit>
<trans-unit id="constantRoot" resname="constantRoot">
<source>constants root</source>
</trans-unit>
<trans-unit id="displayComments" resname="displayComments">
<source>Display comments</source>
</trans-unit>
<trans-unit id="sortAlphabetically" resname="sortAlphabetically">
<source>Sort alphabetically</source>
</trans-unit>
<trans-unit id="cropLines" resname="cropLines">
<source>Crop lines</source>
</trans-unit>
<trans-unit id="displayConstants" resname="displayConstants">
<source>Display constants</source>
</trans-unit>
<trans-unit id="displayOptions" resname="displayOptions">
<source>Display options</source>
</trans-unit>
<trans-unit id="conditions" resname="conditions">
<source>Conditions</source>
</trans-unit>
<trans-unit id="setConditions" resname="setConditions">
<source>Set conditions</source>
</trans-unit>
<trans-unit id="severity.1" resname="severity.1">
<source>Info</source>
</trans-unit>
<trans-unit id="severity.2" resname="severity.2">
<source>Warning</source>
</trans-unit>
<trans-unit id="severity.3" resname="severity.3">
<source>Error</source>
</trans-unit>
<trans-unit id="error.1446559458" resname="error.1446559458">
<source>Error evaluating regular expression "%s".</source>
</trans-unit>
</body>
</file>
</xliff>
@@ -0,0 +1,36 @@
<f:be.pageRenderer includeRequireJsModules="{0: 'TYPO3/CMS/Tstemplate/ConstantEditor'}" />
<h3><f:translate key="{LLPrefix}editConstants"/></h3>
<div>
<core:iconForRecord table="sys_template" row="{templateRecord}" />
<strong>&nbsp;<f:format.raw>{title}</f:format.raw></strong>
<f:if condition="{siteTitle}">({siteTitle})</f:if>
<f:if condition="{manyTemplatesMenu}">
<div>
<f:format.raw>
{manyTemplatesMenu}
</f:format.raw>
</div>
</f:if>
<div style="padding-top: 10px;"></div>
<f:if condition="{constantsMenu}">
<f:then>
<h3><f:translate key="{LLPrefix}category"/></h3>
<div><span class="text-nowrap">
<div class="form-inline form-inline-spaced"><f:format.raw>{constantsMenu}</f:format.raw></div>
</span></div>
</f:then>
<f:else>
<f:be.infobox title="{f:translate(key:'{LLPrefix}noConstants')}">
{f:translate(key:'{LLPrefix}noConstantsDescription')}
</f:be.infobox>
</f:else>
</f:if>
<div style="padding-top: 15px;"></div>
<f:if condition="{printFields}">
<div>
<f:format.raw>
{printFields}
</f:format.raw>
</div>
</f:if>
</div>
@@ -0,0 +1,3 @@
<f:be.infobox title="{title}" state="{state}">
<f:format.raw>{message}</f:format.raw>
</f:be.infobox>
@@ -0,0 +1,40 @@
<h3><f:translate key="{LLPrefix}templateInformation"/></h3>
<div>
<f:if condition="{siteTitle}">({siteTitle})</f:if>
<f:if condition="{manyTemplatesMenu}">
<div>
<f:format.raw>
{manyTemplatesMenu}
</f:format.raw>
</div>
</f:if>
<f:format.raw>{formResult}</f:format.raw>
<div class="table-fit">
<table class="table table-striped table-hover">
<thead>
<tr>
<td colspan="3">
<a href="#" class="t3js-contextmenutrigger" data-table="sys_template" data-uid="{templateRecord.uid}">
<core:iconForRecord table="sys_template" row="{templateRecord}"/>
</a><strong>{title}</strong>
</td>
</tr>
</thead>
<f:for each="{tableRows}" as="line">
<f:render section="TemplateTableRow" arguments="{line: line}" />
</f:for>
</table>
</div>
<div>
<br />
<a class="btn btn-default" href="{editAllUrl}"><strong><core:icon identifier="actions-document-open" />&nbsp;<f:translate key="{LLPrefix}editTemplateRecord"/></strong></a>
</div>
</div>
<f:section name="TemplateTableRow">
<tr>
<td><a href="{line.url}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:editField')}"><strong>{line.label}</strong></a></td>
<td width="80%">{line.data -> f:format.nl2br()}</td>
<td><a href="{line.url}" title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:editField')}"><span class="btn btn-default"><core:icon identifier="actions-open" /></span></a></td>
</tr>
</f:section>
@@ -0,0 +1,5 @@
<form action="{actionName}" method="post" enctype="multipart/form-data" id="TypoScriptTemplateModuleController" name="editForm" class="form">
<h1><f:translate key="moduleTitle" /></h1>
<f:render partial="{partialName}" arguments="{content: content}" optional="1" />
<f:format.raw>{typoscriptTemplateModuleContent}</f:format.raw>
</form>
@@ -0,0 +1,30 @@
<form action="{content.actionName}" method="post" enctype="multipart/form-data" id="TypoScriptTemplateModuleController" name="editForm" class="form">
<f:be.infobox title="{f:translate(key: 'noTemplate', extensionName:'tstemplate')}" state="{content.state}">
<p>
<f:translate key="noTemplateDescription" />
<br />
<f:translate key="createTemplateToEditConfiguration" />
</p>
</f:be.infobox>
<h2><f:translate key="newWebsite" />{staticsText}</h2>
<div>
<p><f:translate key="newWebsiteDescription" /></p>
{content.selector -> f:format.raw() -> f:or(alternative: '<input type="hidden" name="createStandard" value="" />')}
<input class="btn btn-primary" type="submit" form="TypoScriptTemplateModuleController" name="newWebsite" value="{f:translate(key: 'newWebsiteAction', extensionName:'tstemplate')}" />
</div>
<h2><f:translate key="extTemplate" /></h2>
<div>
<p><f:translate key="extTemplateDescription" /></p>
<input class="btn btn-default" type="submit" form="TypoScriptTemplateModuleController" name="createExtension" value="{f:translate(key: 'extTemplateAction', extensionName:'tstemplate')}" />
</div>
<f:if condition="{content.previousPage}">
<h3><f:translate key="goToClosest" /></h3>
<div>
<p><f:translate key="goToClosestDescription" arguments="{0: content.previousPage.title, 1: content.previousPage.uid}" /></p>
<a class="btn btn-default" href="{content.previousPage.aHref}"><f:translate key="goToClosestAction" /></a>
</div>
</f:if>
</form>
@@ -0,0 +1,96 @@
<html xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" data-namespace-typo3-fluid="true">
<h1><f:translate key="moduleTitle" /></h1>
<div>
<p class="lead"><f:translate key="overview" /></p>
<div class="table-fit">
<table class="table table-striped table-hover" id="ts-overview">
<thead>
<tr>
<th><f:translate key="pageName" /></th>
<th><f:translate key="templates" /></th>
<th><f:translate key="isRoot" /></th>
<th><f:translate key="isExt" /></th>
</tr>
</thead>
<tbody>
<f:for each="{pageTree}" as="page">
<f:render section="PageZeroTableRow" arguments="{page: page, level: 0, template: page._templates.0}" />
</f:for>
</tbody>
</table>
</div>
</div>
<f:section name="PageZeroTableRow">
<f:variable name="maxCharacters" value="30" />
<tr class="{f:if(condition: page.hidden, then: 'inactive')}">
<td class="nowrap">
<span style="width: 1px; height: 1px; display:inline-block; margin-left: {level * 20}px"></span>
<f:if condition="{page}">
<f:then>
<f:if condition="{page._templates}">
<f:then>
<a href="{f:be.uri(route:'web_ts', parameters:'{id: page.uid}')}"
title="ID: {page.uid}">
<core:IconForRecord table="pages" row="{page}" />
{page.title -> f:format.crop(maxCharacters: maxCharacters)}
</a>
</f:then>
<f:else>
<span title="ID: {page.uid}">
<core:IconForRecord table="pages" row="{page}" />
{page.title -> f:format.crop(maxCharacters: maxCharacters)}
</span>
</f:else>
</f:if>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
</td>
<td>
<f:if condition="{template}">
<f:then>
<f:variable name="web_ts_parameters"
value="{id: template.pid, 'SET[templatesOnPage]': template.uid}" />
<a href="{f:be.uri(route:'web_ts', parameters:web_ts_parameters)}"
title="ID: {template.uid} {template.sitetitle}">
<core:IconForRecord table="sys_template" row="{template}" />
{template.title -> f:format.crop(maxCharacters: maxCharacters)}
</a>
</f:then>
<f:else>
&nbsp;
</f:else>
</f:if>
</td>
<td>
<f:if condition="{template}">
{f:if(condition: "{template.root}", then: "{core:icon(identifier: 'status-status-checked')}" )}
</f:if>
</td>
<td>
<f:if condition="{template}">
{f:if(condition: "!{template.root}", then: "{core:icon(identifier: 'status-status-checked')}" )}
</f:if>
</td>
</tr>
<f:if condition="{page}">
<!-- Additional templates -->
<f:if condition="{page._templates -> f:count()}">
<f:for each="{page._templates}" as="template" iteration="i">
<f:if condition="{i.index} > 0">
<f:render section="PageZeroTableRow" arguments="{page: 0, level: level, template: template}" />
</f:if>
</f:for>
</f:if>
<!-- Subpages -->
<f:if condition="{page._nodes -> f:count()}">
<f:for each="{page._nodes}" as="page">
<f:render section="PageZeroTableRow" arguments="{page: page, level: '{level + 1}', template: page._templates.0}" />
</f:for>
</f:if>
</f:if>
</f:section>
</html>
@@ -0,0 +1,69 @@
<f:if condition="{existTemplate}">
<h3><f:translate key="{LLPrefix}currentTemplate"/></h3>
<core:iconForRecord table="sys_template" row="{templateRecord}" />
<strong><f:format.raw>{linkWrappedTemplateTitle}</f:format.raw></strong>
<f:if condition="{siteTitle}">({siteTitle})</f:if>
</f:if>
<f:if condition="{existTemplate}">
<div>
<f:format.raw>
{manyTemplatesMenu}
</f:format.raw>
</div>
</f:if>
<div style="padding-top: 5px;"></div>
<h2><f:translate key="{LLPrefix}templateHierarchy"/></h2>
<div>
<div class="table-fit"><table class="table table-striped table-hover" id="ts-analyzer">
<thead>
<tr>
<th><f:translate key="{LLPrefix}title"/></th>
<th><f:translate key="{LLPrefix}rootlevel"/></th>
<th><f:translate key="{LLPrefix}clearSetup"/></th>
<th><f:translate key="{LLPrefix}clearConstants"/></th>
<th><f:translate key="{LLPrefix}pid"/></th>
<th><f:translate key="{LLPrefix}rootline"/></th>
<th><f:translate key="{LLPrefix}nextLevel"/></th>
</tr>
</thead>
<f:format.raw>{hierarchy}</f:format.raw>
</table>
</div>
</div>
<div style="padding-top: 5px;"></div>
<h2><f:translate key="{LLPrefix}completeTS"/></h2>
<div>
<p><a href="{moduleLink}" class="btn btn-default">
<f:translate key="{LLPrefix}viewCompleteTS"/>
</a></p>
</div>
<div style="padding-top: 15px;"></div>
<h2><f:translate key="{LLPrefix}displayOptions"/></h2>
<div class="tst-analyzer-options">
<f:for each="{checkboxes}" as="checkbox">
<div class="checkbox">
<label for="{checkbox.id}">
<f:format.raw>{checkbox.label}</f:format.raw>
<f:translate key="{LLPrefix}{checkbox.ll}"/>
</label>
</div>
</f:for>
</div>
<div style="padding-top: 25px;"></div>
<f:if condition="{template}">
<h2><f:translate key="{LLPrefix}constants"/></h2>
<f:for each="{constants}" as="constant">
<h3>{constant.title}</h3>
<div class="nowrap">
<f:format.raw>{constant.content}</f:format.raw>
</div>
</f:for>
<div style="padding-top: 15px;"></div>
<h2><f:translate key="{LLPrefix}setups"/></h2>
<f:for each="{setups}" as="setup">
<h3>{setup.title}</h3>
<div class="nowrap">
<f:format.raw>{setup.content}</f:format.raw>
</div>
</f:for>
</f:if>
@@ -0,0 +1,226 @@
<f:if condition="{existTemplate}">
<h3>
<f:translate key="{LLPrefix}currentTemplate"/>
</h3>
<div>
<core:iconForRecord table="sys_template" row="{templateRecord}"/>
<strong>
<f:format.raw>{linkWrapTemplateTitle}</f:format.raw>
</strong>
<f:if condition="{templateRecord.sitetitle} != ''">
({templateRecord.sitetitle})
</f:if>
</div>
</f:if>
<f:if condition="{manyTemplatesMenu}">
<f:format.raw>
{manyTemplatesMenu}
</f:format.raw>
</f:if>
<f:if condition="{typoScriptPath}">
<f:then>
<f:if condition="{existTemplate}">
<f:then>
<div style="padding-top: 10px;">
<div class="form-group">
<h3>
<f:translate key="{LLPrefix}editProperty"/>
</h3>
<label>{typoScriptPath} =</label>
<f:form.textfield class="form-control" name="data[{typoScriptPath}][value]" value="{theSetupValue}"/>
</div>
<f:form.submit value="{f:translate(key:'{LLPrefix}updateButton')}" class="btn btn-default"
name="update_value"/>
</div>
<div style="padding-top: 20px">
<div class="form-group">
<h3>
<f:translate key="{LLPrefix}addProperty"/>
</h3>
</div>
<div class="form-inline form-inline-spaced">
<div class="form-group">
<label class="sr-only">{typoScriptPath}.</label>
<div class="input-group">
<div class="input-group-addon">{typoScriptPath}.</div>
<f:form.textfield class="form-control" name="data[{typoScriptPath}][name]"/>
</div>
</div>
</div>
<div class="form-group">
<label>=</label>
<f:form.textfield class="form-control" name="data[{typoScriptPath}][propertyValue]"/>
</div>
<div class="form-group">
<f:form.submit class="btn btn-default" name="add_property"
value="{f:translate(key:'{LLPrefix}addButton')}"/>
</div>
</div>
<div style="padding-top: 20px;">
<div class="form-group">
<h3>
<f:translate key="{LLPrefix}clearObject"/>
</h3>
</div>
<div class="form-inline form-inline-spaced">
<div class="form-group">
<div class="checkbox">
<label>
{typoScriptPath}
<f:format.case mode="upper">
<f:translate key="{LLPrefix}clear"/>
</f:format.case>
<f:form.checkbox name="data[{typoScriptPath}][clearValue]" value="1"/>
</label>
</div>
</div>
<div class="form-group">
<f:form.submit class="btn btn-default" name="clear_object"
value="{f:translate(key:'{LLPrefix}clearButton')}"/>
</div>
</div>
</div>
<f:if condition="{isNotInTopLevelKeyList}">
<f:then>
<f:if condition="{hasProperties}">
<f:link.external uri="{moduleUrlObjectListAction}" defaultScheme="" class="btn btn-default">
<f:translate key="{LLPrefix}addKey" arguments="{0:'{typoScriptPath}'}"/>
</f:link.external>
</f:if>
</f:then>
<f:else>
<f:link.external uri="{moduleUrlObjectListAction}" defaultScheme="" class="btn btn-default">
<f:translate key="{LLPrefix}removeKey" arguments="{0:'{typoScriptPath}'}"/>
</f:link.external>
</f:else>
</f:if>
</f:then>
<f:else>
{typoScriptPath} = <strong>{theSetupValue}</strong>
</f:else>
</f:if>
<div>
<hr style="margin-top: 5px; margin-bottom: 5px;"/>
<f:link.external uri="{moduleUrl}" defaultScheme="" class="btn btn-default">
<strong><i class="fa fa-chevron-left"></i>&nbsp;
<f:translate key="{LLPrefix}back"/>
</strong>
</f:link.external>
</div>
</f:then>
<f:else>
<f:be.pageRenderer includeRequireJsModules="{0: 'TYPO3/CMS/Tstemplate/TypoScriptObjectBrowser'}"/>
<div class="tsob-menu">
<div class="form-inline">
<f:if condition="{hasTsBrowserTypes}">
<div class="form-group">
<label class="control-label">
<f:translate key="{LLPrefix}browse"/>
</label>
<f:format.raw>{browserTypeDropdownMenu}</f:format.raw>
</div>
</f:if>
<f:if condition="{hasTopLevelInObjectList}">
<div class="form-group">
<label class="control-label" for="ts_browser_toplevel_{tsBrowserType}">
<f:translate key="{LLPrefix}objectList"/>
</label>
<f:format.raw>{objectListDropdownMenu}</f:format.raw>
</div>
</f:if>
<div class="form-group">
<label class="control-label" for="search_field">
<f:translate key="{LLPrefix}search"/>
</label>
<div class="form-group"><input class="form-control" type="search" name="search_field" id="search_field"
value="{postSearchField}"/></div>
</div>
<input class="btn btn-default tsob-search-submit" type="submit" name="search"
value="{f:translate(key: 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:search')}"/>
</div>
<div class="checkbox">
<label for="checkTs_browser_regexsearch">
<f:format.raw>{regexSearchCheckbox}</f:format.raw>
<f:translate key="{LLPrefix}regExp"/>
</label>
</div>
</div>
<f:if condition="{hasParseErrors}">
<div style="padding-top: 10px;"></div>
<f:be.infobox title="{f:translate(key: '{LLPrefix}errorsWarnings')}" state="1">
<f:for each="{parseErrors}" as="parseError">
<f:translate key="{LLPrefix}severity.{parseError.1}"/>
: {parseError.0}
<f:link.external uri="{showErrorDetailsUri}{parseError.2}" defaultScheme="" class="text-warning">
<f:translate key="{LLPrefix}errorShowDetails"/>
</f:link.external>
<br/>
</f:for>
</f:be.infobox>
</f:if>
<div class="panel panel-space panel-default">
<div class="panel-heading">
<f:if condition="{hasKeySelected}">
<f:then>
<strong>{treeLabel}</strong>
</f:then>
<f:else>
<f:format.case mode="upper">
<f:translate key="{LLPrefix}{rootLLKey}" />
</f:format.case>
</f:else>
</f:if>
<strong>{selectedKey}</strong>
<f:if condition="{moduleUrlRemoveFromObjectList}">
<f:link.external uri="{moduleUrlRemoveFromObjectList}" defaultScheme="" class="btn btn-default">
<f:translate key="{LLPrefix}removeKey" />
</f:link.external>
</f:if>
</div>
<div class="panel-body"><f:format.raw>{tsTree}</f:format.raw></div>
</div>
<div>
<h2><f:translate key="{LLPrefix}displayOptions" /></h2>
<div class="typo3-listOptions">
<div class="checkbox">
<label for="checkTs_browser_showComments">
<f:format.raw>{checkBoxShowComments}</f:format.raw>
<f:translate key="{LLPrefix}displayComments" />
</label>
</div>
<div class="checkbox">
<label for="checkTs_browser_alphaSort">
<f:format.raw>{checkBoxAlphaSort}</f:format.raw>
<f:translate key="{LLPrefix}sortAlphabetically" />
</label>
</div>
<div class="checkbox">
<label for="checkTs_browser_fixedLgd">
<f:format.raw>{checkBoxCropLines}</f:format.raw>
<f:translate key="{LLPrefix}cropLines" />
</label>
</div>
</div>
<f:if condition="{isSetupAndCropLinesDisabled}">
<div class="form">
<label><f:translate key="{LLPrefix}displayConstants" /></label>
<f:format.raw>{dropdownDisplayConstants}</f:format.raw>
</div>
</f:if>
<f:if condition="{hasConditions}">
<h2><f:translate key="{LLPrefix}conditions" /></h2>
<div class="typo3-listOptions">
<f:for each="{tsConditions}" as="condition">
<div class="checkbox">
<label for="check{condition.key}">
<f:form.checkbox class="checkbox" name="conditions[{condition.key}]" id="check{condition.key}" value="{condition.value}" checked="{condition.isSet}" />
<f:format.raw>{condition.label}</f:format.raw>
</label>
</div>
</f:for>
</div>
<f:form.submit class="btn btn-default" value="{f:translate(key: '{LLPrefix}setConditions')}" name="Submit"/>
</f:if>
</div>
</f:else>
</f:if>
Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#1A568F" d="M0 0h64v64H0z"/><path fill="#FFF" d="M14 14h36v36H14z"/><path fill="#1A568F" d="M16 16h32v32H16z"/><path fill="#FFF" d="M18 18h28v8H18zM18 28h10v18H18zM30 28h16v18H30z"/></svg>

After

Width:  |  Height:  |  Size: 260 B

@@ -0,0 +1,104 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Module: TYPO3/CMS/Tstemplate/ConstantEditor
* Various functions related to the Constant Editor
* e.g. updating the field and working with colors
*/
define(['jquery'], function($) {
'use strict';
/**
*
* @type {{options: {editIconSelector: string, colorSelectSelector: string, colorInputSelector: string}}}
* @exports TYPO3/CMS/Tstemplate/ConstantEditor
*/
var ConstantEditor = {
options: {
editIconSelector: '.t3js-toggle',
colorSelectSelector: '.t3js-color-select',
colorInputSelector: '.t3js-color-input'
}
};
/**
* initially register event listeners
*
* @param {Object} $editIcon
*/
ConstantEditor.changeProperty = function($editIcon) {
var constantName = $editIcon.attr('rel');
var $defaultDiv = $('#defaultTS-' + constantName);
var $userDiv = $('#userTS-' + constantName);
var $checkBox = $('#check-' + constantName);
var toggleState = $editIcon.data('toggle');
if (toggleState === 'edit') {
$defaultDiv.hide();
$userDiv.show();
$userDiv.find('input').css({background: '#fdf8bd'});
$checkBox.attr('disabled', false).attr('checked', true);
} else if (toggleState === 'undo') {
$userDiv.hide();
$defaultDiv.show();
$checkBox.val('').attr('disabled', true);
}
};
/**
* updates the color from a dropdown
*
* @param {Object} $colorSelect
*/
ConstantEditor.updateColorFromSelect = function($colorSelect) {
var constantName = $colorSelect.attr('rel');
var colorValue = $colorSelect.val();
$('#input-' + constantName).val(colorValue);
$('#colorbox-' + constantName).css({background: colorValue});
};
/**
* updates the color from an input field
*
* @param {Object} $colorInput
*/
ConstantEditor.updateColorFromInput = function($colorInput) {
var constantName = $colorInput.attr('rel');
var colorValue = $colorInput.val();
$('#colorbox-' + constantName).css({background: colorValue});
$('#select-' + constantName).children().each(function(option) {
option.selected = (option.value === colorValue);
});
};
/**
* Registers listeners
*/
ConstantEditor.initializeEvents = function() {
// no DOMready needed since only events for document are registered
$(document).on('click', ConstantEditor.options.editIconSelector, function() {
ConstantEditor.changeProperty($(this));
}).on('change', ConstantEditor.options.colorSelectSelector, function() {
ConstantEditor.updateColorFromSelect($(this));
}).on('blur', ConstantEditor.options.colorInputSelector, function() {
ConstantEditor.updateColorFromInput($(this));
});
};
ConstantEditor.initializeEvents();
return ConstantEditor;
});
@@ -0,0 +1,36 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Module: TYPO3/CMS/Tstemplate/TypoScriptObjectBrowser
* JavaScript for TypoScript Object Browser
* @exports TYPO3/CMS/Tstemplate/TypoScriptObjectBrowser
*/
define(['jquery', 'TYPO3/CMS/Backend/jquery.clearable'], function($) {
var $searchFields = $('input[name="search_field"]');
var searchResultShown = ('' !== $searchFields.first().val());
// make search field clearable
$searchFields.clearable({
onClear: function() {
if (searchResultShown) {
$(this).closest('form').submit();
}
}
});
if (self.location.hash) {
window.scrollTo(window.pageXOffset, window.pageYOffset - 40);
}
});
+34
View File
@@ -0,0 +1,34 @@
{
"name": "typo3/cms-tstemplate",
"type": "typo3-cms-framework",
"description": "Framework for management of TypoScript template records for the CMS frontend.",
"homepage": "https://typo3.org",
"license": ["GPL-2.0-or-later"],
"authors": [{
"name": "TYPO3 Core Team",
"email": "typo3cms@typo3.org",
"role": "Developer"
}],
"config": {
"sort-packages": true
},
"require": {
"typo3/cms-core": "9.5.31"
},
"conflict": {
"typo3/cms": "*"
},
"extra": {
"typo3/cms": {
"Package": {
"partOfFactoryDefault": true
},
"extension-key": "tstemplate"
}
},
"autoload": {
"psr-4": {
"TYPO3\\CMS\\Tstemplate\\": "Classes/"
}
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
$EM_CONF[$_EXTKEY] = [
'title' => 'Web>Template',
'description' => 'Framework for management of TypoScript template records for the CMS frontend.',
'category' => 'module',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
'clearCacheOnLoad' => 0,
'author' => 'TYPO3 Core Team',
'author_email' => 'typo3cms@typo3.org',
'author_company' => '',
'version' => '9.5.31',
'constraints' => [
'depends' => [
'typo3' => '9.5.31',
],
'conflicts' => [],
'suggests' => [],
],
];
+44
View File
@@ -0,0 +1,44 @@
<?php
defined('TYPO3_MODE') or die();
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModule(
'web',
'ts',
'',
'',
[
'routeTarget' => \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::class . '::mainAction',
'access' => 'admin',
'name' => 'web_ts',
'icon' => 'EXT:tstemplate/Resources/Public/Icons/module-tstemplate.svg',
'labels' => 'LLL:EXT:tstemplate/Resources/Private/Language/locallang_mod.xlf'
]
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
'web_ts',
\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController::class,
null,
'LLL:EXT:tstemplate/Resources/Private/Language/locallang.xlf:constantEditor'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
'web_ts',
\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController::class,
null,
'LLL:EXT:tstemplate/Resources/Private/Language/locallang.xlf:infoModify'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
'web_ts',
\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController::class,
null,
'LLL:EXT:tstemplate/Resources/Private/Language/locallang.xlf:objectBrowser'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
'web_ts',
\TYPO3\CMS\Tstemplate\Controller\TemplateAnalyzerModuleFunctionController::class,
null,
'LLL:EXT:tstemplate/Resources/Private/Language/locallang.xlf:templateAnalyzer'
);