Fixed bug #8108: Extension configuration options are not always shown, credits Jeff...
authorIngo Renner <ingo.renner@typo3.org>
Wed, 16 Apr 2008 12:04:17 +0000 (12:04 +0000)
committerIngo Renner <ingo.renner@typo3.org>
Wed, 16 Apr 2008 12:04:17 +0000 (12:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3580 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/mod/tools/em/class.em_index.php

index 8f1c962..c290f76 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
        * Added new icons for content elements in t3skin
        * Added new icons in t3skin to select image orientation in Text w/Image content elements
        * Replaced icon for Web->Functions in t3skin
+       * Fixed bug #8108: Extension configuration options are not always shown, credits Jeff Segars
 
 2008-04-15  Benjamin Mack  <benni@typo3.org>
 
index 6eb7524..2c6ffec 100644 (file)
@@ -2157,11 +2157,7 @@ EXTENSION KEYS:
                                                        $this->content.=$this->doc->spacer(10);
                                                        $this->content.=$this->doc->section('Configuration:','(<em>Notice: You may need to clear the cache after configuration of the extension. This is required if the extension adds TypoScript depending on these settings.</em>)<br /><br />',0,1);
 
-                                                       if(t3lib_extMgm::isLoaded($extKey)) {
-                                                               $this->tsStyleConfigForm($extKey,$list[$extKey]);
-                                                       } else {
-                                                               $this->content.= '<img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_note.gif', ' width="18" height="16"').' alt="Note" align="absmiddle" /> This extension provides additional configuration options which become available once you install it.';
-                                                       }
+                                                       $this->tsStyleConfigForm($extKey, $list[$extKey]);
                                                }
 
                                                // Show details:
@@ -2327,11 +2323,20 @@ EXTENSION KEYS:
                $uCache = $this->checkClearCache($extInfo);
                if ($notSilent) $updates.= $uCache;
                $updates.= $this->checkUploadFolder($extKey,$extInfo);
-
-               if ($updates)   {
-                       $updates = '<form action="'.htmlspecialchars($script).'" method="post">'.$updates.$addFields.'
-                               <br /><input type="submit" name="write" value="Make updates" />
-                       ';
+               
+               $absPath = $this->getExtPath($extKey, $extInfo['type']); 
+               if ($notSilent && @is_file($absPath.'ext_conf_template.txt')) { 
+                       $configForm = $this->tsStyleConfigForm($extKey, $extInfo, 1, $script, $updates.$addFields.'<br />'); 
+               } 
+               
+               if ($updates || $configForm) {
+                       if ($configForm) {
+                               $updates = '</form>'.$configForm.'<form>';
+                       } else {
+                               $updates = '</form><form action="'.htmlspecialchars($script).'" method="post">'.$updates.$addFields.' 
+                                       <br /><input type="submit" name="write" value="Make updates" /> 
+                               ';
+                       }
                }
 
                return $updates;
@@ -4717,16 +4722,16 @@ $EM_CONF[$_EXTKEY] = '.$this->arrayToCode($EM_CONF, 0).';
                $relPath = $this->typeRelPaths[$extInfo['type']].$extKey.'/';
 
                        // Look for template file for form:
-               if (@is_file($absPath.'ext_conf_template.txt')) {
+               if (t3lib_extMgm::isLoaded($extKey) && @is_file($absPath.'ext_conf_template.txt')) {
 
                                // Load tsStyleConfig class and parse configuration template:
                        $tsStyleConfig = t3lib_div::makeInstance('t3lib_tsStyleConfig');
                        $tsStyleConfig->doNotSortCategoriesBeforeMakingForm = TRUE;
                        $theConstants = $tsStyleConfig->ext_initTSstyleConfig(
-                       t3lib_div::getUrl($absPath.'ext_conf_template.txt'),
-                       $relPath,
-                       $absPath,
-                       $GLOBALS['BACK_PATH']
+                               t3lib_div::getUrl($absPath.'ext_conf_template.txt'),
+                               $relPath,
+                               $absPath,
+                               $GLOBALS['BACK_PATH']
                        );
 
                                // Load the list of resources.
@@ -4774,12 +4779,27 @@ $EM_CONF[$_EXTKEY] = '.$this->arrayToCode($EM_CONF, 0).';
                                                <td>'.$tsStyleConfig->ext_getForm($MOD_SETTINGS['constant_editor_cat'],$theConstants,$script,$addFields).'</form></td>
                                        </tr>
                                </table>';
-                       if ($output)    {
-                               return $form;
-                       } else {
-                               $this->content.=$this->doc->section('',$form);
-                       }
+               } else {
+                       $form = '
+                               <table border="0" cellpadding="0" cellspacing="0" width="600">
+                                       <tr>
+                                               <td>
+                                                       <form action="'.htmlspecialchars($script).'" method="post">'.
+                                                               $addFields.'
+                                                               <p><img '.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/icon_note.gif', ' width="18" height="16"').' alt="Note" align="absmiddle" /> This extension provides additional configuration options which become available once it is installed.</p><br />
+                                                               <input type="submit" name="write" value="Make updates" />
+                                                       </form>
+                                               </td>
+                                       </tr>
+                               </table>';
+               }
+               
+               if ($output) {
+                       return $form;
+               } else {
+                       $this->content.=$this->doc->section('', $form);
                }
+               
        }