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

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

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

Legend:

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

    r21420 r21441  
    8181    function setParam($arrVal, $seq = false) { 
    8282        $cnt = 0; 
    83         if(!$seq){ 
    84             foreach($this->keyname as $val) { 
    85                 if(isset($arrVal[$val])) { 
     83        if (!$seq) { 
     84            foreach ($this->keyname as $val) { 
     85                if (isset($arrVal[$val])) { 
    8686                    $this->setValue($val, $arrVal[$val]); 
    8787                } 
    8888            } 
    8989        } else { 
    90             foreach($this->keyname as $val) { 
     90            foreach ($this->keyname as $val) { 
    9191                $this->param[$cnt] = $arrVal[$cnt]; 
    9292                $cnt++; 
     
    9898    function setHtmlDispNameArray() { 
    9999        $cnt = 0; 
    100         foreach($this->keyname as $val) { 
     100        foreach ($this->keyname as $val) { 
    101101            $find = false; 
    102             foreach($this->arrCheck[$cnt] as $val) { 
    103                 if($val == "EXIST_CHECK") { 
     102            foreach ($this->arrCheck[$cnt] as $val) { 
     103                if ($val == "EXIST_CHECK") { 
    104104                    $find = true; 
    105105                } 
    106106            } 
    107107 
    108             if($find) { 
     108            if ($find) { 
    109109                $this->html_disp_name[$cnt] = $this->disp_name[$cnt] . '<span class="red">(※ 必須)</span>'; 
    110110            } else { 
    111111                $this->html_disp_name[$cnt] = $this->disp_name[$cnt]; 
    112112            } 
    113             if($this->default[$cnt] != "") { 
     113            if ($this->default[$cnt] != "") { 
    114114                $this->html_disp_name[$cnt] .= ' [省略時初期値: ' . $this->default[$cnt] . ']'; 
    115115            } 
    116             if($this->input_db[$cnt] == false) { 
     116            if ($this->input_db[$cnt] == false) { 
    117117                $this->html_disp_name[$cnt] .= ' [登録・更新不可] '; 
    118118            } 
     
    131131        $count = count($arrVal); 
    132132        $no = 1; 
    133         for($cnt = 0; $cnt < $count; $cnt++) { 
     133        for ($cnt = 0; $cnt < $count; $cnt++) { 
    134134            $key = $keyname.$no; 
    135             if($arrVal[$cnt][$keyname] != "") { 
     135            if ($arrVal[$cnt][$keyname] != "") { 
    136136                $this->setValue($key, $arrVal[$cnt][$keyname]); 
    137137            } 
     
    153153    function setValue($key, $param) { 
    154154        $cnt = 0; 
    155         foreach($this->keyname as $val) { 
    156             if($val == $key) { 
     155        foreach ($this->keyname as $val) { 
     156            if ($val == $key) { 
    157157                $this->param[$cnt] = $param; 
    158158                // 複数一致の場合もあるので break してはいけない。 
     
    164164    function toLower($key) { 
    165165        $cnt = 0; 
    166         foreach($this->keyname as $val) { 
    167             if($val == $key) { 
     166        foreach ($this->keyname as $val) { 
     167            if ($val == $key) { 
    168168                $this->param[$cnt] = strtolower($this->param[$cnt]); 
    169169                // 複数一致の場合もあるので break してはいけない。 
     
    178178 
    179179        $cnt = 0; 
    180         foreach($this->keyname as $val) { 
    181             foreach($this->arrCheck[$cnt] as $func) { 
     180        foreach ($this->keyname as $val) { 
     181            foreach ($this->arrCheck[$cnt] as $func) { 
    182182                if (!isset($this->param[$cnt])) $this->param[$cnt] = ""; 
    183                 switch($func) { 
     183                switch ($func) { 
    184184                case 'EXIST_CHECK': 
    185185                case 'NUM_CHECK': 
     
    217217                // ファイルの存在チェック 
    218218                case 'FILE_EXISTS': 
    219                     if($this->param[$cnt] != "" && !file_exists($this->check_dir . $this->param[$cnt])) { 
     219                    if ($this->param[$cnt] != "" && !file_exists($this->check_dir . $this->param[$cnt])) { 
    220220                        $objErr->arrErr[$val] = "※ " . $this->disp_name[$cnt] . "のファイルが存在しません。<br>"; 
    221221                    } 
     
    223223                // ダウンロード用ファイルの存在チェック 
    224224                case 'DOWN_FILE_EXISTS': 
    225                     if($this->param[$cnt] != "" && !file_exists(DOWN_SAVE_REALDIR . $this->param[$cnt])) { 
     225                    if ($this->param[$cnt] != "" && !file_exists(DOWN_SAVE_REALDIR . $this->param[$cnt])) { 
    226226                        $objErr->arrErr[$val] = "※ " . $this->disp_name[$cnt] . "のファイルが存在しません。<br>"; 
    227227                    } 
     
    270270            $objErr->doFunc(array($disp_name, 0, $length), array($func)); 
    271271            if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { 
    272                 foreach($objErr->arrErr as $message) { 
    273  
    274                     if(!SC_Utils_Ex::isBlank($message)) { 
     272                foreach ($objErr->arrErr as $message) { 
     273 
     274                    if (!SC_Utils_Ex::isBlank($message)) { 
    275275                        // 再帰した場合は多次元配列のエラーメッセージを生成 
    276276                        $error_var = '$arrErr[$error_key]'; 
     
    327327    function getHashArray($arrKey = array()) { 
    328328        $arrRet = array(); 
    329         foreach($this->keyname as $index => $keyname) { 
     329        foreach ($this->keyname as $index => $keyname) { 
    330330            if (empty($arrKey) || in_array($keyname, $arrKey)) { 
    331331                $arrRet[$keyname] = isset($this->param[$index]) ? $this->param[$index] : ''; 
     
    372372    function getFormParamList() { 
    373373        $cnt = 0; 
    374         foreach($this->keyname as $val) { 
     374        foreach ($this->keyname as $val) { 
    375375 
    376376            // キー名 
     
    385385            if (!isset($this->param[$cnt])) $this->param[$cnt] = ""; 
    386386 
    387             if($this->default[$cnt] != "" && $this->param[$cnt] == "") { 
     387            if ($this->default[$cnt] != "" && $this->param[$cnt] == "") { 
    388388                $arrRet[$val]['value'] = $this->default[$cnt]; 
    389389            } 
     
    407407        $cnt = 0; 
    408408        $ret = null; 
    409         foreach($this->keyname as $val) { 
    410             if($val == $keyname) { 
     409        foreach ($this->keyname as $val) { 
     410            if ($val == $keyname) { 
    411411                $ret = isset($this->param[$cnt]) ? $this->param[$cnt] : ""; 
    412412                break; 
     
    434434    function splitParamCheckBoxes($keyname) { 
    435435        $cnt = 0; 
    436         foreach($this->keyname as $val) { 
    437             if($val == $keyname) { 
    438                 if(isset($this->param[$cnt]) && !is_array($this->param[$cnt])) { 
     436        foreach ($this->keyname as $val) { 
     437            if ($val == $keyname) { 
     438                if (isset($this->param[$cnt]) && !is_array($this->param[$cnt])) { 
    439439                    $this->param[$cnt] = explode("-", $this->param[$cnt]); 
    440440                } 
     
    507507    function getFormDispArray() { 
    508508        $cnt = 0; 
    509         foreach($this->keyname as $val) { 
     509        foreach ($this->keyname as $val) { 
    510510            // キー名 
    511511            $arrRet[$cnt]['keyname'] = $this->keyname[$cnt]; 
     
    521521            if (!isset($this->param[$cnt])) $this->param[$cnt] = ""; 
    522522 
    523             if($this->default[$cnt] != "" && $this->param[$cnt] == "") { 
     523            if ($this->default[$cnt] != "" && $this->param[$cnt] == "") { 
    524524                $arrRet[$cnt]['value'] = $this->default[$cnt]; 
    525525            } 
Note: See TracChangeset for help on using the changeset viewer.