Project

General

Profile

Bug #18828 » template_analyzer.diff

Administrator Admin, 2008-05-25 01:06

View differences:

t3lib/class.t3lib_tsparser_ext.php (working copy)
$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.'&nbsp;&nbsp;';
$RL = $this->ext_getRootlineNumber($row['pid']);
$keyArray[] = '<tr>
<td nowrap>'.$HTML.'</td>
<td align=center>'.($row['root']?'<b>X</b>':'').'&nbsp;&nbsp;</td>
<td align=center'.$row['bgcolor_setup'].'>'.fw(($row['clConf']?'<b>X</b>':'').'&nbsp;&nbsp;').'</td>
<td align=center'.$row['bgcolor_const'].'>'.fw(($row['clConst']?'<b>X</b>':'').'&nbsp;&nbsp;').'</td>
<td>'.($row['pid']?'&nbsp;'.$row['pid'].(strcmp($RL,'')?' ('.$RL.')':'').'&nbsp;&nbsp;':'').'</td>
<td>'.($row['next']?'&nbsp;'.$row['next'].'&nbsp;&nbsp;':'').'</td>
<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="" />' : '') . '&nbsp;&nbsp;</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="" />' :'') . '&nbsp;&nbsp;') . '</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="" />' : '') . '&nbsp;&nbsp;') . '</td>
<td align="center">' . ($row['pid'] ? '&nbsp;' . $row['pid'] . (strcmp($RL,'') ? ' ('.$RL.')' : '') . '&nbsp;&nbsp;' : '') . '</td>
<td class="bgColor5">' . ($row['next'] ? '&nbsp;' . $row['next'] . '&nbsp;&nbsp;' : '') . '</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);
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; }
.tst-analyzer-options { margin:5px 0; }
.tst-analyzer-options label {padding-left:5px; vertical-align:text-top; }
.bgColor0 {background-color:#fff;}
';
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php (working copy)
$head= '<tr>';
$head.= '<td class="bgColor2"><b>Title&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>Rootlevel&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>C. Setup&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>C. Const&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>PID/RL&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>NL&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>Clear Setup&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>Clear Constants&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>PID/Rootline&nbsp;&nbsp;</b></td>';
$head.= '<td class="bgColor2"><b>Next Level&nbsp;&nbsp;</b></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>';
......
$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"').
'&nbsp;&nbsp;&nbsp;<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 .= '<div class="tst-analyzer-options">' .
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_checkLinenum">Linenumbers</label> ' .
t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSyntax]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"],'','','id="checkTs_analyzer_checkSyntax"') .
'<label for="checkTs_analyzer_checkSyntax">Syntax HL</label> ' .
(!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ?
'&nbsp;&nbsp;&nbsp;<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"').
'&nbsp;&nbsp;&nbsp;<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"],'','','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"],'','','id="checkTs_analyzer_checkCrop"') .
'<label for="checkTs_analyzer_checkCrop">Crop lines</label> '
:
'&nbsp;&nbsp;&nbsp;<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"]) {
t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_analyzer_checkSyntaxBlockmode]",$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntaxBlockmode"],'','','id="checkTs_analyzer_checkSyntaxBlockmode"') .
'<label for="checkTs_analyzer_checkSyntaxBlockmode">Block mode</label> '
) . '</div>';
// Output Constants
$theOutput.=$this->pObj->doc->section("Constants:","",0,1);
$theOutput.=$this->pObj->doc->sectionEnd();
$theOutput.='
<table border=0 cellpadding=1 cellspacing=0>
';
......
$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->constants);
reset($tmpl->clearList_const);
while(list($key,$val)=each($tmpl->constants)) {
foreach ($tmpl->constants as $key => $val) {
$cVal = current($tmpl->clearList_const);
if ($cVal==t3lib_div::_GET('template') || t3lib_div::_GET('template')=="all") {
$theOutput.='
......
<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 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>
';
......
$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.=$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_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)) {
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="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 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>
';
......
$theOutput.='
</table>
';
}
return $theOutput;
}
}
(2-2/3)