Follow up to #10320 (again): t3lib_extMgm::addStaticFile() call did not reflect chang...
[Packages/TYPO3.CMS.git] / typo3 / wizard_colorpicker.php
old mode 100755 (executable)
new mode 100644 (file)
index 8a26642..fcd22f2
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2004 Kasper Skårhøj (kasper@typo3.com)
+*  (c) 1999-2009 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  *
  *
  *
- *   70: class SC_wizard_colorpicker
- *   98:     function init()
- *  177:     function main()
- *  230:     function printContent()
- *  241:     function frameSet()
+ *   75: class SC_wizard_colorpicker
+ *  103:     function init()
+ *  182:     function main()
+ *  233:     function printContent()
+ *  246:     function frameSet()
  *
  *              SECTION: Rendering of various color selectors
- *  300:     function colorMatrix()
- *  350:     function colorList()
- *  381:     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.
 
 
@@ -138,7 +144,6 @@ class SC_wizard_colorpicker {
                        // Initialize document object:
                $this->doc = t3lib_div::makeInstance('smallDoc');
                $this->doc->backPath = $BACK_PATH;
-               $this->doc->docType = 'xhtml_trans';
                $this->doc->JScode = $this->doc->wrapScriptTags('
                        function checkReference()       {       //
                                if (parent.opener && parent.opener.document && parent.opener.document.'.$this->formName.' && parent.opener.document.'.$this->formName.'["'.$this->fieldName.'"])        {
@@ -222,7 +227,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 +236,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 +393,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 +413,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
@@ -431,25 +437,17 @@ class SC_wizard_colorpicker {
        }
 }
 
-// Include extension?
+
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_colorpicker.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_colorpicker.php']);
 }
 
 
 
-
-
-
-
-
-
-
-
-
 // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_wizard_colorpicker');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
+
 ?>
\ No newline at end of file