Bug #19348 » index.php.1.diff
typo3/sysext/tstemplate/ts/index.php (working copy) | ||
---|---|---|
require_once(PATH_t3lib . 'class.t3lib_parsehtml.php');
|
||
require_once(PATH_t3lib . 'class.t3lib_scbase.php');
|
||
$BE_USER->modAccess($MCONF, 1);
|
||
$BE_USER->modAccess($MCONF, true);
|
||
// ***************************
|
||
... | ... | |
$this->doc->postCode = '
|
||
<script language="javascript" type="text/javascript">
|
||
script_ended = 1;
|
||
if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
|
||
if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
|
||
</script>
|
||
';
|
||
... | ... | |
// Build the modulle content
|
||
$this->content = $this->doc->header('Template Tools');
|
||
$this->extObjContent();
|
||
$this->content.=$this->doc->spacer(10);
|
||
$this->content .= $this->doc->spacer(10);
|
||
// Setting up the buttons and markers for docheader
|
||
$docHeaderButtons = $this->getButtons();
|
||
... | ... | |
</tr>';
|
||
$lines = array_merge($lines, $this->renderList($pArray));
|
||
$table = '<table border="0" cellpadding="0" cellspacing="1" id="ts-overview">' . implode('',$lines) . '</table>';
|
||
$this->content = $this->doc->section($GLOBALS['LANG']->getLL('moduleTitle', 1), '
|
||
$table = '<table border="0" cellpadding="0" cellspacing="1" id="ts-overview">' . implode('', $lines) . '</table>';
|
||
$this->content = $this->doc->section($GLOBALS['LANG']->getLL('moduleTitle', true), '
|
||
<br />
|
||
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.
|
||
<br /><br />' . $table);
|
||
... | ... | |
// RENDER LIST of pages with templates, END
|
||
// ********************************************
|
||
$this->content.=$this->doc->spacer(10);
|
||
$this->content .= $this->doc->spacer(10);
|
||
// Setting up the buttons and markers for docheader
|
||
$docHeaderButtons = $this->getButtons();
|
||
... | ... | |
// Build the <body> for the module
|
||
$this->content = $this->doc->startPage('Template Tools');
|
||
$this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
|
||
$this->content.= $this->doc->endPage();
|
||
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
|
||
$this->content .= $this->doc->endPage();
|
||
$this->content = $this->doc->insertStylesAndJS($this->content);
|
||
}
|
||
... | ... | |
if ($this->id && $this->access) {
|
||
// View page
|
||
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '">' .
|
||
'<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/zoom.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', 1) . '" hspace="3" alt="" />' .
|
||
'<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/zoom.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', true) . '" hspace="3" alt="" />' .
|
||
'</a>';
|
||
// If access to Web>List for user, then link to that module.
|
||
if ($GLOBALS['BE_USER']->check('modules','web_list')) {
|
||
$href = $GLOBALS['BACK_PATH'] . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
|
||
$buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '">' .
|
||
'<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', 1) . '" alt="" />' .
|
||
'<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/list.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', true) . '" alt="" />' .
|
||
'</a>';
|
||
}
|
||
... | ... | |
if($this->extClassConf['name'] == 'tx_tstemplateinfo') {
|
||
// NEW button
|
||
$buttons['new'] = '<input type="image" class="c-inputButton" name="createExtension" value="New"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif','') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle', 1) . '" />';
|
||
$buttons['new'] = '<input type="image" class="c-inputButton" name="createExtension" value="New"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle', true) . '" />';
|
||
|
||
if(!empty($this->e) && !t3lib_div::_POST('abort') && !t3lib_div::_POST('saveclose')) {
|
||
// no NEW-button while edit
|
||
$buttons['new'] = '';
|
||
|
||
// SAVE button
|
||
$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/savedok.gif','') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
|
||
$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/savedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', true) . '" />';
|
||
// SAVE AND CLOSE button
|
||
$buttons['save_close'] = '<input type="image" class="c-inputButton" name="saveclose" value="Save and close"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/saveandclosedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc',1) . '" />';
|
||
$buttons['save_close'] = '<input type="image" class="c-inputButton" name="saveclose" value="Save and close"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/saveandclosedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', true) . '" />';
|
||
// CLOSE button
|
||
$buttons['close'] = '<input type="image" class="c-inputButton" name="abort" value="Abort"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/closedok.gif','') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" />';
|
||
$buttons['close'] = '<input type="image" class="c-inputButton" name="abort" value="Abort"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/closedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', true) . '" />';
|
||
|
||
}
|
||
} elseif($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU['constant_editor_cat'])) {
|
||
... | ... | |
}
|
||
} elseif($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU['constant_editor_cat'])) {
|
||
// SAVE button
|
||
$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/savedok.gif','') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
|
||
$buttons['save'] = '<input type="image" class="c-inputButton" name="submit" value="Update"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/savedok.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', true) . '" />';
|
||
} elseif($this->extClassConf['name'] == 'tx_tstemplateobjbrowser') {
|
||
if(!empty($this->sObj)) {
|
||
// BACK
|
||
... | ... | |
if(!empty($this->sObj)) {
|
||
// BACK
|
||
$buttons['back'] = '<a href="index.php?id=' . $this->id . '" class="typo3-goBack">' .
|
||
'<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/goback.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', 1) . '" alt="" />' .
|
||
'<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/goback.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', true) . '" alt="" />' .
|
||
'</a>';
|
||
}
|
||
}
|
||
... | ... | |
list($out['cache_hash']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
|
||
if ($humanReadable) {
|
||
$newOut=array();
|
||
reset($out);
|
||
$newOut = array();
|
||
foreach($out as $k => $v) {
|
||
$newOut[] = $k . ":" . $v;
|
||
}
|
||
... | ... | |
return $out;
|
||
}
|
||
function linkWrapTemplateTitle($title, $onlyKey="") {
|
||
function linkWrapTemplateTitle($title, $onlyKey = "") {
|
||
if ($onlyKey) {
|
||
$title = '<a href="index.php?id='.$GLOBALS['SOBE']->id.'&e['.$onlyKey.']=1&SET[function]=tx_tstemplateinfo">'.htmlspecialchars($title).'</a>';
|
||
$title = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&e[' . $onlyKey . ']=1&SET[function]=tx_tstemplateinfo">' . htmlspecialchars($title) . '</a>';
|
||
} else {
|
||
$title = '<a href="index.php?id='.$GLOBALS['SOBE']->id.'&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo">'.htmlspecialchars($title).'</a>';
|
||
$title = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo">' . htmlspecialchars($title) . '</a>';
|
||
}
|
||
return $title;
|
||
}
|
||
... | ... | |
return $title;
|
||
}
|
||
function noTemplate($newStandardTemplate=0) {
|
||
function noTemplate($newStandardTemplate = 0) {
|
||
$tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here!
|
||
/* @var $tmpl t3lib_tsparser_ext */
|
||
$tmpl->tt_track = 0; // Do not log time-performance information
|
||
$tmpl->tt_track = false; // Do not log time-performance information
|
||
$tmpl->init();
|
||
$confirm = ' onClick="return confirm(\'Are you sure you want to do this?\');"';
|
||
... | ... | |
}
|
||
// Extension?
|
||
$theOutput .= $this->doc->spacer(10);
|
||
$theOutput .= $this->doc->section('Create extension template', 'An extension template allows you to enter TypoScript values that will affect only this page and subpages.<BR><BR><img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/icon_warning.gif','width="18" height="16"') . ' hspace="5" align="top"><input type="submit" name="createExtension" value="Click here to create an extension template."' . $confirm . '>', 0, 1);
|
||
$theOutput .= $this->doc->section('Create extension template', 'An extension template allows you to enter TypoScript values that will affect only this page and subpages.<BR><BR><img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_warning.gif', 'width="18" height="16"') . ' hspace="5" align="top"><input type="submit" name="createExtension" value="Click here to create an extension template."' . $confirm . '>', 0, 1);
|
||
// Go to first appearing...
|
||
$first = $tmpl->ext_prevPageWithTemplate($this->id, $this->perms_clause);
|
||
... | ... | |
function templateMenu() {
|
||
$tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here!
|
||
/* @var $tmpl t3lib_tsparser_ext */
|
||
$tmpl->tt_track = 0; // Do not log time-performance information
|
||
$tmpl->tt_track = false; // Do not log time-performance information
|
||
$tmpl->init();
|
||
$all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
|
||
$menu='';
|
||
$menu = '';
|
||
if (count($all) > 1) {
|
||
$this->MOD_MENU['templatesOnPage'] = array();
|
||
... | ... | |
}
|
||
}
|
||
function renderList($pArray, $lines=array(), $c=0) {
|
||
function renderList($pArray, $lines = array(), $c = 0) {
|
||
if (is_array($pArray)) {
|
||
reset($pArray);
|
||
static $i;
|
||
... | ... | |
if (t3lib_div::testInt($k)) {
|
||
if (isset($pArray[$k . "_"])) {
|
||
$lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
|
||
<td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c*10) . ' align="top">' .
|
||
<td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align="top">' .
|
||
'<a href="' . t3lib_div::linkThisScript(array('id' => $k)) . '">' .
|
||
t3lib_iconWorks::getIconImage('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), $GLOBALS['BACK_PATH'], ' align="top" title="ID: '. $k .'"') .
|
||
t3lib_iconWorks::getIconImage('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), $GLOBALS['BACK_PATH'], ' align="top" title="ID: ' . $k . '"') .
|
||
t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</a></td>
|
||
<td align="center">' . $pArray[$k . '_']['count'] . '</td>
|
||
<td align="center" class="bgColor5">' . ($pArray[$k . '_']['root_max_val'] > 0 ? '<img' .
|
||
t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/perm-allowed.gif','width="10" height="9"') . ' align="top" alt="" />' : " ") .
|
||
t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/perm-allowed.gif', 'width="10" height="9"') . ' align="top" alt="" />' : " ") .
|
||
'</td>
|
||
<td align="center">' . ($pArray[$k . '_']['root_min_val'] == 0 ? '<img' .
|
||
t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/perm-allowed.gif', 'width="10" height="9"') . ' align="top" alt="" />' : " ") .
|
||
... | ... | |
</tr>';
|
||
} else {
|
||
$lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
|
||
<td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . ($c*10) . ' align=top>' .
|
||
<td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align=top>' .
|
||
t3lib_iconWorks::getIconImage('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), $GLOBALS['BACK_PATH'], ' align="top"') .
|
||
t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</td>
|
||
<td align="center"></td>
|
||
... | ... | |
<td align="center"></td>
|
||
</tr>';
|
||
}
|
||
$lines = $this->renderList($pArray[$k . '.'], $lines, $c+1);
|
||
$lines = $this->renderList($pArray[$k . '.'], $lines, $c + 1);
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
$SOBE->init();
|
||
// Include files?
|
||
foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
|
||
foreach($SOBE->include_once as $INC_FILE) {
|
||
include_once($INC_FILE);
|
||
}
|
||
$SOBE->checkExtObj(); // Checking for first level external objects
|
||
$SOBE->clearCache();
|