* Fixed bug #6961: Errors in link creation popup window
[Packages/TYPO3.CMS.git] / typo3 / wizard_colorpicker.php
index fc2ecb7..1816117 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2004 Kasper Skårhøj (kasperYYYY@typo3.com)
+*  (c) 1999-2005 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  *   75: class SC_wizard_colorpicker
  *  103:     function init()
  *  182:     function main()
- *  234:     function printContent()
- *  245:     function frameSet()
+ *  233:     function printContent()
+ *  246:     function frameSet()
  *
  *              SECTION: Rendering of various color selectors
- *  304:     function colorMatrix()
- *  353:     function colorList()
- *  383:     function colorImage()
- *  416:     function getIndex($im,$x,$y)
+ *  305:     function colorMatrix()
+ *  354:     function colorList()
+ *  384:     function colorImage()
+ *  417:     function getIndex($im,$x,$y)
  *
  * TOTAL FUNCTIONS: 8
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -89,7 +89,13 @@ class SC_wizard_colorpicker {
                // Internal:
        var $pickerImage = '';
        var $imageError = '';           // Error message if image not found.
-       var $doc;                                       // Template Object
+
+       /**
+        * document template object
+        *
+        * @var smallDoc
+        */
+       var $doc;
        var $content;                           // Accumulated content.
 
 
@@ -222,7 +228,6 @@ class SC_wizard_colorpicker {
 
                                // Output:
                        $this->content.=$this->doc->section($LANG->getLL('colorpicker_title'), $content, 0,1);
-                       $this->content.=$this->doc->endPage();
                }
        }
 
@@ -232,6 +237,8 @@ class SC_wizard_colorpicker {
         * @return      void
         */
        function printContent() {
+               $this->content.= $this->doc->endPage();
+               $this->content = $this->doc->insertStylesAndJS($this->content);
                echo $this->content;
        }
 
@@ -387,7 +394,7 @@ class SC_wizard_colorpicker {
                if (!$this->imageError) {
                        if ($this->pickerImage) {
                                if(t3lib_div::_POST('coords_x')) {
-                                       $this->colorValue = '#'.$this->getIndex(t3lib_stdgraphic::imageCreateFromGif($this->pickerImage),t3lib_div::_POST('coords_x'),t3lib_div::_POST('coords_y'));
+                                       $this->colorValue = '#'.$this->getIndex(t3lib_stdgraphic::imageCreateFromFile($this->pickerImage),t3lib_div::_POST('coords_x'),t3lib_div::_POST('coords_y'));
                                }
                                $pickerFormImage = '
                                <p class="c-head">'.$LANG->getLL('colorpicker_fromImage',1).'</p>
@@ -407,7 +414,7 @@ class SC_wizard_colorpicker {
         * Gets the HTML (Hex) Color Code for the selected pixel of an image
         * This method handles the correct imageResource no matter what format
         *
-        * @param       pointer         Valid ImageResource returned by t3lib_stdgraphic::imageCreateFromGif
+        * @param       pointer         Valid ImageResource returned by t3lib_stdgraphic::imageCreateFromFile
         * @param       integer         X-Coordinate of the pixel that should be checked
         * @param       integer         Y-Coordinate of the pixel that should be checked
         * @return      string          HEX RGB value for color