Changeset 21441 for branches/version-2_12-dev/data/class/SC_FormParam.php
- Timestamp:
- 2012/02/06 11:05:15 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_FormParam.php
r21420 r21441 81 81 function setParam($arrVal, $seq = false) { 82 82 $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])) { 86 86 $this->setValue($val, $arrVal[$val]); 87 87 } 88 88 } 89 89 } else { 90 foreach ($this->keyname as $val) {90 foreach ($this->keyname as $val) { 91 91 $this->param[$cnt] = $arrVal[$cnt]; 92 92 $cnt++; … … 98 98 function setHtmlDispNameArray() { 99 99 $cnt = 0; 100 foreach ($this->keyname as $val) {100 foreach ($this->keyname as $val) { 101 101 $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") { 104 104 $find = true; 105 105 } 106 106 } 107 107 108 if ($find) {108 if ($find) { 109 109 $this->html_disp_name[$cnt] = $this->disp_name[$cnt] . '<span class="red">(※ 必須)</span>'; 110 110 } else { 111 111 $this->html_disp_name[$cnt] = $this->disp_name[$cnt]; 112 112 } 113 if ($this->default[$cnt] != "") {113 if ($this->default[$cnt] != "") { 114 114 $this->html_disp_name[$cnt] .= ' [省略時初期値: ' . $this->default[$cnt] . ']'; 115 115 } 116 if ($this->input_db[$cnt] == false) {116 if ($this->input_db[$cnt] == false) { 117 117 $this->html_disp_name[$cnt] .= ' [登録・更新不可] '; 118 118 } … … 131 131 $count = count($arrVal); 132 132 $no = 1; 133 for ($cnt = 0; $cnt < $count; $cnt++) {133 for ($cnt = 0; $cnt < $count; $cnt++) { 134 134 $key = $keyname.$no; 135 if ($arrVal[$cnt][$keyname] != "") {135 if ($arrVal[$cnt][$keyname] != "") { 136 136 $this->setValue($key, $arrVal[$cnt][$keyname]); 137 137 } … … 153 153 function setValue($key, $param) { 154 154 $cnt = 0; 155 foreach ($this->keyname as $val) {156 if ($val == $key) {155 foreach ($this->keyname as $val) { 156 if ($val == $key) { 157 157 $this->param[$cnt] = $param; 158 158 // 複数一致の場合もあるので break してはいけない。 … … 164 164 function toLower($key) { 165 165 $cnt = 0; 166 foreach ($this->keyname as $val) {167 if ($val == $key) {166 foreach ($this->keyname as $val) { 167 if ($val == $key) { 168 168 $this->param[$cnt] = strtolower($this->param[$cnt]); 169 169 // 複数一致の場合もあるので break してはいけない。 … … 178 178 179 179 $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) { 182 182 if (!isset($this->param[$cnt])) $this->param[$cnt] = ""; 183 switch ($func) {183 switch ($func) { 184 184 case 'EXIST_CHECK': 185 185 case 'NUM_CHECK': … … 217 217 // ファイルの存在チェック 218 218 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])) { 220 220 $objErr->arrErr[$val] = "※ " . $this->disp_name[$cnt] . "のファイルが存在しません。<br>"; 221 221 } … … 223 223 // ダウンロード用ファイルの存在チェック 224 224 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])) { 226 226 $objErr->arrErr[$val] = "※ " . $this->disp_name[$cnt] . "のファイルが存在しません。<br>"; 227 227 } … … 270 270 $objErr->doFunc(array($disp_name, 0, $length), array($func)); 271 271 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)) { 275 275 // 再帰した場合は多次元配列のエラーメッセージを生成 276 276 $error_var = '$arrErr[$error_key]'; … … 327 327 function getHashArray($arrKey = array()) { 328 328 $arrRet = array(); 329 foreach ($this->keyname as $index => $keyname) {329 foreach ($this->keyname as $index => $keyname) { 330 330 if (empty($arrKey) || in_array($keyname, $arrKey)) { 331 331 $arrRet[$keyname] = isset($this->param[$index]) ? $this->param[$index] : ''; … … 372 372 function getFormParamList() { 373 373 $cnt = 0; 374 foreach ($this->keyname as $val) {374 foreach ($this->keyname as $val) { 375 375 376 376 // キー名 … … 385 385 if (!isset($this->param[$cnt])) $this->param[$cnt] = ""; 386 386 387 if ($this->default[$cnt] != "" && $this->param[$cnt] == "") {387 if ($this->default[$cnt] != "" && $this->param[$cnt] == "") { 388 388 $arrRet[$val]['value'] = $this->default[$cnt]; 389 389 } … … 407 407 $cnt = 0; 408 408 $ret = null; 409 foreach ($this->keyname as $val) {410 if ($val == $keyname) {409 foreach ($this->keyname as $val) { 410 if ($val == $keyname) { 411 411 $ret = isset($this->param[$cnt]) ? $this->param[$cnt] : ""; 412 412 break; … … 434 434 function splitParamCheckBoxes($keyname) { 435 435 $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])) { 439 439 $this->param[$cnt] = explode("-", $this->param[$cnt]); 440 440 } … … 507 507 function getFormDispArray() { 508 508 $cnt = 0; 509 foreach ($this->keyname as $val) {509 foreach ($this->keyname as $val) { 510 510 // キー名 511 511 $arrRet[$cnt]['keyname'] = $this->keyname[$cnt]; … … 521 521 if (!isset($this->param[$cnt])) $this->param[$cnt] = ""; 522 522 523 if ($this->default[$cnt] != "" && $this->param[$cnt] == "") {523 if ($this->default[$cnt] != "" && $this->param[$cnt] == "") { 524 524 $arrRet[$cnt]['value'] = $this->default[$cnt]; 525 525 }
Note: See TracChangeset
for help on using the changeset viewer.
