Cleanup: Added public static definitions to TSpagegen
[Packages/TYPO3.CMS.git] / typo3 / file_rename.php
old mode 100755 (executable)
new mode 100644 (file)
index af90534..78cbe0d
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2008 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -105,6 +105,7 @@ class SC_file_rename {
         * @return      void
         */
        function init() {
+               //TODO remove global
                global $LANG,$BACK_PATH,$TYPO3_CONF_VARS;
 
                        // Initialize GPvars:
@@ -116,14 +117,14 @@ class SC_file_rename {
                $this->basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);
 
                        // Cleaning and checking target
-               if (@file_exists($this->target))        {
+               if (file_exists($this->target)) {
                        $this->target=$this->basicff->cleanDirectoryName($this->target);                // Cleaning and checking target (file or dir)
                } else {
                        $this->target='';
                }
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
                if (!$this->target || !$key)    {
-                       t3lib_BEfunc::typo3PrintError ('Parameter Error','Target was not a directory!','');
+                       t3lib_BEfunc::typo3PrintError ($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', true), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', true), '');
                        exit;
                }
 
@@ -159,6 +160,8 @@ class SC_file_rename {
         * @return      void
         */
        function main() {
+               //TODO remove global, change $LANG into $GLOBALS['LANG'], change locallang*.php to locallang*.xml
+
                global $LANG;
 
                        // Make page header:
@@ -188,6 +191,7 @@ class SC_file_rename {
                        </div>
                ';
 
+               $code .= '</form>';
 
                        // Add the HTML as a section:
                $pageContent .= $code;
@@ -218,25 +222,17 @@ class SC_file_rename {
        }
 }
 
-// Include extension?
+
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/file_rename.php'])  {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/file_rename.php']);
 }
 
 
 
-
-
-
-
-
-
-
-
-
 // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_file_rename');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
+
+?>
\ No newline at end of file