Ignore:
Timestamp:
2012/02/06 11:05:15 (12 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/graph/SC_GraphBase.php

    r21420 r21441  
    215215        $new_height = $this->bgh * 0.8; 
    216216        $tmp_image = imagecreatetruecolor($new_width, $new_height); 
    217         if(imagecopyresampled($tmp_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->bgw, $this->bgh)) { 
     217        if (imagecopyresampled($tmp_image, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->bgw, $this->bgh)) { 
    218218            $this->image = $tmp_image; 
    219219        } 
     
    225225        $count = count($this->arrRGB); 
    226226        // 通常色の設定 
    227         for($i = 0; $i < $count; $i++) { 
     227        for ($i = 0; $i < $count; $i++) { 
    228228            $this->arrColor[$i] = $this->lfGetImageColor($this->image, $this->arrRGB[$i]); 
    229229        } 
    230230        // 暗色の設定 
    231         for($i = 0; $i < $count; $i++) { 
     231        for ($i = 0; $i < $count; $i++) { 
    232232            $this->arrDarkColor[$i] = $this->lfGetImageDarkColor($this->image, $this->arrRGB[$i]); 
    233233        } 
     
    241241    // 画像を出力する 
    242242    function outputGraph($header = true, $filename = "") { 
    243         if($header) { 
     243        if ($header) { 
    244244            header('Content-type: image/png'); 
    245245        } 
     
    247247        if ($filename != "") { 
    248248            imagepng($this->image, $filename); 
    249         }else{ 
     249        } else { 
    250250            imagepng($this->image); 
    251251        } 
     
    272272        $angle = -$angle; 
    273273        // ラベル背景 
    274         if($labelbg) { 
     274        if ($labelbg) { 
    275275            $text_width = $this->getTextWidth($text, $font_size); 
    276276            imagefilledrectangle($this->image, $left - 2, $top - 2, $left + $text_width + 2, $top + $font_size + 2, $this->labelbg_color); 
     
    292292        $text = mb_convert_encoding($text, "EUC-JP", CHAR_CODE); 
    293293        //$text = mb_convert_encoding($text, CHAR_CODE); 
    294         if($color != NULL) { 
     294        if ($color != NULL) { 
    295295            ImageTTFText($this->image, $font_size, $angle, $left, $top + $font_size, $color, FONT_REALFILE, $text); 
    296296        } else { 
     
    311311    function debugPrint($text) { 
    312312        $text = mb_convert_encoding($text, "UTF-8", CHAR_CODE); 
    313         if(!isset($this->text_top)) { 
     313        if (!isset($this->text_top)) { 
    314314            $this->text_top = FONT_SIZE + LINE_PAD; 
    315315        } 
     
    322322    function drawLegend($legend_max = "", $clabelbg = true) { 
    323323        // 凡例が登録されていなければ中止 
    324         if(count($this->arrLegend) <= 0) { 
     324        if (count($this->arrLegend) <= 0) { 
    325325            return; 
    326326        } 
    327327 
    328         if($legend_max != "") { 
     328        if ($legend_max != "") { 
    329329            $label_max = $legend_max; 
    330330        } else { 
     
    337337 
    338338        // 一番文字数が多いものを取得 
    339         for($i = 0; $i < $label_max; $i++) { 
     339        for ($i = 0; $i < $label_max; $i++) { 
    340340            $text_len = strlen($this->arrLegend[$i]); 
    341             if($text_max < $text_len) { 
     341            if ($text_max < $text_len) { 
    342342                $text_max = $text_len; 
    343343            } 
     
    351351        $top = LEGEND_TOP; 
    352352        // カラーラベル背景の描画 
    353         if($clabelbg) { 
     353        if ($clabelbg) { 
    354354            $this->drawClabelBG($left - LINE_PAD, $top, $left + $width_max, $top + $height_max + LINE_PAD); 
    355355        } 
     
    358358        // 色数の取得 
    359359        $c_max = count($this->arrColor); 
    360         for($i = 0; $i < $label_max; $i++) { 
     360        for ($i = 0; $i < $label_max; $i++) { 
    361361            // カラーアイコンの表示 
    362362            imagerectangle($this->image, $left, $top, $left + FONT_SIZE, $top + FONT_SIZE, $this->flame_color); 
     
    371371    function drawClabelBG($left, $top, $right, $bottom) { 
    372372        // 影の描画 
    373         if($this->shade_on) { 
     373        if ($this->shade_on) { 
    374374            imagefilledrectangle($this->image, $left + 2, $top + 2, $right + 2, $bottom + 2, $this->shade_color); 
    375375        } 
     
    459459    /** 表示色の取得 */ 
    460460    function lfGetImageColor($image, $array) { 
    461         if(count($array) != 3) { 
     461        if (count($array) != 3) { 
    462462            return NULL; 
    463463        } 
     
    468468    /** 影用表示色の取得 */ 
    469469    function lfGetImageDarkColor($image, $array) { 
    470         if(count($array) != 3) { 
     470        if (count($array) != 3) { 
    471471            return NULL; 
    472472        } 
    473473        $i = 0; 
    474         foreach($array as $val) { 
     474        foreach ($array as $val) { 
    475475            $dark[$i] = $val - 45; 
    476             if($dark[$i] < 0) { 
     476            if ($dark[$i] < 0) { 
    477477                $dark[$i] = 0; 
    478478            } 
Note: See TracChangeset for help on using the changeset viewer.