* Installer: Added a "hide" button to hide the results of executed methods
authorThomas Hempel <thomas.hempel@typo3.org>
Tue, 22 Jan 2008 21:33:11 +0000 (21:33 +0000)
committerThomas Hempel <thomas.hempel@typo3.org>
Tue, 22 Jan 2008 21:33:11 +0000 (21:33 +0000)
* Installer: Added skeletons for gfx check methods

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2950 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/install/mod/scripts.js
typo3/sysext/install/modules/gfx/class.tx_install_module_gfx.php
typo3/sysext/install/modules/gfx/conf.php
typo3/sysext/install/modules/gfx/locallang.xml
typo3/sysext/install/modules/setup/class.tx_install_module_setup.php
typo3/sysext/install/modules/setup/locallang.xml
typo3/sysext/install/modules/setup/res/styles.css

index 62fa01a..526cc92 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2008-01-22     Thomas Hempel  <thomas@typo3-unleashed.net>
 
+       * Installer: Added a "hide" button to hide the results of executed methods
+       * Installer: Added skeletons for gfx check methods
        * Installer: improved the look of the login screen
        * Installer: Smaller bugfixes and enhancements in error handling
 
index b96fb6a..4838283 100644 (file)
@@ -32,6 +32,13 @@ function toggleHelp(elementName)     {
        }
 }
 
+function hideElement(elementId) {
+               // hide the element
+       new Effect.BlindUp(elementId, {duration: 0.3});
+               
+               // hide the "hide" button
+       $('hideBtn_'+elementId).style.display = 'none';
+}
 
 function toggleAllLeafs()      {
        var iconUrl = expandSrc;
@@ -184,7 +191,12 @@ function executeMethod(module, method, extraParameters, callBack)  {
 function displayMethodResult(data)     {
        console.debug(data);
        if (data.request.parameters.target)     {
+                       // display result
                $(data.request.parameters.target).innerHTML = data.responseText;
+               
+                       // show the "hide" button
+               console.debug($('hideBtn_'+data.request.parameters.target));
+               $('hideBtn_'+data.request.parameters.target).style.display = 'inline';
        } else {
                // console.debug(data.responseText);
        }
index d003b81..6421e4f 100644 (file)
@@ -4,8 +4,87 @@
  */
 class tx_install_module_gfx    extends tx_install_module_base  {
        
+       /**
+        * This returns an overview over the current gfx settings.
+        *
+        * @return XHTML
+        */
        public function overview() {
+               /**
+                * ATTENTION! This ist just a copy and paste from old installer!!! Please use this as inspiration. ;-)
+                */
+               $im_path = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];
+               if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'] == 'gm') {
+                       $im_path_version = $this->config_array['im_versions'][$im_path]['gm'];
+               } else {
+                       $im_path_version = $this->config_array['im_versions'][$im_path]['convert'];
+               }
                
+               $im_path_lzw = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'];
+               $im_path_lzw_version = $this->config_array['im_versions'][$im_path_lzw]['convert'];
+               
+               $msg = '
+               ImageMagick enabled: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['im'].'</strong>
+               ImageMagick path: <strong>'.$im_path.'</strong> ('.$im_path_version.')
+               ImageMagick path/LZW: <strong>'.$im_path_lzw.'</strong>  ('.$im_path_lzw_version.')
+               Version 5/GraphicsMagick flag: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5'].'</strong>
+
+               GDLib enabled: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'].'</strong>
+               GDLib using PNG: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png'].'</strong>
+               GDLib 2 enabled: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_2'].'</strong>
+               IM5 effects enabled: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_v5effects'].'</strong> (Blurring/Sharpening with IM 5+)
+               Freetype DPI: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi'].'</strong> (Should be 96 for Freetype 2)
+               Mask invert: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_imvMaskState'].'</strong> (Should be set for some IM versions approx. 5.4+)
+
+               File Formats: <strong>'.$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'].'</strong>
+               ';
+               
+               return $msg;
+       }
+       
+       /**
+        * Checks with image formats can be read.
+        *
+        * @return unknown
+        */
+       public function readingImageFormats() {
+               return 'readingImageFormats';   
+       }
+       
+       /**
+        * Tests if GIF and PNG files can be written
+        *
+        * @return unknown
+        */
+       public function writingGIFandPNG() {
+               return 'writingGIFandPNG';
+       }
+       
+       /**
+        * Tests if images will be scaled correctly
+        *
+        * @return unknown
+        */
+       public function scalingImages() {
+               return 'scalingImages';
+       }
+       
+       /**
+        * Tests if combining images works.
+        *
+        * @return unknown
+        */
+       public function combiningImages() {
+               return 'combiningImages';
+       }
+       
+       /**
+        * Tests the GD library function like FreeType etc.
+        *
+        * @return unknown
+        */
+       public function gdLibraryFunctions() {
+               return 'gdLibraryFunctions';
        }
 }
 
index 6e9b0fb..fe13295 100644 (file)
@@ -254,6 +254,36 @@ $GLOBALS['MCA']['gfx'] = array (
                        'categorySub' => 'checks',
                        'method' => 'gfx:overview',
                        'autostart' => true
+               ),
+               
+               'gfxReadingImageFormats' => array (
+                       'categoryMain' => 'gfx',
+                       'categorySub' => 'checks',
+                       'method' => 'gfx:readingImageFormats',
+               ),
+               
+               'gfxWritingGIFandPNG' => array (
+                       'categoryMain' => 'gfx',
+                       'categorySub' => 'checks',
+                       'method' => 'gfx:writingGIFandPNG',
+               ),
+               
+               'gfxScalingImages' => array (
+                       'categoryMain' => 'gfx',
+                       'categorySub' => 'checks',
+                       'method' => 'gfx:scalingImages',
+               ),
+               
+               'gfxCombiningImages' => array (
+                       'categoryMain' => 'gfx',
+                       'categorySub' => 'checks',
+                       'method' => 'gfx:combiningImages',
+               ),
+               
+               'gfxGDLibraryFunctions' => array (
+                       'categoryMain' => 'gfx',
+                       'categorySub' => 'checks',
+                       'method' => 'gfx:gdLibraryFunctions',
                )
        )
 );
index 1f9309f..cfd441c 100644 (file)
@@ -33,7 +33,7 @@ You can disable all image processing options in TYPO3 ([GFX][image_processing]=0
                        </label>
 
                        <label index="title_gfxOverview">Image Processing</label>
-                       <label index="description_gfxOverview">
+                       <label index="help_gfxOverview">
 &lt;strong&gt;Verifying the image processing capabilities of your server&lt;/strong&gt;&lt;br/&gt;
 This page performs image processing and displays the result. It's a thorough check that everything you've configured is working correctly.&lt;br/&gt;
 It's quite simple to verify your installation; Just look down the page, the images in pairs should look like each other. If some images are not alike, something is wrong. You may also notice warnings and errors if this tool found signs of any problems.&lt;br/&gt;
index 3b8c13a..9cd977b 100644 (file)
@@ -215,7 +215,7 @@ class tx_install_module_setup extends tx_install_module_base        {
                                $this->pObj->getBasicsObject()->loadModule($mod);
                                
                                $helpData = $this->pObj->getViewObject()->renderHelp($this->get_LL($modConfig['help']), $name);
-                               $descr = $this->pObj->getViewObject()->renderTag('div', $this->get_LL($modConfig['description']));
+                               $descr = $this->pObj->getViewObject()->renderTag('div', $this->get_LL($modConfig['description']), array('class' => 'description'));
                                $deliverableContent = '';
                                
                                switch ($deliverable)   {
@@ -282,11 +282,14 @@ class tx_install_module_setup extends tx_install_module_base      {
                                        case 'methods':
                                                        // the result of methods is simply printed out
                                                $target = $name.'_result';
+                                               $hideButton = '<span style="display:none" id="hideBtn_'.$target.'">&nbsp;[<a href="#" onclick="hideElement(\''.$target.'\');">'.$this->get_LL('label_hide').'</a>]</span>';
+                                               
                                                if ($modConfig['autostart'] == true)    {
+                                                       $headerContent = $hideButton;
                                                        $deliverableContent = '<div id="'.$target.'">'.$this->basicsObject->executeMethod($modConfig['method']).'</div>';
                                                } else {
                                                        list($module, $method) = t3lib_div::trimExplode(':', $modConfig['method']);
-                                                       $headerContent = '&nbsp;[<a href="#" onclick="executeMethod(\''.$module.'\', \''.$method.'\',  {target:\''.$target.'\'}, displayMethodResult)">'.$this->get_LL('label_execute').'</a>]';
+                                                       $headerContent = '&nbsp;[<a href="#" onclick="executeMethod(\''.$module.'\', \''.$method.'\',  {target:\''.$target.'\'}, displayMethodResult)">'.$this->get_LL('label_execute').'</a>]'.$hideButton;
                                                        $deliverableContent = '<div id="'.$target.'">'.$deliverableContent.'</div>';
                                                }
                                                break;
index ba14e16..f127051 100644 (file)
@@ -12,6 +12,9 @@
                        <label index="label_value_modified">%s modfied (new value: %s)</label>
                        <label index="label_path">path:</label>
                        <label index="label_default">default value:</label>
+                       
+                       <label index="label_execute">Exceute</label>
+                       <label index="label_hide">Hide</label>
 
                        <label index="msg_searchResultMessage">&lt;strong&gt;%d&lt;/strong&gt; results found for "%s"</label>
                </languageKey>
index 27c873d..1e03eda 100644 (file)
@@ -17,11 +17,15 @@ h3  {
        border-bottom: 1px #c0c0c0 dashed;
 }
 
+p {
+       margin: 10px 0; 
+}
+
 fieldset legend        {
        font-weight: bold;
 }
 
-input.bg, select.bg, button.bg {
+input.bg, select.bg, button    {
        background: #fff url(../../../imgs/icons/bg_input.gif) no-repeat scroll left top;
        border: 1px solid #aaa;
        margin-top: 2px;
@@ -87,12 +91,6 @@ label em     {
        margin: 0px 0px 7px 20px;
 }
 
-.error-header {
-       font-weight: bold;
-       color: red;
-       margin: 5px;
-}
-
 .categoryTreeContainer {
        position: fixed;
        top: 5px;
@@ -127,11 +125,10 @@ label em  {
 
 .help_container        {
        border-bottom: 3px gray solid;
-       width: 100%;
+       width: 600px;
        opacity: 0.9;
-       background-color: yellow;
+       background-color: #cccccc;
        padding: 5px;
-       font-size: 1.2em;
        position: absolute;
 }
 
@@ -178,6 +175,11 @@ label em   {
 }
 
 /** error messages **/
+.error-header {
+       font-weight: bold;
+       color: red;
+       margin: 5px;
+}
 
 .severity_ok strong.message-header     {
        background-image: url('../../../imgs/icons/ok.png');