Fixed bug #11884: User setup: buttons for create/delete ENABLE_INSTALL_TOOL-file...
authorSteffen Kamper <info@sk-typo3.de>
Sat, 19 Sep 2009 16:40:20 +0000 (16:40 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sat, 19 Sep 2009 16:40:20 +0000 (16:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5993 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/setup/ext_tables.php
typo3/sysext/setup/locallang_csh_mod.xml
typo3/sysext/setup/mod/index.php
typo3/sysext/setup/mod/locallang.xml

index cc5a865..2a9c9d7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-09-19  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #11884: User setup: buttons for create/delete ENABLE_INSTALL_TOOL-file are not integrated in user setup
        * Fixed bug #11896: User Setup miss save of be_users fields and miss handling of default value
 
 2009-09-19  Ingo Renner  <ingo@typo3.org>
index 9d58deb..aceb9ef 100755 (executable)
@@ -155,11 +155,18 @@ $GLOBALS['TYPO3_USER_SETTINGS'] = array(
                        'label' => 'LLL:EXT:setup/mod/locallang.xml:resizeTextareas_Flexible',
                        'csh' => 'resizeTextareas_Flexible',
                ),
+               'installToolEnableButton' => array(
+                       'type' => 'user',
+                       'label' => 'LLL:EXT:setup/mod/locallang.xml:enableInstallTool.label',
+                       'userFunc' => 'SC_mod_user_setup_index->renderInstallToolEnableFileButton',
+                       'access' => 'admin',
+                       'csh' => 'enableInstallTool'
+               ),
        ),
        'showitem' => '--div--;LLL:EXT:setup/mod/locallang.xml:personal_data,realName,email,emailMeAtLogin,password,password2,lang,
                        --div--;LLL:EXT:setup/mod/locallang.xml:opening,condensedMode,noMenuMode,startModule,thumbnailsByDefault,helpText,edit_showFieldHelp,titleLen,
                        --div--;LLL:EXT:setup/mod/locallang.xml:editFunctionsTab,edit_RTE,edit_wideDocument,edit_docModuleUpload,enableFlashUploader,resizeTextareas,resizeTextareas_MaxHeight,resizeTextareas_Flexible,disableCMlayers,copyLevels,recursiveDelete,
-                       --div--;LLL:EXT:setup/mod/locallang.xml:adminFunctions,simulate'
+                       --div--;LLL:EXT:setup/mod/locallang.xml:adminFunctions,simulate,installToolEnableButton'
 
 );
 ?>
\ No newline at end of file
index ea39d51..b54ebc7 100755 (executable)
@@ -108,6 +108,8 @@ When &quot;Display full text message&quot; is selected you will see a short desc
                        <label index="reset.details">This does not apply to user name, email and password settings of course.</label>
                        <label index="simuser.alttitle">Simulate backend user</label>
                        <label index="simuser.description">This option allows &quot;admin&quot;-users to change settings for another backend user in the system.</label>
+                       <label index="option_enableInstallTool.alttitle">Admin control for re-enabling Install Tool access</label>
+                       <label index="option_enableInstallTool.description">By clicking this button, a file typo3conf/ENABLE_INSTALL_TOOL is created (or removed if it already exists). It unlocks the access to the Install Tool (password is still needed!) and will be removed automatically after 1 hour.</label>
                </languageKey>
        </data>
 </T3locallang>
\ No newline at end of file
index 85f3711..c67cdfd 100755 (executable)
@@ -354,22 +354,7 @@ class SC_mod_user_setup_index {
                        <input type="submit" name="data[clearSessionVars]" value="'.$LANG->getLL('clearSessionVars').'" />'
                );
 
-                       // Install Tool access file
-               if ($this->isAdmin) {
-                       $installToolEnableFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
-                       $installToolEnableButton = $installToolEnableFileExists ?
-                               '<input type="submit" name="deleteInstallToolEnableFile" value="' . $LANG->getLL('enableInstallTool.deleteFile') . '" />' :
-                               '<input type="submit" name="createInstallToolEnableFile" value="' . $LANG->getLL('enableInstallTool.createFile') . '" />';
-
-                       $this->content .= $this->doc->spacer(30);
-                       $this->content .= $this->doc->section($LANG->getLL('enableInstallTool.headerTitle'),
-                               $LANG->getLL('enableInstallTool.description')
-                       );
-                       $this->content .= $this->doc->spacer(10);
-                       $this->content .= $this->doc->section('',
-                               $installToolEnableButton
-                       );
-               }
+
 
                        // Notice
                $this->content .= $this->doc->spacer(30);
@@ -692,7 +677,21 @@ class SC_mod_user_setup_index {
                return '<select id="field_startModule" name="data[startModule]" class="select">' . $startModuleSelect . '</select>';
                }
 
-
+       /**
+        * 
+        * @param array $params                    config of the field
+        * @param SC_mod_user_setup_index $parent  this class as reference
+        * @return string                              html with description and button
+        */
+       public function renderInstallToolEnableFileButton(array $params, SC_mod_user_setup_index $parent) {
+               // Install Tool access file
+               $installToolEnableFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL');
+               if ($installToolEnableFileExists) {
+                       return '<input type="submit" name="deleteInstallToolEnableFile" value="' . $GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:enableInstallTool.deleteFile') . '" />';
+               } else {
+                       return '<input type="submit" name="createInstallToolEnableFile" value="' . $GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:enableInstallTool.createFile') . '" />';
+               }
+       }
 
        /**
         * Will make the simulate-user selector if the logged in user is administrator.
@@ -805,7 +804,7 @@ class SC_mod_user_setup_index {
                if (!t3lib_div::inList('language,simuser', $str)) {
                        $str = 'option_' . $str;
                }
-               return t3lib_BEfunc::cshItem('_MOD_user_setup', $str, $GLOBALS['BACK_PATH'], '|', false, 'margin-bottom:0px;');
+               return t3lib_BEfunc::cshItem('_MOD_user_setup', $str, $this->doc->backPath, '|', false, 'margin-bottom:0px;');
        }
 }
 
index 6b58387..b40ebdc 100755 (executable)
                        <label index="newPassword_ok">Password was updated</label>
                        <label index="newPassword_failed">Password was NOT updated because you didn't enter the same password twice.</label>
                        <label index="adminFunctions">Admin functions</label>
-                       <label index="enableInstallTool.headerTitle">Admin control for re-enabling Install Tool access</label>
-                       <label index="enableInstallTool.description">By clicking this button, a file typo3conf/ENABLE_INSTALL_TOOL is created (or removed if it already exists).&lt;br /&gt;It unlocks the access to the Install Tool (password is still needed!) and will be removed automatically after 1 hour.</label>
+                       <label index="enableInstallTool.label">Install Tool Access</label>
                        <label index="enableInstallTool.createFile">Create Install Tool Enable File</label>
                        <label index="enableInstallTool.deleteFile">Delete Install Tool Enable File</label>
                </languageKey>