Bug #18828 » template_analyzer5.diff
t3lib/class.t3lib_tsparser_ext.php (working copy) | ||
---|---|---|
reset($keyArr);
|
||
$a=0;
|
||
$c=count($keyArr);
|
||
static $i;
|
||
while (list($key,)=each($keyArr)) {
|
||
$HTML='';
|
||
$HTML = '';
|
||
$a++;
|
||
$deeper = is_array($arr[$key.'.']);
|
||
$row=$arr[$key];
|
||
$deeper = is_array($arr[$key . '.']);
|
||
$row = $arr[$key];
|
||
$PM = 'join';
|
||
$LN = ($a==$c)?'blank':'line';
|
||
$BTM = ($a==$c)?'top':'';
|
||
$LN = ($a==$c) ? 'blank' : 'line';
|
||
$BTM = ($a==$c) ? 'top' : '';
|
||
$PM = 'join';
|
||
$HTML.=$depthData;
|
||
$icon = substr($row['templateID'],0,3)=='sys' ? t3lib_iconWorks::getIcon('sys_template',array('root'=>$row['root'])) :
|
||
(substr($row['templateID'],0,6)=='static' ? t3lib_iconWorks::getIcon('static_template',array()) : 'gfx/i/default.gif');
|
||
$alttext= '['.$row['templateID'].']';
|
||
$alttext.= $row['pid'] ? ' - '.t3lib_BEfunc::getRecordPath($row['pid'],$GLOBALS['SOBE']->perms_clause,20) : '';
|
||
if (in_array($row['templateID'],$this->clearList_const) || in_array($row['templateID'],$this->clearList_setup)) {
|
||
$A_B='<a href="index.php?id='.$GLOBALS['SOBE']->id.'&template='.$row['templateID'].'">';
|
||
$A_E='</a>';
|
||
$HTML .= $depthData;
|
||
$icon = substr($row['templateID'],0,3) == 'sys' ? t3lib_iconWorks::getIcon('sys_template', array('root' => $row['root'])) :
|
||
(substr($row['templateID'], 0, 6) == 'static' ? t3lib_iconWorks::getIcon('static_template', array()) : 'gfx/i/default.gif');
|
||
$alttext = '[' . $row['templateID'] . ']';
|
||
$alttext .= $row['pid'] ? ' - ' . t3lib_BEfunc::getRecordPath($row['pid'], $GLOBALS['SOBE']->perms_clause, 20) : '';
|
||
if (in_array($row['templateID'], $this->clearList_const) || in_array($row['templateID'], $this->clearList_setup)) {
|
||
$A_B = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&template=' . $row['templateID'] . '">';
|
||
$A_E = '</a>';
|
||
if (t3lib_div::_GP('template') == $row['templateID']) {
|
||
$A_B = '<strong>' . $A_B;
|
||
$A_E .= '</strong>';
|
||
}
|
||
} else {
|
||
$A_B='';
|
||
$A_E='';
|
||
$A_B = '';
|
||
$A_E = '';
|
||
}
|
||
$HTML.=($first?'':'<IMG src="'.$GLOBALS['BACK_PATH'].'gfx/ol/'.$PM.$BTM.'.gif" width="18" height="16" align="top" border=0>').'<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $icon) . ' align="top" title="'.$alttext.'" /> '.$A_B.t3lib_div::fixed_lgd_cs($row['title'],$GLOBALS['BE_USER']->uc['titleLen']).$A_E.' ';
|
||
$HTML .= ($first ? '' : '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/ol/' . $PM . $BTM . '.gif" width="18" height="16" align="top" border="0" />') .
|
||
'<img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], $icon) . ' align="top" title="' . $alttext.'" /> ' .
|
||
$A_B . t3lib_div::fixed_lgd_cs($row['title'], $GLOBALS['BE_USER']->uc['titleLen']) . $A_E . ' ';
|
||
$RL = $this->ext_getRootlineNumber($row['pid']);
|
||
$keyArray[] = '<tr>
|
||
<td nowrap>'.$HTML.'</td>
|
||
<td align=center>'.($row['root']?'<b>X</b>':'').' </td>
|
||
<td align=center'.$row['bgcolor_setup'].'>'.fw(($row['clConf']?'<b>X</b>':'').' ').'</td>
|
||
<td align=center'.$row['bgcolor_const'].'>'.fw(($row['clConst']?'<b>X</b>':'').' ').'</td>
|
||
<td>'.($row['pid']?' '.$row['pid'].(strcmp($RL,'')?' ('.$RL.')':'').' ':'').'</td>
|
||
<td>'.($row['next']?' '.$row['next'].' ':'').'</td>
|
||
$keyArray[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
|
||
<td nowrap>' . $HTML . '</td>
|
||
<td align="center" class="bgColor5">' . ($row['root'] ? '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/perm-allowed.gif', 'width="10" height="9"') . ' align="top" alt="" />' : '') . ' </td>
|
||
<td align="center">' . fw(($row['clConf'] ? '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/perm-allowed.gif', 'width="10" height="9"') . ' align="top" alt="" />' :'') . ' ') . '</td>
|
||
<td align="center" class="bgColor5">' . fw(($row['clConst'] ? '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/perm-allowed.gif', 'width="10" height="9"') . ' align="top" alt="" />' : '') . ' ') . '</td>
|
||
<td align="center">' . ($row['pid'] ? $row['pid'] : '') . '</td>
|
||
<td align="center" class="bgColor5">' . (strcmp($RL, '') ? $RL : '') . '</td>
|
||
<td>' . ($row['next'] ? ' ' . $row['next'] . ' ' : '') . '</td>
|
||
</tr>';
|
||
if ($deeper) {
|
||
$keyArray = $this->ext_getTemplateHierarchyArr($arr[$key.'.'], $depthData.($first?'':'<IMG src="'.$GLOBALS['BACK_PATH'].'gfx/ol/'.$LN.'.gif" width="18" height="16" align="top">'), $keyArray);
|
||
$keyArray = $this->ext_getTemplateHierarchyArr($arr[$key . '.'], $depthData . ($first ? '' : '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/ol/' . $LN . '.gif" width="18" height="16" align="top" />'), $keyArray);
|
||
}
|
||
}
|
||
return $keyArray;
|
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php (working copy) | ||
---|---|---|
$tmpl->procesIncludes();
|
||
$hierarArr = array();
|
||
$head= '<tr>';
|
||
$head.= '<td class="bgColor2"><b>Title </b></td>';
|
||
$head.= '<td class="bgColor2"><b>Rootlevel </b></td>';
|
||
$head.= '<td class="bgColor2"><b>C. Setup </b></td>';
|
||
$head.= '<td class="bgColor2"><b>C. Const </b></td>';
|
||
$head.= '<td class="bgColor2"><b>PID/RL </b></td>';
|
||
$head.= '<td class="bgColor2"><b>NL </b></td>';
|
||
$head = '<tr class="c-headLineTable">';
|
||
$head.= '<td>Title</td>';
|
||
$head.= '<td>Rootlevel</td>';
|
||
$head.= '<td>Clear Setup</td>';
|
||
$head.= '<td>Clear Constants</td>';
|
||
$head.= '<td>PID</td>';
|
||
$head.= '<td>Rootline</td>';
|
||
$head.= '<td>Next Level</td>';
|
||
$head.= '</tr>';
|
||
$hierar = implode(array_reverse($tmpl->ext_getTemplateHierarchyArr($tmpl->hierarchyInfoArr, "",array(),1)),"");
|
||
$hierar= '<table border=0 cellpadding=0 cellspacing=0>'.$head.$hierar.'</table>';
|
||
$hierar = implode(array_reverse($tmpl->ext_getTemplateHierarchyArr($tmpl->hierarchyInfoArr, "", array(), 1)), "");
|
||
$hierar= '<table id="ts-analyzer" border="0"" cellpadding="0"" cellspacing="1">' . $head . $hierar . '</table>';
|
||
$theOutput.=$this->pObj->doc->spacer(5);
|
||
$theOutput.=$this->pObj->doc->section("Template hierarchy:",$hierar,0,1);
|
||
$theOutput.=$this->pObj->doc->section("Template hierarchy:", $hierar, 0, 1);
|
||
// Output constants
|
||
// Output options
|
||
$theOutput.=$this->pObj->doc->spacer(25);
|
||
$theOutput.=$this->pObj->doc->divider(0);
|
||
$theOutput.=$this->pObj->doc->section("",
|
||
'<label for="checkTs_analyzer_checkLinenum">Linenumbers</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkLinenum]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkLinenum"],'','','id="checkTs_analyzer_checkLinenum"').
|
||
' <label for="checkTs_analyzer_checkSyntax">Syntax HL</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSyntax]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"],'','','id="checkTs_analyzer_checkSyntax"').
|
||
$theOutput.=$this->pObj->doc->section("Display Options", '', 1, 1);
|
||
$addParams = t3lib_div::_GET('template') ? '&template=' . t3lib_div::_GET('template') : '';
|
||
$theOutput .= '<div class="tst-analyzer-options">' .
|
||
t3lib_BEfunc::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">Line numbers</label> ' .
|
||
t3lib_BEfunc::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">Syntax highlight</label> ' .
|
||
(!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ?
|
||
' <label for="checkTs_analyzer_checkComments">Comments</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkComments]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"],'','','id="checkTs_analyzer_checkComments"').
|
||
' <label for="checkTs_analyzer_checkCrop">Crop lines</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkCrop]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"],'','','id="checkTs_analyzer_checkCrop"')
|
||
t3lib_BEfunc::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">Comments</label> ' .
|
||
t3lib_BEfunc::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">Crop lines</label> '
|
||
:
|
||
' <label for="checkTs_analyzer_checkSyntaxBlockmode">Block mode</label> '.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSyntaxBlockmode]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"],'','','id="checkTs_analyzer_checkSyntaxBlockmode"')
|
||
)
|
||
);
|
||
$theOutput.=$this->pObj->doc->divider(2);
|
||
//$theOutput.=$this->pObj->doc->section("Constants:",t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkConst]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkConst"]).fw("Enable"));
|
||
$theOutput.=$this->pObj->doc->section("Constants:","",0,1);
|
||
$theOutput.=$this->pObj->doc->sectionEnd();
|
||
if (1==1 || $this->pObj->MOD_SETTINGS["ts_analyzer_checkConst"]) {
|
||
$theOutput.='
|
||
<table border=0 cellpadding=1 cellspacing=0>
|
||
';
|
||
$tmpl->ext_lineNumberOffset=-2; // Don't know why -2 and not 0... :-) But works.
|
||
$tmpl->ext_lineNumberOffset_mode="const";
|
||
$tmpl->ext_lineNumberOffset+=count(explode(chr(10),t3lib_TSparser::checkIncludeLines("".$GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_constants"])))+1;
|
||
t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkSyntaxBlockmode]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"], '', $addParams, 'id="checkTs_analyzer_checkSyntaxBlockmode"') .
|
||
'<label for="checkTs_analyzer_checkSyntaxBlockmode">Block mode</label> '
|
||
) . '</div>';
|
||
|
||
|
||
reset($tmpl->constants);
|
||
reset($tmpl->clearList_const);
|
||
while(list($key,$val)=each($tmpl->constants)) {
|
||
$cVal = current($tmpl->clearList_const);
|
||
if ($cVal==t3lib_div::_GET('template') || t3lib_div::_GET('template')=="all") {
|
||
$theOutput.='
|
||
<tr>
|
||
<td><img src=clear.gif width=3 height=1></td><td class="bgColor2"><b>'.$tmpl->templateTitles[$cVal].'</b></td></tr>
|
||
<tr>
|
||
<td><img src=clear.gif width=3 height=1></td>
|
||
<td class="bgColor2"><table border=0 cellpadding=0 cellspacing=0 class="bgColor4" width="100%"><tr><td nowrap>'.$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"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"]).'</td></tr></table>
|
||
</td>
|
||
</tr>
|
||
';
|
||
if (t3lib_div::_GET('template')!="all") break;
|
||
// Output Constants
|
||
if (t3lib_div::_GET('template')) {
|
||
$theOutput .= $this->pObj->doc->section("Constants:", "", 0, 1);
|
||
$theOutput .= $this->pObj->doc->sectionEnd();
|
||
$theOutput .= '
|
||
<table border=0 cellpadding=1 cellspacing=0>
|
||
';
|
||
$tmpl->ext_lineNumberOffset = -2; // Don't know why -2 and not 0... :-) But works.
|
||
$tmpl->ext_lineNumberOffset_mode = "const";
|
||
$tmpl->ext_lineNumberOffset += count(explode(chr(10), t3lib_TSparser::checkIncludeLines("" . $GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_constants"]))) + 1;
|
||
reset($tmpl->clearList_const);
|
||
foreach ($tmpl->constants as $key => $val) {
|
||
$cVal = current($tmpl->clearList_const);
|
||
if ($cVal == t3lib_div::_GET('template') || t3lib_div::_GET('template') == "all") {
|
||
$theOutput .= '
|
||
<tr>
|
||
<td><img src="clear.gif" width="3" height="1" /></td><td class="bgColor2"><b>' . $tmpl->templateTitles[$cVal] . '</b></td></tr>
|
||
<tr>
|
||
<td><img src="clear.gif" width="3" height="1" /></td>
|
||
<td class="bgColor2"><table border=0 cellpadding=0 cellspacing=0 class="bgColor0" width="100%"><tr><td nowrap>' .
|
||
$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"], $this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"]) .
|
||
'</td></tr></table>
|
||
</td>
|
||
</tr>
|
||
';
|
||
if (t3lib_div::_GET('template') != "all") {
|
||
break;
|
||
}
|
||
}
|
||
$tmpl->ext_lineNumberOffset += count(explode(chr(10), $val)) + 1;
|
||
next($tmpl->clearList_const);
|
||
}
|
||
$tmpl->ext_lineNumberOffset+=count(explode(chr(10),$val))+1;
|
||
next($tmpl->clearList_const);
|
||
$theOutput .= '
|
||
</table>
|
||
';
|
||
}
|
||
$theOutput.='
|
||
</table>
|
||
';
|
||
}
|
||
// Output setup
|
||
$theOutput.=$this->pObj->doc->spacer(15);
|
||
//$theOutput.=$this->pObj->doc->section("SETUP:",t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSetup]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSetup"]).fw("Enable"));
|
||
$theOutput.=$this->pObj->doc->section("SETUP:","",0,1);
|
||
$theOutput.=$this->pObj->doc->sectionEnd();
|
||
if (1==1 || $this->pObj->MOD_SETTINGS["ts_analyzer_checkSetup"]) {
|
||
$theOutput.='
|
||
<table border=0 cellpadding=1 cellspacing=0>
|
||
';
|
||
$tmpl->ext_lineNumberOffset=0;
|
||
$tmpl->ext_lineNumberOffset_mode="setup";
|
||
$tmpl->ext_lineNumberOffset+=count(explode(chr(10),t3lib_TSparser::checkIncludeLines("".$GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_setup"])))+1;
|
||
if (t3lib_div::_GET('template')) {
|
||
$theOutput .= $this->pObj->doc->spacer(15);
|
||
$theOutput .= $this->pObj->doc->section("SETUP:", "", 0, 1);
|
||
$theOutput .= $this->pObj->doc->sectionEnd();
|
||
$theOutput .= '
|
||
<table border=0 cellpadding=1 cellspacing=0>
|
||
';
|
||
$tmpl->ext_lineNumberOffset = 0;
|
||
$tmpl->ext_lineNumberOffset_mode = "setup";
|
||
$tmpl->ext_lineNumberOffset += count(explode(chr(10), t3lib_TSparser::checkIncludeLines("" . $GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_setup"]))) + 1;
|
||
reset($tmpl->config);
|
||
reset($tmpl->clearList_setup);
|
||
while(list($key,$val)=each($tmpl->config)) {
|
||
if (current($tmpl->clearList_setup)==t3lib_div::_GET('template') || t3lib_div::_GET('template')=="all") {
|
||
$theOutput.='
|
||
<tr>
|
||
<td><img src=clear.gif width=3 height=1></td><td class="bgColor2"><b>'.$tmpl->templateTitles[current($tmpl->clearList_setup)].'</b></td></tr>
|
||
<tr>
|
||
<td><img src=clear.gif width=3 height=1></td>
|
||
<td class="bgColor2"><table border=0 cellpadding=0 cellspacing=0 class="bgColor4" width="100%"><tr><td nowrap>'.$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"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"]).'</td></tr></table>
|
||
</td>
|
||
</tr>
|
||
';
|
||
if (t3lib_div::_GET('template')!="all") break;
|
||
reset($tmpl->clearList_setup);
|
||
foreach ($tmpl->config as $key => $val) {
|
||
if (current($tmpl->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == "all") {
|
||
$theOutput .= '
|
||
<tr>
|
||
<td><img src="clear.gif" width="3" height="1" /></td><td class="bgColor2"><b>' . $tmpl->templateTitles[current($tmpl->clearList_setup)] . '</b></td></tr>
|
||
<tr>
|
||
<td><img src="clear.gif" width="3" height="1" /></td>
|
||
<td class="bgColor2"><table border=0 cellpadding=0 cellspacing=0 class="bgColor0" width="100%"><tr><td nowrap>'.$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"],$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"]).'</td></tr></table>
|
||
</td>
|
||
</tr>
|
||
';
|
||
if (t3lib_div::_GET('template') != "all") {
|
||
break;
|
||
}
|
||
}
|
||
$tmpl->ext_lineNumberOffset += count(explode(chr(10), $val)) + 1;
|
||
next($tmpl->clearList_setup);
|
||
}
|
||
$tmpl->ext_lineNumberOffset+=count(explode(chr(10),$val))+1;
|
||
next($tmpl->clearList_setup);
|
||
$theOutput .= '
|
||
</table>
|
||
';
|
||
}
|
||
$theOutput.='
|
||
</table>
|
||
';
|
||
}
|
||
|
||
return $theOutput;
|
||
}
|
||
}
|
typo3/sysext/tstemplate/ts/index.php (working copy) | ||
---|---|---|
$this->doc->inDocStylesArray[] = '
|
||
TABLE#typo3-objectBrowser A { text-decoration: none; }
|
||
TABLE#typo3-objectBrowser .comment { color: maroon; font-weight: bold; }
|
||
TABLE#ts-analyzer tr.c-headLineTable {background-color: #A2AAB8;}
|
||
TABLE#ts-analyzer tr td {padding: 0 2px;}
|
||
TABLE#ts-analyzer tr.c-headLineTable td {padding: 2px 4px; font-weight:bold; color: #fff;}
|
||
.tst-analyzer-options { margin:5px 0; }
|
||
.tst-analyzer-options label {padding-left:5px; vertical-align:text-top; }
|
||
.bgColor0 {background-color:#fff;}
|
||
';
|
||
- « Previous
- 1
- 2
- 3
- Next »