[BUGFIX] Missing labels in backend modules 25/18925/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Mar 2013 20:11:14 +0000 (21:11 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Mar 2013 20:34:52 +0000 (21:34 +0100)
There seems to be some magic in SOBE that automatically includes
language files if they are located parallel to the module that is
loaded. The task from #46143 and #46144 registered new wizard classes
at a different location, so the magic doesn't hit anymore. As a
result, no labels are show in above extensions in the backend.
Fix is to include the locallang file in main() of the modules. The
direct access to $LANG is removed along the way by accessing
$GLOBALS['LANG'] directly.

Change-Id: Iecddb181141f5317b87e405ada925c61cfd9261c
Fixes: #46296
Related: #46143
Related: #46144
Releases: 6.1
Reviewed-on: https://review.typo3.org/18925
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/tstemplate_analyzer/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php
typo3/sysext/tstemplate_ceditor/Classes/Controller/TypoScriptTemplateConstantEditorModuleFunctionController.php
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php
typo3/sysext/tstemplate_info/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/sysext/tstemplate_objbrowser/Classes/Controller/TypoScriptTemplateObjectBrowserModuleFunctionController.php
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php
typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php
typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php

index c5842ae..66e52ab 100644 (file)
@@ -44,6 +44,7 @@ class TemplateAnalyzerModuleFunctionController extends \TYPO3\CMS\Backend\Module
         */
        public function init(&$pObj, $conf) {
                parent::init($pObj, $conf);
+               $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_analyzer/locallang.xlf');
                $this->pObj->modMenu_setDefaultList .= ',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax';
        }
 
index 336cf2a..fdd6e15 100644 (file)
@@ -24,7 +24,7 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_analyzer/locallang.xlf');
+
 /*
  * @deprecated since 6.0, the classname tx_tstemplateanalyzer and this file is obsolete
  * and will be removed with 6.2. The class was renamed and is now located at:
index 83f63cd..f60b4d0 100644 (file)
@@ -101,6 +101,7 @@ class TypoScriptTemplateConstantEditorModuleFunctionController extends \TYPO3\CM
        public function main() {
                global $TYPO3_CONF_VARS;
                global $tmpl, $tplRow, $theConstants;
+               $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_ceditor/locallang.xlf');
                $theOutput = '';
                // Create extension template
                $this->pObj->createTemplate($this->pObj->id);
index 0440d2c..3da97fe 100644 (file)
@@ -24,7 +24,7 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_ceditor/locallang.xlf');
+
 /*
  * @deprecated since 6.0, the classname tx_tstemplateceditor and this file is obsolete
  * and will be removed with 6.2. The class was renamed and is now located at:
index d7ff889..8906fde 100644 (file)
@@ -201,6 +201,7 @@ class TypoScriptTemplateInformationModuleFunctionController extends \TYPO3\CMS\B
        public function main() {
                global $BACK_PATH;
                global $tmpl, $tplRow, $theConstants;
+               $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_info/locallang.xlf');
                $this->pObj->MOD_MENU['includeTypoScriptFileContent'] = TRUE;
                $edit = $this->pObj->edit;
                $e = $this->pObj->e;
index 95d3d31..73ed4f0 100644 (file)
@@ -24,7 +24,7 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_info/locallang.xlf');
+
 /*
  * @deprecated since 6.0, the classname tx_tstemplateinfo and this file is obsolete
  * and will be removed with 6.2. The class was renamed and is now located at:
index 9380450..45da962 100644 (file)
@@ -55,6 +55,7 @@ class TypoScriptTemplateObjectBrowserModuleFunctionController extends \TYPO3\CMS
         * @todo Define visibility
         */
        public function modMenu() {
+               $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_objbrowser/locallang.xlf');
                $modMenu = array(
                        'ts_browser_type' => array(
                                'const' => $GLOBALS['LANG']->getLL('constants'),
index 437c481..4bc415e 100644 (file)
@@ -24,7 +24,7 @@
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-$GLOBALS['LANG']->includeLLFile('EXT:tstemplate_objbrowser/locallang.xlf');
+
 /*
  * @deprecated since 6.0, the classname tx_tstemplateobjbrowser and this file is obsolete
  * and will be removed with 6.2. The class was renamed and is now located at:
index 80c7edb..09bbc78 100644 (file)
@@ -80,7 +80,7 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
         * @todo Define visibility
         */
        public function main() {
-               global $SOBE, $LANG;
+               $GLOBALS['LANG']->includeLLFile('EXT:wizard_crpages/locallang.xlf');
                $theCode = '';
                $this->tsConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($this->pObj->id);
                $this->pagesTsConfig = isset($this->tsConfig['TCEFORM.']['pages.']) ? $this->tsConfig['TCEFORM.']['pages.'] : array();
@@ -147,17 +147,17 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
                                                $lines[] = '<nobr>' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec, array('title' => \TYPO3\CMS\Backend\Utility\BackendUtility::titleAttribForPages($rec, '', FALSE))) . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</nobr>';
                                        }
                                }
-                               $theCode .= '<h4>' . $LANG->getLL('wiz_newPages_currentMenu') . '</h4>' . implode('<br />', $lines);
+                               $theCode .= '<h4>' . $GLOBALS['LANG']->getLL('wiz_newPages_currentMenu') . '</h4>' . implode('<br />', $lines);
                        } else {
                                // Display create form
                                $lines = array();
                                for ($a = 0; $a < 9; $a++) {
                                        $lines[] = $this->getFormLine($a);
                                }
-                               $theCode .= '<h4>' . $LANG->getLL('wiz_newPages') . ':</h4>' . '<div id="formFieldContainer">' . implode('', $lines) . '</div>' . '<br class="clearLeft" />' . '<input type="button" id="createNewFormFields" value="' . $LANG->getLL('wiz_newPages_addMoreLines') . '" />' . '<br /><br />
-                               <input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" /> <label for="createInListEnd">' . $LANG->getLL('wiz_newPages_listEnd') . '</label><br />
-                               <input type="checkbox" name="hidePages" id="hidePages" value="1" /> <label for="hidePages">' . $LANG->getLL('wiz_newPages_hidePages') . '</label><br /><br />
-                               <input type="submit" name="create" value="' . $LANG->getLL('wiz_newPages_lCreate') . '" />&nbsp;<input type="reset" value="' . $LANG->getLL('wiz_newPages_lReset') . '" /><br />';
+                               $theCode .= '<h4>' . $GLOBALS['LANG']->getLL('wiz_newPages') . ':</h4>' . '<div id="formFieldContainer">' . implode('', $lines) . '</div>' . '<br class="clearLeft" />' . '<input type="button" id="createNewFormFields" value="' . $GLOBALS['LANG']->getLL('wiz_newPages_addMoreLines') . '" />' . '<br /><br />
+                               <input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" /> <label for="createInListEnd">' . $GLOBALS['LANG']->getLL('wiz_newPages_listEnd') . '</label><br />
+                               <input type="checkbox" name="hidePages" id="hidePages" value="1" /> <label for="hidePages">' . $GLOBALS['LANG']->getLL('wiz_newPages_hidePages') . '</label><br /><br />
+                               <input type="submit" name="create" value="' . $GLOBALS['LANG']->getLL('wiz_newPages_lCreate') . '" />&nbsp;<input type="reset" value="' . $GLOBALS['LANG']->getLL('wiz_newPages_lReset') . '" /><br />';
                                // Add ExtJS inline code
                                $extCode = '
                                        var tpl = "' . addslashes(str_replace(array(LF, TAB), array('', ''), $this->getFormLine('#'))) . '", i, line, div, bg, label;
@@ -186,11 +186,11 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
                                ');
                        }
                } else {
-                       $theCode .= $GLOBALS['TBE_TEMPLATE']->rfw($LANG->getLL('wiz_newPages_errorMsg1'));
+                       $theCode .= $GLOBALS['TBE_TEMPLATE']->rfw($GLOBALS['LANG']->getLL('wiz_newPages_errorMsg1'));
                }
                // CSH
                $theCode .= \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('_MOD_web_func', 'tx_wizardcrpages', $GLOBALS['BACK_PATH'], '<br />|');
-               $out = $this->pObj->doc->header($LANG->getLL('wiz_crMany'));
+               $out = $this->pObj->doc->header($GLOBALS['LANG']->getLL('wiz_crMany'));
                $out .= $this->pObj->doc->section('', $theCode, 0, 1);
                return $out;
        }
index 5069d6c..3262f98 100644 (file)
@@ -54,8 +54,8 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
         * @todo Define visibility
         */
        public function main() {
-               global $SOBE, $LANG;
-               $out = $this->pObj->doc->header($LANG->getLL('wiz_sort'));
+               $GLOBALS['LANG']->includeLLFile('EXT:wizard_sortpages/locallang.xlf');
+               $out = $this->pObj->doc->header($GLOBALS['LANG']->getLL('wiz_sort'));
                if ($GLOBALS['BE_USER']->workspace === 0) {
                        $theCode = '';
                        // Check if user has modify permissions to
@@ -87,34 +87,34 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
                        if (count($menuItems)) {
                                $lines = array();
                                $lines[] = '<tr class="t3-row-header">
-                               <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title') . '</td>
-                               ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td> ' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</td>' : '') . '
-                               <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</td>
-                               <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</td>
+                               <td>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title') . '</td>
+                               ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td> ' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</td>' : '') . '
+                               <td>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</td>
+                               <td>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</td>
                                </tr>';
                                foreach ($menuItems as $rec) {
                                        $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(2);
                                        // edit permissions for that page!
                                        $pRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $rec['uid'], 'uid', ' AND ' . $m_perms_clause);
-                                       $lines[] = '<tr><td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec) . (!is_array($pRec) ? $GLOBALS['TBE_TEMPLATE']->rfw('<strong>' . $LANG->getLL('wiz_W', 1) . '</strong> ') : '') . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '&nbsp;</td>
+                                       $lines[] = '<tr><td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec) . (!is_array($pRec) ? $GLOBALS['TBE_TEMPLATE']->rfw('<strong>' . $GLOBALS['LANG']->getLL('wiz_W', 1) . '</strong> ') : '') . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '&nbsp;</td>
                                        ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td nowrap="nowrap">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['subtitle'], $GLOBALS['BE_USER']->uc['titleLen'])) . '&nbsp;</td>' : '') . '
                                        <td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['tstamp']) . '&nbsp;&nbsp;</td>
                                        <td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\BackendUtility::datetime($rec['crdate']) . '&nbsp;&nbsp;</td>
                                        </tr>';
                                }
-                               $theCode .= '<h4>' . $LANG->getLL('wiz_currentPageOrder', TRUE) . '</h4>
+                               $theCode .= '<h4>' . $GLOBALS['LANG']->getLL('wiz_currentPageOrder', TRUE) . '</h4>
                        <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' . implode('', $lines) . '</table><br />';
                                // Menu:
                                $lines = array();
-                               $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title');
+                               $lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title');
                                if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
-                                       $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle');
+                                       $lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle');
                                }
-                               $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp');
-                               $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tCreate'), 'crdate');
+                               $lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tChange'), 'tstamp');
+                               $lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tCreate'), 'crdate');
                                $lines[] = '';
-                               $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_REVERSE'), 'REV');
-                               $theCode .= '<h4>' . $LANG->getLL('wiz_changeOrder') . '</h4>' . implode('<br />', $lines);
+                               $lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_REVERSE'), 'REV');
+                               $theCode .= '<h4>' . $GLOBALS['LANG']->getLL('wiz_changeOrder') . '</h4>' . implode('<br />', $lines);
                        } else {
                                $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->getLL('no_subpages'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::NOTICE);
                                $theCode .= $flashMessage->render();