本文整理汇总了PHP中TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser类的典型用法代码示例。如果您正苦于以下问题:PHP TypoScriptParser类的具体用法?PHP TypoScriptParser怎么用?PHP TypoScriptParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TypoScriptParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
/**
* Setup test by loading some demo ts settings
*/
public function setup()
{
$this->tsConfigString = "plugin.tx_ptextlist.settings {\n\t\t\t\n\t\t\t prototype {\n\t\t\t \n\t\t\t pager.pagerConfigs.default.pagerClassName = Tx_PtExtlist_Domain_Model_Pager_DefaultPager\n\t \t\t\t pager.pagerConfigs.default.enabled = 1\n\t \t\t\t pager.pagerConfigs.default.templatePath = EXT:pt_extlist/\n\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t # This comes from flexform!\n\t\t\t listIdentifier = list1\n\t\t\t\n\t\t\t listConfig.list1 {\n\t\t\t \n\t\t\t backendConfig {\n\t\t\t\n\t\t\t dataBackendClass = Tx_PtExtlist_Domain_DataBackend_MySqlDataBackend_MySqlDataBackend\n\t\t\t dataSourceClass = Tx_PtExtlist_Domain_DataBackend_DataSource_Typo3DataSource\n\t\t\t dataMapperClass = Tx_PtExtlist_Domain_DataBackend_Mapper_ArrayMapper\n\t\t\t queryInterpreterClass = Tx_PtExtlist_Domain_DataBackend_MySqlDataBackend_MySqlInterpreter_MySqlInterpreter\n\t\t\t \n\t\t\t datasource {\n\t\t\t host = " . TYPO3_db_host . "\n\t\t\t username = " . TYPO3_db_username . "\n\t\t\t password = " . TYPO3_db_password . "\n\t\t\t database = " . TYPO3_db . "\n\t\t\t }\n\t\t\t \n\t\t\t tables (\n\t\t\t static_countries, \n\t\t\t static_territories st_continent, \n\t\t\t static_territories st_subcontinent\n\t\t\t )\n\t\t\t \n\t\t\t baseFromClause (\n\t\t\t )\n\t\t\t \n\t\t\t baseWhereClause (\n\t\t\t ) \n\t\t\t \n\t\t\t useEnableFields = 1\n\t\t\t \n\t\t\t }\n\t\t\t \n\t\t\t fields {\n\t\t\t \tfieldIndentifier1 {\n\t\t\t \t\ttable = table1\n\t\t\t \t\tfield = field1\n\t\t\t \t}\n\t\t\t }\n\t\t\t }\n\t\t\t}";
$this->typoScriptParser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$this->typoScriptParser->parse($this->tsConfigString);
$this->tsConfig = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService')->convertTypoScriptArrayToPlainArray($this->typoScriptParser->setup);
$this->configurationBuilder = new Tx_PtExtlist_Domain_Configuration_ConfigurationBuilder($this->tsConfig['plugin']['tx_ptextlist']['settings'], 'list1');
}
示例2: renderField
/**
* Render a Flexible Content Element type selection field
*
* @param array $parameters
* @param mixed $parentObject
* @return string
*/
public function renderField(array &$parameters, &$parentObject)
{
/** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */
$cacheManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('TYPO3\\CMS\\Core\\Cache\\CacheManager');
/** @var StringFrontend $cache */
$cache = $cacheManager->getCache('fluidcontent');
$pageTypoScript = TRUE === $cache->has('pageTsConfig') ? $cache->get('pageTsConfig') : array();
$tsParser = new TypoScriptParser();
$conditions = new ConditionMatcher();
$pageUid = GeneralUtility::_GET('id');
$pageUid = intval($pageUid);
if (0 === $pageUid) {
$pageUid = intval($parameters['row']['pid']);
}
$conditions->setPageId($pageUid);
$tsParser->parse($pageTypoScript, $conditions);
$setup = $tsParser->setup['mod.']['wizards.']['newContentElement.']['wizardItems.'];
if (FALSE === is_array($setup)) {
return LocalizationUtility::translate('pages.no_content_types', 'Fluidcontent');
}
$setup = GeneralUtility::removeDotsFromTS($setup);
$name = $parameters['itemFormElName'];
$value = $parameters['itemFormElValue'];
$select = '<div><select name="' . htmlspecialchars($name) . '" class="formField select" onchange="if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };">' . LF;
$select .= '<option value="">' . $GLOBALS['LANG']->sL('LLL:EXT:fluidcontent/Resources/Private/Language/locallang.xml:tt_content.tx_fed_fcefile', TRUE) . '</option>' . LF;
foreach ($setup as $groupLabel => $configuration) {
$select .= '<optgroup label="' . htmlspecialchars($groupLabel) . '">' . LF;
foreach ($configuration['elements'] as $elementConfiguration) {
$optionValue = $elementConfiguration['tt_content_defValues']['tx_fed_fcefile'];
$selected = $optionValue === $value ? ' selected="selected"' : '';
$label = $elementConfiguration['title'];
$label = $GLOBALS['LANG']->sL($label);
$select .= '<option value="' . htmlspecialchars($optionValue) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>' . LF;
}
$select .= '</optgroup>' . LF;
}
$select .= '</select></div>' . LF;
unset($parentObject);
return $select;
}
示例3: processTemplateRowBeforeSaving
/**
* Process template row before saving
*
* @param array $tplRow Template row
* @return array Preprocessed template row
*/
public function processTemplateRowBeforeSaving(array $tplRow)
{
if ($this->pObj->MOD_SETTINGS['includeTypoScriptFileContent']) {
$tplRow = TypoScriptParser::extractIncludes_array($tplRow);
}
return $tplRow;
}
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:13,代码来源:TypoScriptTemplateInformationModuleFunctionController.php
示例4: getPagesTSconfig
/**
* Returns the Page TSconfig for page with id, $id
*
* @param int $id Page uid for which to create Page TSconfig
* @param array $rootLine If $rootLine is an array, that is used as rootline, otherwise rootline is just calculated
* @param bool $returnPartArray If $returnPartArray is set, then the array with accumulated Page TSconfig is returned non-parsed. Otherwise the output will be parsed by the TypoScript parser.
* @return array Page TSconfig
* @see \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
*/
public static function getPagesTSconfig($id, $rootLine = null, $returnPartArray = false)
{
static $pagesTSconfig_cacheReference = array();
static $combinedTSconfig_cache = array();
$id = (int) $id;
if ($returnPartArray === false && $rootLine === null && isset($pagesTSconfig_cacheReference[$id])) {
return $combinedTSconfig_cache[$pagesTSconfig_cacheReference[$id]];
} else {
$TSconfig = array();
if (!is_array($rootLine)) {
$useCacheForCurrentPageId = true;
$rootLine = self::BEgetRootLine($id, '', true);
} else {
$useCacheForCurrentPageId = false;
}
// Order correctly
ksort($rootLine);
$TSdataArray = array();
// Setting default configuration
$TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];
foreach ($rootLine as $k => $v) {
if (trim($v['tsconfig_includes'])) {
$includeTsConfigFileList = GeneralUtility::trimExplode(',', $v['tsconfig_includes'], true);
// Traversing list
foreach ($includeTsConfigFileList as $key => $includeTsConfigFile) {
if (StringUtility::beginsWith($includeTsConfigFile, 'EXT:')) {
list($includeTsConfigFileExtensionKey, $includeTsConfigFilename) = explode('/', substr($includeTsConfigFile, 4), 2);
if ((string) $includeTsConfigFileExtensionKey !== '' && ExtensionManagementUtility::isLoaded($includeTsConfigFileExtensionKey) && (string) $includeTsConfigFilename !== '') {
$includeTsConfigFileAndPath = ExtensionManagementUtility::extPath($includeTsConfigFileExtensionKey) . $includeTsConfigFilename;
if (file_exists($includeTsConfigFileAndPath)) {
$TSdataArray['uid_' . $v['uid'] . '_static_' . $key] = GeneralUtility::getUrl($includeTsConfigFileAndPath);
}
}
}
}
}
$TSdataArray['uid_' . $v['uid']] = $v['TSconfig'];
}
$TSdataArray = static::emitGetPagesTSconfigPreIncludeSignal($TSdataArray, $id, $rootLine, $returnPartArray);
$TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray);
if ($returnPartArray) {
return $TSdataArray;
}
// Parsing the page TS-Config
$pageTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
/* @var $parseObj \TYPO3\CMS\Backend\Configuration\TsConfigParser */
$parseObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TsConfigParser::class);
$res = $parseObj->parseTSconfig($pageTS, 'PAGES', $id, $rootLine);
if ($res) {
$TSconfig = $res['TSconfig'];
}
$cacheHash = $res['hash'];
// Get User TSconfig overlay
$userTSconfig = static::getBackendUserAuthentication()->userTS['page.'];
if (is_array($userTSconfig)) {
ArrayUtility::mergeRecursiveWithOverrule($TSconfig, $userTSconfig);
$cacheHash .= '_user' . $GLOBALS['BE_USER']->user['uid'];
}
if ($useCacheForCurrentPageId) {
if (!isset($combinedTSconfig_cache[$cacheHash])) {
$combinedTSconfig_cache[$cacheHash] = $TSconfig;
}
$pagesTSconfig_cacheReference[$id] = $cacheHash;
}
}
return $TSconfig;
}
示例5: getPagesTSconfig
/**
* Returns the Page TSconfig for page with id, $id
* Requires class "t3lib_TSparser"
*
* @param $id integer Page uid for which to create Page TSconfig
* @param $rootLine array If $rootLine is an array, that is used as rootline, otherwise rootline is just calculated
* @param boolean $returnPartArray If $returnPartArray is set, then the array with accumulated Page TSconfig is returned non-parsed. Otherwise the output will be parsed by the TypoScript parser.
* @return array Page TSconfig
* @see t3lib_TSparser
*/
public static function getPagesTSconfig($id, $rootLine = '', $returnPartArray = 0)
{
$id = intval($id);
if (!is_array($rootLine)) {
$rootLine = self::BEgetRootLine($id, '', TRUE);
}
// Order correctly
ksort($rootLine);
$TSdataArray = array();
// Setting default configuration
$TSdataArray['defaultPageTSconfig'] = $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'];
foreach ($rootLine as $k => $v) {
$TSdataArray['uid_' . $v['uid']] = $v['TSconfig'];
}
$TSdataArray = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines_array($TSdataArray);
if ($returnPartArray) {
return $TSdataArray;
}
// Parsing the page TS-Config (or getting from cache)
$pageTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['TSconfigConditions']) {
/* @var $parseObj t3lib_TSparser_TSconfig */
$parseObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Configuration\\TsConfigParser');
$res = $parseObj->parseTSconfig($pageTS, 'PAGES', $id, $rootLine);
if ($res) {
$TSconfig = $res['TSconfig'];
}
} else {
$hash = md5('pageTS:' . $pageTS);
$cachedContent = self::getHash($hash);
$TSconfig = array();
if (isset($cachedContent)) {
$TSconfig = unserialize($cachedContent);
} else {
$parseObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$parseObj->parse($pageTS);
$TSconfig = $parseObj->setup;
self::storeHash($hash, serialize($TSconfig), 'PAGES_TSconfig');
}
}
// Get User TSconfig overlay
$userTSconfig = $GLOBALS['BE_USER']->userTS['page.'];
if (is_array($userTSconfig)) {
$TSconfig = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($TSconfig, $userTSconfig);
}
return $TSconfig;
}
示例6: getUserTSconf
/**
* Returns the parsed TSconfig for the fe_user
* The TSconfig will be cached in $this->userTS.
*
* @return array TSconfig array for the fe_user
*/
public function getUserTSconf()
{
if (!$this->userTSUpdated) {
// Parsing the user TS (or getting from cache)
$this->TSdataArray = TypoScriptParser::checkIncludeLines_array($this->TSdataArray);
$userTS = implode(LF . '[GLOBAL]' . LF, $this->TSdataArray);
$parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
$parseObj->parse($userTS);
$this->userTS = $parseObj->setup;
$this->userTSUpdated = true;
}
return $this->userTS;
}
示例7: getPagesTSconfig
/**
* Returns the pages TSconfig array based on the currect ->rootLine
*
* @return array
* @todo Define visibility
*/
public function getPagesTSconfig()
{
if (!is_array($this->pagesTSconfig)) {
$TSdataArray = array();
// Setting default configuration:
$TSdataArray[] = $this->TYPO3_CONF_VARS['BE']['defaultPageTSconfig'];
foreach ($this->rootLine as $k => $v) {
$TSdataArray[] = $v['TSconfig'];
}
// Parsing the user TS (or getting from cache)
$TSdataArray = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines_array($TSdataArray);
$userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
$hash = md5('pageTS:' . $userTS);
$cachedContent = $this->sys_page->getHash($hash);
if (isset($cachedContent)) {
$this->pagesTSconfig = unserialize($cachedContent);
} else {
$parseObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$parseObj->parse($userTS);
$this->pagesTSconfig = $parseObj->setup;
$this->sys_page->storeHash($hash, serialize($this->pagesTSconfig), 'PAGES_TSconfig');
}
}
return $this->pagesTSconfig;
}
示例8: getTyposcriptConfig
/**
* Returns the category TSconfig array based on the currect->rootLine
*
* @todo Make recursiv category TS merging
* @return array
*/
public function getTyposcriptConfig()
{
if (!is_array($this->categoryTSconfig)) {
$tSdataArray[] = $this->tsConfig;
$tSdataArray = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines_array($tSdataArray);
$categoryTs = implode(chr(10) . '[GLOBAL]' . chr(10), $tSdataArray);
/**
* Typoscript parser
*
* @var \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser $parseObj
*/
$parseObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$parseObj->parse($categoryTs);
$this->categoryTSconfig = $parseObj->setup;
}
return $this->categoryTSconfig;
}
示例9: main
/**
* Main
*
* @return string
* @todo Define visibility
*/
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...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
// BUGBUG: Should we check if the uset may at all read and write template-records???
$existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
// initialize
if ($existTemplate) {
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate', TRUE), \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_template', $GLOBALS['tplRow']) . '<strong>' . $this->pObj->linkWrapTemplateTitle($GLOBALS['tplRow']['title']) . '</strong>' . htmlspecialchars(trim($GLOBALS['tplRow']['sitetitle']) ? ' (' . $GLOBALS['tplRow']['sitetitle'] . ')' : ''));
}
if ($manyTemplatesMenu) {
$theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu);
}
$GLOBALS['tmpl']->clearList_const_temp = array_flip($GLOBALS['tmpl']->clearList_const);
$GLOBALS['tmpl']->clearList_setup_temp = array_flip($GLOBALS['tmpl']->clearList_setup);
$pointer = count($GLOBALS['tmpl']->hierarchyInfo);
$GLOBALS['tmpl']->hierarchyInfoArr = $GLOBALS['tmpl']->ext_process_hierarchyInfo(array(), $pointer);
$GLOBALS['tmpl']->processIncludes();
$hierarArr = array();
$head = '<tr class="t3-row-header">';
$head .= '<td>' . $GLOBALS['LANG']->getLL('title', TRUE) . '</td>';
$head .= '<td>' . $GLOBALS['LANG']->getLL('rootlevel', TRUE) . '</td>';
$head .= '<td>' . $GLOBALS['LANG']->getLL('clearSetup', TRUE) . '</td>';
$head .= '<td>' . $GLOBALS['LANG']->getLL('clearConstants', TRUE) . '</td>';
$head .= '<td>' . $GLOBALS['LANG']->getLL('pid', TRUE) . '</td>';
$head .= '<td>' . $GLOBALS['LANG']->getLL('rootline', TRUE) . '</td>';
$head .= '<td>' . $GLOBALS['LANG']->getLL('nextLevel', TRUE) . '</td>';
$head .= '</tr>';
$hierar = implode(array_reverse($GLOBALS['tmpl']->ext_getTemplateHierarchyArr($GLOBALS['tmpl']->hierarchyInfoArr, '', array(), 1)), '');
$hierar = '<table id="ts-analyzer" cellpadding="0" cellspacing="0">' . $head . $hierar . '</table>';
$theOutput .= $this->pObj->doc->spacer(5);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('templateHierarchy', TRUE), $hierar, 0, 1);
$urlParameters = array('id' => $GLOBALS['SOBE']->id, 'template' => 'all');
$aHref = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_ts', $urlParameters);
$completeLink = '<p><a href="' . htmlspecialchars($aHref) . '">' . $GLOBALS['LANG']->getLL('viewCompleteTS', TRUE) . '</a></p>';
$theOutput .= $this->pObj->doc->spacer(5);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('completeTS', TRUE), $completeLink, 0, 1);
$theOutput .= $this->pObj->doc->spacer(15);
// Output options
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions', TRUE), '', FALSE, TRUE);
$addParams = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template') ? '&template=' . \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template') : '';
$theOutput .= '<div class="tst-analyzer-options">' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_analyzer_checkLinenum]', $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], '', $addParams, 'id="checkTs_analyzer_checkLinenum"') . '<label for="checkTs_analyzer_checkLinenum">' . $GLOBALS['LANG']->getLL('lineNumbers', TRUE) . '</label> ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_analyzer_checkSyntax]', $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'], '', $addParams, 'id="checkTs_analyzer_checkSyntax"') . '<label for="checkTs_analyzer_checkSyntax">' . $GLOBALS['LANG']->getLL('syntaxHighlight', TRUE) . '</label> ' . (!$this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_analyzer_checkComments]', $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'], '', $addParams, 'id="checkTs_analyzer_checkComments"') . '<label for="checkTs_analyzer_checkComments">' . $GLOBALS['LANG']->getLL('comments', TRUE) . '</label> ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[ts_analyzer_checkCrop]', $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'], '', $addParams, 'id="checkTs_analyzer_checkCrop"') . '<label for="checkTs_analyzer_checkCrop">' . $GLOBALS['LANG']->getLL('cropLines', TRUE) . '</label> ' : '') . '</div>';
$theOutput .= $this->pObj->doc->spacer(25);
// Output Constants
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template')) {
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', TRUE), '', 0, 1);
$theOutput .= $this->pObj->doc->sectionEnd();
$theOutput .= '
<table class="ts-typoscript" border="0" cellpadding="1" cellspacing="0">
';
// Don't know why -2 and not 0... :-) But works.
$GLOBALS['tmpl']->ext_lineNumberOffset = -2;
$GLOBALS['tmpl']->ext_lineNumberOffset_mode = 'const';
$GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines('' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']))) + 1;
reset($GLOBALS['tmpl']->clearList_const);
foreach ($GLOBALS['tmpl']->constants as $key => $val) {
$cVal = current($GLOBALS['tmpl']->clearList_const);
if ($cVal == \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template') || \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template') == 'all') {
$theOutput .= '
<tr>
</td><td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[$cVal]) . '</strong></td></tr>
<tr>
<td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' . $GLOBALS['tmpl']->ext_outputTS(array($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) . '</td></tr></table>
</td>
</tr>
';
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template') != 'all') {
break;
}
}
$GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
next($GLOBALS['tmpl']->clearList_const);
}
$theOutput .= '
</table>
';
}
// Output setup
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('template')) {
$theOutput .= $this->pObj->doc->spacer(15);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', TRUE), '', 0, 1);
$theOutput .= $this->pObj->doc->sectionEnd();
$theOutput .= '
<table class="ts-typoscript" border="0" cellpadding="1" cellspacing="0">
';
$GLOBALS['tmpl']->ext_lineNumberOffset = 0;
$GLOBALS['tmpl']->ext_lineNumberOffset_mode = 'setup';
$GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines('' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']))) + 1;
reset($GLOBALS['tmpl']->clearList_setup);
//.........这里部分代码省略.........
示例10: loadTypoScriptFromFile
/**
* @static
* @throws Exception if file not found
* @param string $tsSetupFilePath path to typoscript file
* @return array ts-Config
*/
public static function loadTypoScriptFromFile($tsSetupFilePath)
{
if (!file_exists($tsSetupFilePath)) {
throw new Exception('No Typoscript file found at path ' . $tsSetupFilePath . ' 1316733309');
}
$rawTsConfig = file_get_contents($tsSetupFilePath);
$tsParser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
/** @var $tsParser \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser */
$tsLines = explode(LF, $rawTsConfig);
foreach ($tsLines as &$value) {
$includeData = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines($value, 1, true);
$value = $includeData['typoscript'];
}
$rawTsConfig = implode(LF, $tsLines);
$tsParser->parse($rawTsConfig);
$tsArray = $tsParser->setup;
return $tsArray;
}
示例11: __construct
/**
* SitemapRepository constructor.
* @SuppressWarnings(superglobals)
*/
public function __construct()
{
$this->typoScriptParser = GeneralUtility::makeInstance(TypoScriptParser::class);
$this->pluginConfig = $this->typoScriptParser->getVal('plugin.tx_sitemapgenerator', $GLOBALS['TSFE']->tmpl->setup);
}
示例12: initialize
/**
* Initializes the cronjob.
* This function initializes the cronjob object. The initialization of a
* cronjob consists of:
*
* 1. Load the default settings from static constants
* 2. Load user settings from tx_mmforum_config.ts
* 3. Join default and user settings and parse into an array
* 4. Load language file for the cronjob
* 5. Validate settings and exit with error if something is missing
*
* @author Martin Helmich <m.helmich@mittwald.de>
* @version 2008-06-22
* @return void
*/
function initialize()
{
$this->MMFORUMPATH = ExtensionManagementUtility::extPath('mm_forum');
// Load default constants file
$conf = file_get_contents($this->MMFORUMPATH . 'ext_typoscript_constants.txt');
// Load user settings file
$localSettings_filename = PATH_typo3conf . 'tx_mmforum_config.ts';
if (file_exists($localSettings_filename)) {
$conf .= "\n#LOCAL SETTINGS\n" . file_get_contents($localSettings_filename);
}
// Parse setup
$parser = new TypoScriptParser();
$parser->parse($conf);
$this->conf = $parser->setup['plugin.']['tx_mmforum.'];
// Load language files
$this->loadLanguageFile();
// Validate configuration
$this->validateConfig();
}
示例13: getUserTSconf
/**
* Returns the parsed TSconfig for the fe_user
* The TSconfig will be cached in $this->userTS.
*
* @return array TSconfig array for the fe_user
* @todo Define visibility
*/
public function getUserTSconf()
{
if (!$this->userTSUpdated) {
// Parsing the user TS (or getting from cache)
$this->TSdataArray = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines_array($this->TSdataArray);
$userTS = implode(LF . '[GLOBAL]' . LF, $this->TSdataArray);
$parseObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$parseObj->parse($userTS);
$this->userTS = $parseObj->setup;
$this->userTSUpdated = TRUE;
}
return $this->userTS;
}
示例14: getPagesTSconfig
/**
* Returns the pages TSconfig array based on the currect ->rootLine
*
* @return array
*/
public function getPagesTSconfig()
{
if (!is_array($this->pagesTSconfig)) {
$TSdataArray = array();
foreach ($this->rootLine as $k => $v) {
$TSdataArray[] = $v['TSconfig'];
}
// Adding the default configuration:
$TSdataArray[] = $this->TYPO3_CONF_VARS['BE']['defaultPageTSconfig'];
// Bring everything in the right order. Default first, then the Rootline down to the current page
$TSdataArray = array_reverse($TSdataArray);
// Parsing the user TS (or getting from cache)
$TSdataArray = TypoScriptParser::checkIncludeLines_array($TSdataArray);
$userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
$hash = md5('pageTS:' . $userTS);
$cachedContent = $this->sys_page->getHash($hash);
if (is_array($cachedContent)) {
$this->pagesTSconfig = $cachedContent;
} else {
$parseObj = GeneralUtility::makeInstance(TypoScriptParser::class);
$parseObj->parse($userTS);
$this->pagesTSconfig = $parseObj->setup;
$this->sys_page->storeHash($hash, $this->pagesTSconfig, 'PAGES_TSconfig');
}
}
return $this->pagesTSconfig;
}
示例15: getStrategyConfig
/**
* @param $strategy
* @return array
*/
protected function getStrategyConfig($strategy)
{
if ($this->strategyConfig[$strategy['uid']] === NULL) {
$parseObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$config = \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser::checkIncludeLines($strategy['config']);
$parseObj->parse($config);
$config = $parseObj->setup;
$this->strategyConfig[$strategy['uid']] = $config;
}
return $this->strategyConfig[$strategy['uid']];
}