Changeset 22796 for branches/version-2_12-dev/data/class/SC_FormParam.php
- Timestamp:
- 2013/05/02 18:11:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_FormParam.php
r22567 r22796 30 30 * @author LOCKON CO.,LTD. 31 31 */ 32 class SC_FormParam 33 { 32 class SC_FormParam { 34 33 35 34 /** … … 63 62 * コンストラクタ 64 63 */ 65 function __construct() 66 { 64 function __construct() { 67 65 $this->check_dir = IMAGE_SAVE_REALDIR; 68 66 … … 84 82 * @deprecated 2.12.0 #1702 85 83 */ 86 function initParam() 87 { 84 function initParam() { 88 85 $this->disp_name = array(); 89 86 $this->keyname = array(); … … 96 93 97 94 // パラメーターの追加 98 function addParam($disp_name, $keyname, $length = '', $convert = '', $arrCheck = array(), $default = '', $input_db = true) 99 { 95 function addParam($disp_name, $keyname, $length = '', $convert = '', $arrCheck = array(), $default = '', $input_db = true) { 100 96 $this->disp_name[] = $disp_name; 101 97 $this->keyname[] = $keyname; … … 111 107 // $arrVal :$arrVal['keyname']・・の配列を一致したキーのインスタンスに格納する 112 108 // $seq :trueの場合、$arrVal[0]~の配列を登録順にインスタンスに格納する 113 function setParam($arrVal, $seq = false) 114 { 109 function setParam($arrVal, $seq = false) { 115 110 if (!is_array($arrVal)) return; 116 111 if (!$seq) { … … 126 121 127 122 // 画面表示用タイトル生成 128 function setHtmlDispNameArray() 129 { 123 function setHtmlDispNameArray() { 130 124 foreach ($this->keyname as $index => $key) { 131 125 $find = false; … … 151 145 152 146 // 画面表示用タイトル取得 153 function getHtmlDispNameArray() 154 { 147 function getHtmlDispNameArray() { 155 148 return $this->html_disp_name; 156 149 } 157 150 158 151 // 複数列パラメーターの取得 159 function setParamList($arrVal2d, $keyname) 160 { 152 function setParamList($arrVal2d, $keyname) { 161 153 // DBの件数を取得する。 162 154 $no = 1; … … 168 160 } 169 161 170 function setDBDate($db_date, $year_key = 'year', $month_key = 'month', $day_key = 'day') 171 { 162 function setDBDate($db_date, $year_key = 'year', $month_key = 'month', $day_key = 'day') { 172 163 if (empty($db_date)) { 173 164 return; … … 180 171 181 172 // キーに対応した値をセットする。 182 function setValue($key, $value) 183 { 173 function setValue($key, $value) { 184 174 if (!in_array($key, $this->keyname)) { 185 175 // TODO 警告発生 … … 189 179 } 190 180 191 function toLower($key) 192 { 181 function toLower($key) { 193 182 if (isset($this->arrValue[$key])) { 194 183 $this->arrValue[$key] = strtolower($this->arrValue[$key]); … … 197 186 198 187 // エラーチェック 199 function checkError($br = true) 200 { 188 function checkError($br = true) { 201 189 $arrErr = array(); 202 190 … … 230 218 case 'SELECT_CHECK': 231 219 case 'FILE_NAME_CHECK_BY_NOUPLOAD': 232 case 'NUM_POINT_CHECK':233 220 $this->recursionCheck($this->disp_name[$index], $func, 234 221 $value, $arrErr, $key, $this->length[$index]); … … 315 302 * @see mb_convert_kana 316 303 */ 317 function convParam() 318 { 304 function convParam() { 319 305 foreach ($this->keyname as $index => $key) { 320 306 if (isset($this->arrValue[$key])) { … … 330 316 * @param string $convert mb_convert_kana の変換オプション 331 317 */ 332 function recursionConvParam(&$value, $convert) 333 { 318 function recursionConvParam(&$value, $convert) { 334 319 if (is_array($value)) { 335 320 foreach ($value as $key => $val) { … … 349 334 * @return array 連想配列 350 335 */ 351 function getHashArray($arrKey = array()) 352 { 336 function getHashArray($arrKey = array()) { 353 337 $arrRet = array(); 354 338 foreach ($this->keyname as $keyname) { … … 361 345 362 346 // DB格納用配列の作成 363 function getDbArray() 364 { 347 function getDbArray() { 365 348 $dbArray = array(); 366 349 foreach ($this->keyname as $index => $key) { … … 378 361 * @return array 縦横を入れ替えた配列 379 362 */ 380 function getSwapArray($arrKey = array()) 381 { 363 function getSwapArray($arrKey = array()) { 382 364 $arrTmp = $this->getHashArray($arrKey); 383 365 return SC_Utils_Ex::sfSwapArray($arrTmp); … … 385 367 386 368 // 項目名一覧の取得 387 function getTitleArray() 388 { 369 function getTitleArray() { 389 370 return $this->disp_name; 390 371 } 391 372 392 373 // 項目数を返す 393 function getCount() 394 { 374 function getCount() { 395 375 $count = count($this->keyname); 396 376 return $count; … … 398 378 399 379 // フォームに渡す用のパラメーターを返す 400 function getFormParamList() 401 { 380 function getFormParamList() { 402 381 $formParamList = array(); 403 382 foreach ($this->keyname as $index => $key) { … … 419 398 * @return array キー名の一覧 420 399 */ 421 function getKeyList() 422 { 400 function getKeyList() { 423 401 return $this->keyname; 424 402 } 425 403 426 404 // キー名と一致した値を返す 427 function getValue($keyname, $default = '') 428 { 405 function getValue($keyname, $default = '') { 429 406 $ret = null; 430 407 foreach ($this->keyname as $key) { … … 452 429 * @deprecated 453 430 */ 454 function splitParamCheckBoxes($keyname) 455 { 431 function splitParamCheckBoxes($keyname) { 456 432 foreach ($this->keyname as $key) { 457 433 if ($key == $keyname) { … … 469 445 * @return void 470 446 */ 471 function trimParam($has_wide_space = true) 472 { 447 function trimParam($has_wide_space = true) { 473 448 foreach ($this->arrValue as &$value) { 474 449 $this->recursionTrim($value, $has_wide_space); … … 483 458 * @return void 484 459 */ 485 function recursionTrim(&$value, $has_wide_space = true) 486 { 460 function recursionTrim(&$value, $has_wide_space = true) { 487 461 $pattern = '/^[ \r\n\t]*(.*?)[ \r\n\t]*$/u'; 488 462 if (is_array($value)) { 489 463 foreach ($value as $key => $val) { 490 $this->recursionTrim($value[$key], $ has_wide_space);464 $this->recursionTrim($value[$key], $convert); 491 465 } 492 466 } else { … … 508 482 * @return array 検索結果引き継ぎ用の連想配列. 509 483 */ 510 function getSearchArray($prefix = 'search_') 511 { 484 function getSearchArray($prefix = 'search_') { 512 485 $arrResults = array(); 513 486 foreach ($this->keyname as $key) { … … 525 498 * @deprecated 2.12.0 必要ならば getFormParamList メソッドに引数を追加するなどで実現可能 526 499 */ 527 function getFormDispArray() 528 { 500 function getFormDispArray() { 529 501 $formDispArray = array(); 530 502 foreach ($this->keyname as $index => $key) { … … 546 518 * カスタマイズおよびプラグインで使用されるのを想定 547 519 */ 548 function removeParam($keyname) 549 { 520 function removeParam($keyname) { 550 521 $index = array_search($keyname, $this->keyname); 551 522 … … 590 561 * @param mixed $value 指定した内容に上書きする 591 562 */ 592 function overwriteParam($keyname, $target, $value) 593 { 563 function overwriteParam($keyname, $target, $value) { 594 564 $index = array_search($keyname, $this->keyname); 595 565
Note: See TracChangeset
for help on using the changeset viewer.
