Ignore:
Timestamp:
2012/02/15 19:56:17 (14 years ago)
Author:
Seasoft
Message:

#1625 (typo修正・ソース整形・ソースコメントの改善)

File:
1 edited

Legend:

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

    r21490 r21514  
    9696 
    9797        if (!($_FILES[$keyname]['size'] > 0)) { 
    98             $objErr->arrErr[$keyname] = "※ " . $this->disp_name[$arrKeyname[$keyname]] . "がアップロードされていません。<br />"; 
     98            $objErr->arrErr[$keyname] = '※ ' . $this->disp_name[$arrKeyname[$keyname]] . 'がアップロードされていません。<br />'; 
    9999        } else { 
    100100            foreach ($this->keyname as $val) { 
     
    122122                            } 
    123123                            if (move_uploaded_file($_FILES[$keyname]['tmp_name'], $this->temp_dir . $this->temp_file[$cnt])) { 
    124                                 GC_Utils_Ex::gfPrintLog($_FILES[$keyname]['name']." -> ". $this->temp_dir . $this->temp_file[$cnt]); 
     124                                GC_Utils_Ex::gfPrintLog($_FILES[$keyname]['name'].' -> '. $this->temp_dir . $this->temp_file[$cnt]); 
    125125                            } else { 
    126126                                $objErr->arrErr[$keyname] = '※ ファイルのアップロードに失敗しました。<br />'; 
     
    142142        $arrKeyname = array_flip($this->keyname); 
    143143        if (!($_FILES[$keyname]['size'] > 0)) { 
    144             $objErr->arrErr[$keyname] = "※ " . $this->disp_name[$arrKeyname[$keyname]] . "がアップロードされていません。(ファイルがアップロードできない場合は、.htaccessファイルのphp_value upload_max_filesizeを調整してください)<br />"; 
     144            $objErr->arrErr[$keyname] = '※ ' . $this->disp_name[$arrKeyname[$keyname]] . 'がアップロードされていません。(ファイルがアップロードできない場合は、.htaccessファイルのphp_value upload_max_filesizeを調整してください)<br />'; 
    145145        } else { 
    146146            foreach ($this->keyname as $val) { 
     
    158158                        set_time_limit(0); 
    159159                        $result  = copy($_FILES[$keyname]['tmp_name'], $this->temp_dir . $this->temp_file[$cnt]); 
    160                         GC_Utils_Ex::gfPrintLog($result." -> ". $this->temp_dir . $this->temp_file[$cnt]); 
     160                        GC_Utils_Ex::gfPrintLog($result.' -> '. $this->temp_dir . $this->temp_file[$cnt]); 
    161161                    } 
    162162                } 
     
    174174            if ($val == $keyname) { 
    175175                // 一時ファイルの場合削除する。 
    176                 if ($this->temp_file[$cnt] != "") { 
     176                if ($this->temp_file[$cnt] != '') { 
    177177                    $objImage->deleteImage($this->temp_file[$cnt], $this->temp_dir); 
    178178                } 
    179                 $this->temp_file[$cnt] = ""; 
    180                 $this->save_file[$cnt] = ""; 
     179                $this->temp_file[$cnt] = ''; 
     180                $this->save_file[$cnt] = ''; 
    181181            } 
    182182            $cnt++; 
     
    191191            if ($val == $keyname) { 
    192192                // 一時ファイルの場合削除する。 
    193                 if ($this->temp_file[$cnt] != "") { 
     193                if ($this->temp_file[$cnt] != '') { 
    194194                    $objImage->deleteImage($this->temp_file[$cnt], $this->temp_dir); 
    195195                } 
    196                 $this->temp_file[$cnt] = ""; 
    197                 //$this->save_file[$cnt] = ""; 
     196                $this->temp_file[$cnt] = ''; 
     197                //$this->save_file[$cnt] = ''; 
    198198            } 
    199199            $cnt++; 
     
    204204    function getTempFilePath($keyname) { 
    205205        $cnt = 0; 
    206         $filepath = ""; 
     206        $filepath = ''; 
    207207        foreach ($this->keyname as $val) { 
    208208            if ($val == $keyname) { 
    209                 if ($this->temp_file[$cnt] != "") { 
     209                if ($this->temp_file[$cnt] != '') { 
    210210                    $filepath = $this->temp_dir . $this->temp_file[$cnt]; 
    211211                } 
     
    222222 
    223223        foreach ($this->keyname as $val) { 
    224             if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != "") { 
     224            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    225225 
    226226                $objImage->moveTempImage($this->temp_file[$cnt], $this->save_dir); 
     
    228228                // すでに保存ファイルがあった場合は削除する。 
    229229                if(isset($this->save_file[$cnt]) 
    230                    && $this->save_file[$cnt] != "" 
    231                    && !ereg("^sub/", $this->save_file[$cnt])) { 
     230                   && $this->save_file[$cnt] != '' 
     231                   && !ereg('^sub/', $this->save_file[$cnt])) { 
    232232 
    233233                    $objImage->deleteImage($this->save_file[$cnt], $this->save_dir); 
     
    243243        $objImage = new SC_Image_Ex($this->temp_dir); 
    244244        foreach ($this->keyname as $val) { 
    245             if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != "") { 
     245            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    246246                $objImage->moveTempImage($this->temp_file[$cnt], $this->save_dir); 
    247247                // すでに保存ファイルがあった場合は削除する。 
    248248                if(isset($this->save_file[$cnt]) 
    249                     && $this->save_file[$cnt] != "" 
    250                     && !ereg("^sub/", $this->save_file[$cnt])) 
     249                    && $this->save_file[$cnt] != '' 
     250                    && !ereg('^sub/', $this->save_file[$cnt])) 
    251251                { 
    252252                    $objImage->deleteImage($this->save_file[$cnt], $this->save_dir); 
     
    265265                $arrRet['temp_' . $val] = $this->temp_file[$cnt]; 
    266266            } 
    267             if (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != "") { 
     267            if (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') { 
    268268                $arrRet['save_' . $val] = $this->save_file[$cnt]; 
    269269            } 
     
    309309        $cnt = 0; 
    310310        foreach ($this->keyname as $val) { 
    311             if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != "") { 
     311            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    312312                // ファイルパスチェック(パスのスラッシュ/が連続しないようにする。) 
    313313                if (ereg("/$", $temp_url)) { 
    314314                    $arrRet[$val]['filepath'] = $temp_url . $this->temp_file[$cnt]; 
    315315                } else { 
    316                     $arrRet[$val]['filepath'] = $temp_url . "/" . $this->temp_file[$cnt]; 
     316                    $arrRet[$val]['filepath'] = $temp_url . '/' . $this->temp_file[$cnt]; 
    317317                } 
    318318                $arrRet[$val]['real_filepath'] = $this->temp_dir . $this->temp_file[$cnt]; 
    319             } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != "") { 
     319            } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') { 
    320320                // ファイルパスチェック(パスのスラッシュ/が連続しないようにする。) 
    321321                if (ereg("/$", $save_url)) { 
    322322                    $arrRet[$val]['filepath'] = $save_url . $this->save_file[$cnt]; 
    323323                } else { 
    324                     $arrRet[$val]['filepath'] = $save_url . "/" . $this->save_file[$cnt]; 
     324                    $arrRet[$val]['filepath'] = $save_url . '/' . $this->save_file[$cnt]; 
    325325                } 
    326326                $arrRet[$val]['real_filepath'] = $this->save_dir . $this->save_file[$cnt]; 
     
    351351    // フォームに渡す用のダウンロードファイル情報を返す 
    352352    function getFormDownFile() { 
    353         $arrRet = ""; 
    354         $cnt = 0; 
    355         foreach ($this->keyname as $val) { 
    356             if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != "") { 
     353        $arrRet = ''; 
     354        $cnt = 0; 
     355        foreach ($this->keyname as $val) { 
     356            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    357357                $arrRet = $this->temp_file[$cnt]; 
    358             } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != "") { 
     358            } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') { 
    359359                $arrRet = $this->save_file[$cnt]; 
    360360            } 
     
    369369            if (isset($this->temp_file[$cnt])) { 
    370370                $arrRet[$val] = $this->temp_file[$cnt]; 
    371             } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != "") { 
     371            } elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') { 
    372372                $arrRet[$val] = $this->save_file[$cnt]; 
    373373            } 
     
    381381        $cnt = 0; 
    382382        foreach ($this->keyname as $val) { 
    383             if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != "") { 
     383            if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { 
    384384                $arrRet[$val] = $this->temp_file[$cnt]; 
    385385            } else { 
    386                 $arrRet[$val] = isset($this->save_file[$cnt]) ? $this->save_file[$cnt] : ""; 
     386                $arrRet[$val] = isset($this->save_file[$cnt]) ? $this->save_file[$cnt] : ''; 
    387387            } 
    388388            $cnt++; 
     
    395395        $cnt = 0; 
    396396        foreach ($this->keyname as $val) { 
    397             if (isset($arrVal[$val]) && $arrVal[$val] != "") { 
     397            if (isset($arrVal[$val]) && $arrVal[$val] != '') { 
    398398                $this->save_file[$cnt] = $arrVal[$val]; 
    399399            } 
     
    424424        $cnt = 0; 
    425425        foreach ($this->keyname as $val) { 
    426             if ($arrVal[$val] != "" && $val == 'tv_products_image') { 
     426            if ($arrVal[$val] != '' && $val == 'tv_products_image') { 
    427427                $this->save_file[$cnt] = $arrVal[$val]; 
    428428            } 
     
    436436        $cnt = 0; 
    437437        foreach ($this->keyname as $val) { 
    438             if ($arrVal[$val] != "") { 
    439                 if ($this->save_file[$cnt] == "" && !ereg("^sub/", $arrVal[$val])) { 
     438            if ($arrVal[$val] != '') { 
     439                if ($this->save_file[$cnt] == '' && !ereg('^sub/', $arrVal[$val])) { 
    440440                    $objImage->deleteImage($arrVal[$val], $this->save_dir); 
    441441                } 
     
    449449        $objImage = new SC_Image_Ex($this->temp_dir); 
    450450        $cnt = 0; 
    451         if ($arrVal['down_realfilename'] != "") { 
    452             if ($this->save_file[$cnt] == "" && !ereg("^sub/", $arrVal['down_realfilename'])) { 
     451        if ($arrVal['down_realfilename'] != '') { 
     452            if ($this->save_file[$cnt] == '' && !ereg('^sub/', $arrVal['down_realfilename'])) { 
    453453                $objImage->deleteImage($arrVal['down_realfilename'], $this->save_dir); 
    454454            } 
     
    457457 
    458458    // 必須判定 
    459     function checkEXISTS($keyname = "") { 
     459    function checkEXISTS($keyname = '') { 
    460460        $cnt = 0; 
    461461        $arrRet = array(); 
    462462        foreach ($this->keyname as $val) { 
    463             if ($val == $keyname || $keyname == "") { 
     463            if ($val == $keyname || $keyname == '') { 
    464464                // 必須であればエラーチェック 
    465465                if ($this->necessary[$cnt] == true) { 
    466                     if (!isset($this->save_file[$cnt])) $this->save_file[$cnt] = ""; 
    467                     if (!isset($this->temp_file[$cnt])) $this->temp_file[$cnt] = ""; 
    468                     if($this->save_file[$cnt] == "" 
    469                             &&  $this->temp_file[$cnt] == "") { 
    470                         $arrRet[$val] = "※ " . $this->disp_name[$cnt] . "がアップロードされていません。<br>"; 
     466                    if (!isset($this->save_file[$cnt])) $this->save_file[$cnt] = ''; 
     467                    if (!isset($this->temp_file[$cnt])) $this->temp_file[$cnt] = ''; 
     468                    if($this->save_file[$cnt] == '' 
     469                            &&  $this->temp_file[$cnt] == '') { 
     470                        $arrRet[$val] = '※ ' . $this->disp_name[$cnt] . 'がアップロードされていません。<br>'; 
    471471                    } 
    472472                } 
     
    479479    // 拡大率を指定して画像保存 
    480480    function saveResizeImage($keyname, $to_w, $to_h) { 
    481         $path = ""; 
     481        $path = ''; 
    482482 
    483483        // keynameの添付ファイルを取得 
     
    499499     * @return string 
    500500     */ 
    501     function lfGetTmpImageName($rename, $keyname = "", $uploadfile = "") { 
     501    function lfGetTmpImageName($rename, $keyname = '', $uploadfile = '') { 
    502502 
    503503        if ($rename === true) { 
Note: See TracChangeset for help on using the changeset viewer.