[TASK] Replace Space Indent into Tab indent (CGL Cleanup)
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_iconworks.php
index eccf39a..33417d9 100644 (file)
@@ -126,8 +126,8 @@ final class t3lib_iconWorks {
         */
        public static function getIconImage($table, $row = array(), $backPath, $params = '', $shaded = FALSE) {
                $str = '<img' .
-                          self::skinImg($backPath, self::getIcon($table, $row, $shaded), 'width="18" height="16"') .
-                          (trim($params) ? ' ' . trim($params) : '');
+                       self::skinImg($backPath, self::getIcon($table, $row, $shaded), 'width="18" height="16"') .
+                       (trim($params) ? ' ' . trim($params) : '');
                if (!stristr($str, 'alt="')) {
                        $str .= ' alt=""';
                }
@@ -513,23 +513,22 @@ final class t3lib_iconWorks {
         * Of course it works only if ImageMagick is able to create valid png-images - which you cannot be sure of with older versions (still 5+)
         * The only drawback is (apparently) that IM creates true-color png's. The transparency of these will not be shown by MSIE on windows at this time (although it's straight 0%/100% transparency!) and the file size may be larger.
         *
-        * For parameters, see PHP function "imagecopyresized()"
-        *
-        * @param       pointer         see PHP function "imagecopyresized()"
-        * @param       pointer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @param       integer         see PHP function "imagecopyresized()"
-        * @return      void
+        * @param resource $dstImg destination image
+        * @param resource $srcImg source image
+        * @param integer $dstX destination x-coordinate
+        * @param integer $dstY destination y-coordinate
+        * @param integer $srcX source x-coordinate
+        * @param integer $srcY source y-coordinate
+        * @param integer $dstWidth destination width
+        * @param integer $dstHeight destination height
+        * @param integer $srcWidth source width
+        * @param integer $srcHeight source height
+        * @return void
         * @access private
+        * @see t3lib_stdGraphic::imagecopyresized()
         */
-       public static function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h) {
-               imagecopyresized($im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h);
+       public static function imagecopyresized(&$dstImg, $srcImg, $dstX, $dstY, $srcX, $srcY, $dstWidth, $dstHeight, $srcWidth, $srcHeight) {
+               imagecopyresized($dstImg, $srcImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $dstWidth, $dstHeight, $srcWidth, $srcHeight);
        }
 
        /**
@@ -842,9 +841,11 @@ final class t3lib_iconWorks {
                        }
                }
                krsort($recordType);
-               foreach ($recordType as $iconName) {
-                       if (in_array($iconName, $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) {
-                               return $iconName;
+               if (is_array($GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) {
+                       foreach ($recordType as $iconName) {
+                               if (in_array($iconName, $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable'])) {
+                                       return $iconName;
+                               }
                        }
                }
                return 'status-status-icon-missing';
@@ -943,10 +944,12 @@ final class t3lib_iconWorks {
                $priorities = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayPriorities'];
 
                $iconName = '';
-               foreach ($priorities as $priority) {
-                       if ($status[$priority]) {
-                               $iconName = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames'][$priority];
-                               break;
+               if (is_array($priorities)) {
+                       foreach ($priorities as $priority) {
+                               if ($status[$priority]) {
+                                       $iconName = $GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames'][$priority];
+                                       break;
+                               }
                        }
                }