[BUGFIX] Adjustments to FAL-enabled RTE image and link dialogues
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate_analyzer / class.tx_tstemplateanalyzer.php
index cce5040..21372b0 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 /**
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 /**
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
  */
 
-require_once(PATH_t3lib."class.t3lib_extobjbase.php");
+$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_analyzer/locallang.xml');
 
 class tx_tstemplateanalyzer extends t3lib_extobjbase {
        function init(&$pObj,$conf)     {
                parent::init($pObj,$conf);
 
 
 class tx_tstemplateanalyzer extends t3lib_extobjbase {
        function init(&$pObj,$conf)     {
                parent::init($pObj,$conf);
 
-               $this->pObj->modMenu_setDefaultList.= ',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax,ts_analyzer_checkSyntaxBlockmode';
+               $this->pObj->modMenu_setDefaultList.= ',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax';
        }
 
        function modMenu()      {
        }
 
        function modMenu()      {
-               global $LANG;
-
                return array (
                        'ts_analyzer_checkSetup' => '1',
                        'ts_analyzer_checkConst' => '1',
                return array (
                        'ts_analyzer_checkSetup' => '1',
                        'ts_analyzer_checkConst' => '1',
@@ -47,32 +45,33 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                        'ts_analyzer_checkComments' => '1',
                        'ts_analyzer_checkCrop' => '1',
                        'ts_analyzer_checkSyntax' => '1',
                        'ts_analyzer_checkComments' => '1',
                        'ts_analyzer_checkCrop' => '1',
                        'ts_analyzer_checkSyntax' => '1',
-                       'ts_analyzer_checkSyntaxBlockmode' => '1',
                );
        }
 
        function initialize_editor($pageId,$template_uid=0)     {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
                );
        }
 
        function initialize_editor($pageId,$template_uid=0)     {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
-               global $tmpl,$tplRow,$theConstants,$rootLine;
 
 
-               $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext");  // Defined global here!
-               $tmpl->tt_track = 0;    // Do not log time-performance information
-               $tmpl->init();
+               $GLOBALS['tmpl'] = t3lib_div::makeInstance("t3lib_tsparser_ext");
+                       // Do not log time-performance information
+               $GLOBALS['tmpl']->tt_track = 0;
+               $GLOBALS['tmpl']->init();
 
                        // Gets the rootLine
                $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
 
                        // Gets the rootLine
                $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
-               $rootLine = $sys_page->getRootLine($pageId);
-               $tmpl->runThroughTemplates($rootLine,$template_uid);    // This generates the constants/config + hierarchy info for the template.
-
-               $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid);   // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
-               if (is_array($tplRow))  {       // IF there was a template...
+               $GLOBALS['rootLine'] = $sys_page->getRootLine($pageId);
+                       // This generates the constants/config + hierarchy info for the template.
+               $GLOBALS['tmpl']->runThroughTemplates($GLOBALS['rootLine'], $template_uid);
+
+                       // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               $GLOBALS['tplRow'] = $GLOBALS['tmpl']->ext_getFirstTemplate($pageId,$template_uid);
+               if (is_array($GLOBALS['tplRow'])) {
+                               // IF there was a template...
                        return 1;
                }
        }
                        return 1;
                }
        }
+
        function main() {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
        function main() {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
-               global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-               global $tmpl,$tplRow,$theConstants,$rootLine;
 
                // **************************
                // Checking for more than one template an if, set a menu...
 
                // **************************
                // Checking for more than one template an if, set a menu...
@@ -90,83 +89,88 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                // 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)     {
                // 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->divider(5);
-                       $theOutput.=$this->pObj->doc->section("Current template:",'<img '.t3lib_iconWorks::skinImg($BACK_PATH, t3lib_iconWorks::getIcon('sys_template', $tplRow)).' align="top" /> <b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"]).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''));
+                       $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate', TRUE) ,
+                               t3lib_iconWorks::getSpriteIconForRecord('sys_template', $GLOBALS['tplRow']) . '<strong>' .
+                               $this->pObj->linkWrapTemplateTitle($GLOBALS['tplRow']["title"]) . '</strong>' .
+                               htmlspecialchars(trim($GLOBALS['tplRow']["sitetitle"]) ? ' (' . $GLOBALS['tplRow']["sitetitle"] . ')' : ''));
                }
                if ($manyTemplatesMenu) {
                }
                if ($manyTemplatesMenu) {
-                       $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
+                       $theOutput .= $this->pObj->doc->section("",$manyTemplatesMenu);
                }
 
                }
 
-               //      debug($tmpl->hierarchyInfo);
+               //      debug($GLOBALS['tmpl']->hierarchyInfo);
 
 
-               $tmpl->clearList_const_temp = array_flip($tmpl->clearList_const);
-               $tmpl->clearList_setup_temp = array_flip($tmpl->clearList_setup);
+               $GLOBALS['tmpl']->clearList_const_temp = array_flip($GLOBALS['tmpl']->clearList_const);
+               $GLOBALS['tmpl']->clearList_setup_temp = array_flip($GLOBALS['tmpl']->clearList_setup);
 
 
-               $pointer = count($tmpl->hierarchyInfo);
-               $tmpl->hierarchyInfoArr = $tmpl->ext_process_hierarchyInfo(array(), $pointer);
-               $tmpl->procesIncludes();
+               $pointer = count($GLOBALS['tmpl']->hierarchyInfo);
+               $GLOBALS['tmpl']->hierarchyInfoArr = $GLOBALS['tmpl']->ext_process_hierarchyInfo(array(), $pointer);
+               $GLOBALS['tmpl']->processIncludes();
 
                $hierarArr = array();
 
                $hierarArr = array();
-               $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 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>';
                $head.= '</tr>';
-               $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>';
+               $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->spacer(5);
-               $theOutput.=$this->pObj->doc->section("Template hierarchy:", $hierar, 0, 1);
+               $theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('templateHierarchy', TRUE), $hierar, 0, 1);
+
+               $completeLink = '<p><a href="index.php?id=' . $GLOBALS['SOBE']->id . '&amp;template=all">' . $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
 
 
                        // Output options
-               $theOutput.=$this->pObj->doc->spacer(25);
-               $theOutput.=$this->pObj->doc->divider(0);
-               $theOutput.=$this->pObj->doc->section("Display Options", '', 1, 1);
+               $theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions', TRUE), '', FALSE, TRUE);
                $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"') .
                $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> ' .
+                       '<label for="checkTs_analyzer_checkLinenum">' . $GLOBALS['LANG']->getLL('lineNumbers', TRUE) . '</label> ' .
                        t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkSyntax]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"], '', $addParams, 'id="checkTs_analyzer_checkSyntax"') .
                        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> ' .
+                       '<label for="checkTs_analyzer_checkSyntax">' . $GLOBALS['LANG']->getLL('syntaxHighlight', TRUE) . '</label> ' .
                        (!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ?
                                t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkComments]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkComments"], '', $addParams, 'id="checkTs_analyzer_checkComments"') .
                        (!$this->pObj->MOD_SETTINGS["ts_analyzer_checkSyntax"] ?
                                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> ' .
+                               '<label for="checkTs_analyzer_checkComments">' . $GLOBALS['LANG']->getLL('comments', TRUE) . '</label> ' .
                                t3lib_BEfunc::getFuncCheck($this->pObj->id, "SET[ts_analyzer_checkCrop]", $this->pObj->MOD_SETTINGS["ts_analyzer_checkCrop"], '', $addParams, 'id="checkTs_analyzer_checkCrop"') .
                                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_checkCrop">' . $GLOBALS['LANG']->getLL('cropLines', TRUE) . '</label> '
                                :
                                :
-                               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>';
                        ) . '</div>';
+               $theOutput.=$this->pObj->doc->spacer(25);
 
 
 
                                // Output Constants
                        if (t3lib_div::_GET('template')) {
 
 
 
                                // Output Constants
                        if (t3lib_div::_GET('template')) {
-                               $theOutput .= $this->pObj->doc->section("Constants:", "", 0, 1);
+                               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', TRUE), "", 0, 1);
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
-                                       <table border=0 cellpadding=1 cellspacing=0>
+                                       <table class="ts-typoscript" 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")       {
+                                       // 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, t3lib_TSparser::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 == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
                                                $theOutput .= '
                                                        <tr>
                                                $theOutput .= '
                                                        <tr>
-                                                               <td><img src="clear.gif" width="3" height="1" /></td><td class="bgColor2"><b>' . $tmpl->templateTitles[$cVal] . '</b></td></tr>
+                                                               </td><td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[$cVal]) . '</strong></td></tr>
                                                        <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 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>
                                                                '</td></tr></table>
                                                                </td>
                                                        </tr>
@@ -175,8 +179,8 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                                        break;
                                                }
                                        }
                                                        break;
                                                }
                                        }
-                                       $tmpl->ext_lineNumberOffset += count(explode(chr(10), $val)) + 1;
-                                       next($tmpl->clearList_const);
+                                       $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
+                                       next($GLOBALS['tmpl']->clearList_const);
                                }
                                $theOutput .= '
                                        </table>
                                }
                                $theOutput .= '
                                        </table>
@@ -186,24 +190,31 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                        // Output setup
                        if (t3lib_div::_GET('template')) {
                                $theOutput .= $this->pObj->doc->spacer(15);
                        // Output setup
                        if (t3lib_div::_GET('template')) {
                                $theOutput .= $this->pObj->doc->spacer(15);
-                               $theOutput .= $this->pObj->doc->section("SETUP:", "", 0, 1);
+                               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', TRUE), "", 0, 1);
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
                                $theOutput .= $this->pObj->doc->sectionEnd();
                                $theOutput .= '
-                                       <table border=0 cellpadding=1 cellspacing=0>
+                                       <table class="ts-typoscript" 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;
+                               $GLOBALS['tmpl']->ext_lineNumberOffset = 0;
+                               $GLOBALS['tmpl']->ext_lineNumberOffset_mode = "setup";
+                               $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines("" . $GLOBALS["TYPO3_CONF_VARS"]["FE"]["defaultTypoScript_setup"]))) + 1;
 
 
-                               reset($tmpl->clearList_setup);
-                               foreach ($tmpl->config as $key => $val) {
-                                       if (current($tmpl->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == "all")     {
+                               reset($GLOBALS['tmpl']->clearList_setup);
+                               foreach ($GLOBALS['tmpl']->config as $key => $val)      {
+                                       if (current($GLOBALS['tmpl']->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
                                                $theOutput .= '
                                                        <tr>
                                                $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>
+                                                               <td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[current($GLOBALS['tmpl']->clearList_setup)]) . '</strong></td></tr>
                                                        <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 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>
                                                ';
                                                                </td>
                                                        </tr>
                                                ';
@@ -211,8 +222,8 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                                        break;
                                                }
                                        }
                                                        break;
                                                }
                                        }
-                                       $tmpl->ext_lineNumberOffset += count(explode(chr(10), $val)) + 1;
-                                       next($tmpl->clearList_setup);
+                                       $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
+                                       next($GLOBALS['tmpl']->clearList_setup);
                                }
                                $theOutput .= '
                                        </table>
                                }
                                $theOutput .= '
                                        </table>