74 $GLOBALS[
'LANG']->includeLLFile(
'EXT:tstemplate/ts/locallang.xlf');
90 $this->perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
99 public function clearCache() {
103 $tce->stripslashes_values = 0;
104 $tce->start(array(), array());
105 $tce->clear_cacheCmd(
'all');
126 $this->access = is_array($this->pageinfo) ? 1 : 0;
128 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
129 $this->doc->setModuleTemplate(
'EXT:tstemplate/Resources/Private/Templates/tstemplate.html');
131 if ($this->
id && $this->access) {
132 $urlParameters = array(
137 $this->doc->form =
'<form action="' . htmlspecialchars($aHref) .
'" method="post" enctype="' .
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'form_enctype'] .
'" name="editForm">';
140 $this->doc->JScode =
' 141 <script language="javascript" type="text/javascript"> 142 function uFormUrl(aname) { 145 function brPoint(lnumber,t) { 146 window.location.href = ' .
GeneralUtility::quoteJSvalue(($aHref .
'&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateObjectBrowserModuleFunctionController&SET[ts_browser_type]='), TRUE) .
'+(t?"setup":"const")+"&breakPointLN="+lnumber; 151 $this->doc->postCode =
' 152 <script language="javascript" type="text/javascript"> 153 if (top.fsMod) top.fsMod.recentIds["web"] = ' . $this->
id .
'; 156 $this->doc->inDocStylesArray[] =
' 157 TABLE#typo3-objectBrowser { width: 100%; margin-bottom: 24px; } 158 TABLE#typo3-objectBrowser A { text-decoration: none; } 159 TABLE#typo3-objectBrowser .comment { color: maroon; font-weight: bold; } 160 .ts-typoscript { width: 100%; } 161 .tsob-menu label, .tsob-menu-row2 label, .tsob-conditions label { padding: 0 5px 0 0; vertical-align: text-top;} 162 .tsob-menu-row2 {margin-top: 10px;} 163 .tsob-conditions {padding: 1px 2px;} 164 .tsob-search-submit {margin-left: 3px; margin-right: 3px;} 165 .tst-analyzer-options { margin:5px 0; } 166 .tst-analyzer-options label {padding-left:5px; vertical-align:text-top; } 169 $this->doc->getContextMenuCode();
171 $this->content = $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'moduleTitle'));
175 $markers[
'FUNC_MENU'] =
BackendUtility::getFuncMenu($this->
id,
'SET[function]', $this->MOD_SETTINGS[
'function'], $this->MOD_MENU[
'function']);
179 $records =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
180 'pages.uid, count(*) AS count, max(sys_template.root) AS root_max_val, min(sys_template.root) AS root_min_val',
181 'pages,sys_template',
182 'pages.uid=sys_template.pid' 188 'pages.pid, pages.sorting' 191 foreach ($records as $record) {
195 $table =
'<table class="t3-table" id="ts-overview">' .
198 '<th>' .
$GLOBALS[
'LANG']->getLL(
'pageName') .
'</th>' .
199 '<th>' .
$GLOBALS[
'LANG']->getLL(
'templates') .
'</th>' .
200 '<th>' .
$GLOBALS[
'LANG']->getLL(
'isRoot') .
'</th>' .
201 '<th>' .
$GLOBALS[
'LANG']->getLL(
'isExt') .
'</th>' .
204 '<tbody>' . implode(
'', $this->
renderList($pArray)) .
'</tbody>' .
207 $this->content = $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'moduleTitle'));
208 $this->content .= $this->doc->section(
'',
'<p class="lead">' .
$GLOBALS[
'LANG']->getLL(
'overview') .
'</p>' . $table);
217 $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
219 $this->content = $this->doc->render(
'Template Tools', $this->content);
248 if ($this->
id && $this->access) {
251 if ($this->extClassConf[
'name'] ==
'TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController') {
253 $buttons[
'new'] =
'<input type="image" class="c-inputButton" name="createExtension" value="New"' .
IconUtility::skinImg(
$GLOBALS[
'BACK_PATH'],
'gfx/new_el.gif',
'') .
' title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:db_new.php.pagetitle', TRUE) .
'" />';
256 $buttons[
'new'] =
'';
259 'html' =>
'<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' .
'title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) .
'" ' .
'value="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) .
'" ' .
'/>' 263 'html' =>
'<input type="image" class="c-inputButton" name="saveclose" src="clear.gif" ' .
'title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', TRUE) .
'" ' .
'value="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', TRUE) .
'" ' .
'/>' 267 'html' =>
'<input type="image" class="c-inputButton" name="abort" src="clear.gif" ' .
'title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE) .
'" ' .
'value="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE) .
'" ' .
'/>' 270 } elseif ($this->extClassConf[
'name'] ==
'TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController' && count($this->MOD_MENU[
'constant_editor_cat'])) {
272 $buttons[
'save'] =
IconUtility::getSpriteIcon(
'actions-document-save', array(
'html' =>
'<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' .
'title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) .
'" ' .
'value="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) .
'" ' .
'/>'));
273 } elseif ($this->extClassConf[
'name'] ==
'TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController') {
274 if (!empty($this->sObj)) {
276 $urlParameters = array(
280 $buttons[
'back'] =
'<a href="' . htmlspecialchars($aHref) .
'" class="typo3-goBack" title="' .
$GLOBALS[
'LANG']->sL(
'LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-view-go-back') .
'</a>';
284 if (
$GLOBALS[
'BE_USER']->mayMakeShortcut()) {
285 $buttons[
'shortcut'] = $this->doc->makeShortcutIcon(
'id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(
',', array_keys($this->MOD_MENU)), $this->MCONF[
'name']);
289 if (
$GLOBALS[
'BE_USER']->mayMakeShortcut()) {
290 $buttons[
'shortcut'] = $this->doc->makeShortcutIcon(
'id',
'', $this->MCONF[
'name']);
306 $urlParameters = array(
311 $title =
'<a href="' . htmlspecialchars(($aHref .
'&e[' . $onlyKey .
']=1&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateInformationModuleFunctionController')) .
'">' . htmlspecialchars($title) .
'</a>';
313 $title =
'<a href="' . htmlspecialchars(($aHref .
'&e[constants]=1&e[config]=1&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateInformationModuleFunctionController')) .
'">' . htmlspecialchars($title) .
'</a>';
325 public function noTemplate($newStandardTemplate = 0) {
330 $tmpl->tt_track = FALSE;
333 $flashMessage =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
$GLOBALS[
'LANG']->getLL(
'noTemplateDescription') .
'<br />' .
$GLOBALS[
'LANG']->getLL(
'createTemplateToEditConfiguration'),
$GLOBALS[
'LANG']->getLL(
'noTemplate'), \
TYPO3\CMS\Core\Messaging\FlashMessage::INFO);
334 $theOutput .= $flashMessage->render();
336 if ($newStandardTemplate) {
339 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController'][
'newStandardTemplateView']
344 'selectorHtml' => &$selector,
345 'staticsText' => &$staticsText
348 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController'][
'newStandardTemplateView'],
352 $selector = $reference[
'selectorHtml'];
353 $staticsText = $reference[
'staticsText'];
355 $selector =
'<input type="hidden" name="createStandard" value="" />';
359 $theOutput .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'newWebsite') . $staticsText,
$GLOBALS[
'LANG']->getLL(
'newWebsiteDescription') .
'<br /><br />' . $selector .
'<input type="Submit" name="newWebsite" value="' .
$GLOBALS[
'LANG']->getLL(
'newWebsiteAction') .
'" />', 0, 1);
362 $theOutput .= $this->doc->spacer(10);
363 $theOutput .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'extTemplate'),
$GLOBALS[
'LANG']->getLL(
'extTemplateDescription') .
'<br /><br />' .
'<input type="submit" name="createExtension" value="' .
$GLOBALS[
'LANG']->getLL(
'extTemplateAction') .
'" />', 0, 1);
365 $first = $tmpl->ext_prevPageWithTemplate($this->
id, $this->perms_clause);
367 $theOutput .= $this->doc->spacer(10);
368 $urlParameters = array(
369 'id' => $first[
'uid']
372 $theOutput .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'goToClosest'), sprintf(
$GLOBALS[
'LANG']->getLL(
'goToClosestDescription') .
'<br /><br />%s<strong>' .
$GLOBALS[
'LANG']->getLL(
'goToClosestAction') .
'</strong>%s', htmlspecialchars($first[
'title']), $first[
'uid'],
'<a href="' . htmlspecialchars($aHref) .
'">',
'</a>'), 0, 1);
380 public function templateMenu() {
385 $tmpl->tt_track = FALSE;
387 $all = $tmpl->ext_getAllTemplates($this->
id, $this->perms_clause);
389 if (count($all) > 1) {
390 $this->MOD_MENU[
'templatesOnPage'] = array();
391 foreach ($all as $d) {
392 $this->MOD_MENU[
'templatesOnPage'][$d[
'uid']] = $d[
'title'];
396 $menu =
BackendUtility::getFuncMenu($this->
id,
'SET[templatesOnPage]', $this->MOD_SETTINGS[
'templatesOnPage'], $this->MOD_MENU[
'templatesOnPage']);
408 public function createTemplate(
$id, $actTemplateId = 0) {
412 $tce->stripslashes_values = FALSE;
415 $recData[
'sys_template'][
'NEW'] = array(
416 'pid' => $actTemplateId ? -1 * $actTemplateId :
$id,
419 $tce->start($recData, array());
420 $tce->process_datamap();
424 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController'][
'newStandardTemplateHandler']
427 'recData' => &$recData,
431 $GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController'][
'newStandardTemplateHandler'],
435 $recData = $reference[
'recData'];
437 $recData[
'sys_template'][
'NEW'] = array(
439 'title' =>
$GLOBALS[
'LANG']->getLL(
'titleNewSite'),
444 # Default PAGE object: 447 page.10.value = HELLO WORLD! 451 $tce->start($recData, array());
452 $tce->process_datamap();
453 $tce->clear_cacheCmd(
'all');
455 return $tce->substNEWwithIDs[
'NEW'];
471 if (!$rlArr[0][
'uid']) {
474 $cEl = current($rlArr);
475 $pArray[$cEl[
'uid']] = htmlspecialchars($cEl[
'title']);
478 if (!isset($pArray[($cEl[
'uid'] .
'.')])) {
479 $pArray[$cEl[
'uid'] .
'.'] = array();
483 $pArray[$cEl[
'uid'] .
'_'] = $row;
496 public function renderList($pArray, $lines = array(), $c = 0) {
497 if (is_array($pArray)) {
500 foreach ($pArray as $k => $v) {
501 if (\
TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($k)) {
502 if (isset($pArray[$k .
'_'])) {
503 $lines[] =
'<tr class="' . ($i++ % 2 == 0 ?
'bgColor4' :
'bgColor6') .
'"> 505 <td>' . $pArray[($k .
'_')][
'count'] .
'</td> 510 $lines[] =
'<tr class="' . ($i++ % 2 == 0 ?
'bgColor4' :
'bgColor6') .
'"> 517 $lines = $this->
renderList($pArray[$k .
'.'], $lines, $c + 1);
$modMenu_dontValidateList
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static getRecordWSOL($table, $uid, $fields=' *', $where='', $useDeleteClause=TRUE, $unsetMovePointers=FALSE)
static readPageAccess($id, $perms_clause)
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
renderList($pArray, $lines=array(), $c=0)
static quoteJSvalue($value)
static makeInstance($className)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
static viewOnClick($pageUid, $backPath='', $rootLine='', $anchorSection='', $alternativeUrl='', $additionalGetVars='', $switchFocus=TRUE)
static getSpriteIconForRecord($table, array $row, array $options=array())
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
static linkThisScript(array $getParams=array())
static getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
static versioningPlaceholderClause($table)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script='', $addparams='')
static fixed_lgd_cs($string, $chars, $appendString='...')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
setInPageArray(&$pArray, $rlArr, $row)
static deleteClause($table, $tableAlias='')
linkWrapTemplateTitle($title, $onlyKey='')