Index: typo3/sysext/setup/mod/index.php =================================================================== --- typo3/sysext/setup/mod/index.php (revision 7623) +++ typo3/sysext/setup/mod/index.php (working copy) @@ -117,6 +117,8 @@ protected $passwordIsSubmitted = FALSE; protected $setupIsUpdated = FALSE; protected $tempDataIsCleared = FALSE; + protected $installToolFileExists = FALSE; + protected $installToolFileKeep = FALSE; /****************************** @@ -266,6 +268,9 @@ function init() { $this->MCONF = $GLOBALS['MCONF']; + //check Install Tool enable file + $this->setInstallToolFileExists(); + $this->setInstallToolFileKeep(); // Returns the script user - that is the REAL logged in user! ($GLOBALS[BE_USER] might be another user due to simulation!) $scriptUser = $this->getRealScriptUserObj(); @@ -305,10 +310,20 @@ // file creation / delete if ($this->isAdmin) { + if ($this->installToolFileKeep) { + $flashMessage = t3lib_div::makeInstance( + 't3lib_FlashMessage', + $LANG->getLL('enableInstallTool.fileHasKeep'), + $LANG->getLL('enableInstallTool.file'), + t3lib_FlashMessage::WARNING + ); + $this->content .= $flashMessage->render(); + } + if (t3lib_div::_POST('deleteInstallToolEnableFile')) { unlink(PATH_typo3conf . 'ENABLE_INSTALL_TOOL'); - $installToolEnableFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL'); - if ($installToolEnableFileExists) { + $this->setInstallToolFileExists(); + if ($this->getInstallToolFileExists()) { $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', $LANG->getLL('enableInstallTool.fileDelete_failed'), @@ -327,8 +342,8 @@ } if (t3lib_div::_POST('createInstallToolEnableFile')) { touch(PATH_typo3conf . 'ENABLE_INSTALL_TOOL'); - $installToolEnableFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL'); - if ($installToolEnableFileExists) { + $this->setInstallToolFileExists(); + if ($this->getInstallToolFileExists()) { $flashMessage = t3lib_div::makeInstance( 't3lib_FlashMessage', $LANG->getLL('enableInstallTool.fileCreate_ok'), @@ -456,6 +471,42 @@ } /** + * Sets existance of Install Tool file + * + * return void + */ + public function setInstallToolFileExists() { + $this->installToolFileExists = is_file(PATH_typo3conf . 'ENABLE_INSTALL_TOOL'); + } + + /** + * Sets property if Install Tool file contains "KEEP_FILE" + */ + public function setInstallToolFileKeep() { + if ($this->installToolFileExists) { + $this->installToolFileKeep = (trim(file_get_contents(PATH_typo3conf . 'ENABLE_INSTALL_TOOL')) === 'KEEP_FILE'); + } + } + + /** + * Gets property installToolFileExists + * + * @return boolean $this->installToolFileExists + */ + public function getInstallToolFileExists() { + return $this->installToolFileExists; + } + + /** + * Gets property installToolFileKeep + * + * @return boolean $this->installToolFileKeep + */ + public function getInstallToolFileKeep() { + return $this->installToolFileKeep; + } + + /** * Prints the content / ends page * * @return void @@ -764,22 +815,20 @@ * @return string html with description and button */ public function renderInstallToolEnableFileButton(array $params, SC_mod_user_setup_index $parent) { - // Install Tool access file + // Install Tool access file $installToolEnableFile = PATH_typo3conf . 'ENABLE_INSTALL_TOOL'; - $installToolEnableFileExists = is_file($installToolEnableFile); - if ($installToolEnableFileExists && (time() - filemtime($installToolEnableFile) > 3600)) { - $content = file_get_contents($installToolEnableFile); - $verifyString = 'KEEP_FILE'; - - if (trim($content) !== $verifyString) { + if ($parent->getInstallToolFileExists() && (time() - filemtime($installToolEnableFile) > 3600)) { + if (!$parent->getInstallToolFileKeep()) { // Delete the file if it is older than 3600s (1 hour) unlink($installToolEnableFile); - $installToolEnableFileExists = is_file($installToolEnableFile); + $parent->setInstallToolFileExists(); } } - if ($installToolEnableFileExists) { - return ''; + if ($parent->getInstallToolFileExists()) { + return 'getInstallToolFileKeep() ? ' disabled="disabled"' : '') . + ' value="' . $GLOBALS['LANG']->sL('LLL:EXT:setup/mod/locallang.xml:enableInstallTool.deleteFile') . '" />'; } else { return ''; } @@ -898,10 +947,10 @@ } return t3lib_BEfunc::cshItem('_MOD_user_setup', $str, $this->doc->backPath, '|', false, 'margin-bottom:0px;'); } - + /** * Returns array with fields defined in $GLOBALS['TYPO3_USER_SETTINGS']['showitem'] - * + * * @param void * @return array array with fieldnames visible in form */ Index: typo3/sysext/setup/mod/locallang.xml =================================================================== --- typo3/sysext/setup/mod/locallang.xml (revision 7623) +++ typo3/sysext/setup/mod/locallang.xml (working copy) @@ -112,6 +112,7 @@ + Index: typo3/sysext/t3skin/stylesheets/visual/main_content.css =================================================================== --- typo3/sysext/t3skin/stylesheets/visual/main_content.css (revision 7623) +++ typo3/sysext/t3skin/stylesheets/visual/main_content.css (working copy) @@ -267,12 +267,24 @@ input[type="submit"], input[type="reset"], -input[type="button"] { +input[type="button"], +input[type="submit"][disabled="disabled"]:hover, +input[type="reset"][disabled="disabled"]:hover, +input[type="button"][disabled="disabled"]:hover { background: #c3c7ce url('../../icons/gfx/bg_input_button.gif') repeat-x; border: 1px solid #acb3be; color: #333; cursor: pointer; } +input[type="submit"][disabled="disabled"], +input[type="reset"][disabled="disabled"], +input[type="button"][disabled="disabled"], +input[type="submit"][disabled="disabled"]:hover, +input[type="reset"][disabled="disabled"]:hover, +input[type="button"][disabled="disabled"]:hover { + color: #fff; + cursor: default; +} input[type="submit"]:hover, input[type="reset"]:hover,