Changeset 22567 for branches/version-2_12-dev/data/class/SC_UploadFile.php
- Timestamp:
- 2013/02/18 19:09:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_UploadFile.php
r22206 r22567 23 23 24 24 /* アップロードファイル管理クラス */ 25 class SC_UploadFile { 25 class SC_UploadFile 26 { 26 27 var $temp_dir; 27 28 var $save_dir; … … 58 59 59 60 // ファイル管理クラス 60 function __construct($temp_dir, $save_dir) { 61 function __construct($temp_dir, $save_dir) 62 { 61 63 $this->temp_dir = rtrim($temp_dir, '/') . '/'; 62 64 $this->save_dir = rtrim($save_dir, '/') . '/'; … … 65 67 66 68 // ファイル情報追加 67 function addFile($disp_name, $keyname, $arrExt, $size, $necessary=false, $width=0, $height=0, $image=true) { 69 function addFile($disp_name, $keyname, $arrExt, $size, $necessary=false, $width=0, $height=0, $image=true) 70 { 68 71 $this->disp_name[] = $disp_name; 69 72 $this->keyname[] = $keyname; … … 76 79 } 77 80 // サムネイル画像の作成 78 function makeThumb($src_file, $width, $height, $dst_file) { 81 function makeThumb($src_file, $width, $height, $dst_file) 82 { 79 83 $objThumb = new gdthumb(); 80 84 $ret = $objThumb->Main($src_file, $width, $height, $dst_file); … … 90 94 91 95 // アップロードされたファイルを保存する。 92 function makeTempFile($keyname, $rename = IMAGE_RENAME) { 96 function makeTempFile($keyname, $rename = IMAGE_RENAME) 97 { 93 98 $objErr = new SC_CheckError_Ex(); 94 99 $cnt = 0; … … 137 142 138 143 // アップロードされたダウンロードファイルを保存する。 139 function makeTempDownFile($keyname='down_file') { 144 function makeTempDownFile($keyname='down_file') 145 { 140 146 $objErr = new SC_CheckError_Ex(); 141 147 $cnt = 0; … … 168 174 169 175 // 画像を削除する。 170 function deleteFile($keyname) { 176 function deleteFile($keyname) 177 { 171 178 $objImage = new SC_Image_Ex($this->temp_dir); 172 179 $cnt = 0; … … 185 192 186 193 // 画像を削除する。 187 function deleteKikakuFile($keyname) { 194 function deleteKikakuFile($keyname) 195 { 188 196 $objImage = new SC_Image_Ex($this->temp_dir); 189 197 $cnt = 0; … … 202 210 203 211 // 一時ファイルパスを取得する。 204 function getTempFilePath($keyname) { 212 function getTempFilePath($keyname) 213 { 205 214 $cnt = 0; 206 215 $filepath = ''; … … 217 226 218 227 // 一時ファイルを保存ディレクトリに移す 219 function moveTempFile() { 228 function moveTempFile() 229 { 220 230 $objImage = new SC_Image_Ex($this->temp_dir); 221 231 … … 238 248 239 249 // ダウンロード一時ファイルを保存ディレクトリに移す 240 function moveTempDownFile() { 250 function moveTempDownFile() 251 { 241 252 $objImage = new SC_Image_Ex($this->temp_dir); 242 253 for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { … … 255 266 256 267 // HIDDEN用のファイル名配列を返す 257 function getHiddenFileList() { 268 function getHiddenFileList() 269 { 258 270 $cnt = 0; 259 271 $arrRet = array(); … … 271 283 272 284 // HIDDENで送られてきたファイル名を取得する 273 function setHiddenFileList($arrPOST) { 285 function setHiddenFileList($arrPOST) 286 { 274 287 $cnt = 0; 275 288 foreach ($this->keyname as $val) { … … 286 299 } 287 300 288 function setHiddenKikakuFileList($arrPOST) { 301 function setHiddenKikakuFileList($arrPOST) 302 { 289 303 $cnt = 0; 290 304 foreach ($this->keyname as $val) { … … 302 316 303 317 // フォームに渡す用のファイル情報配列を返す 304 function getFormFileList($temp_url, $save_url, $real_size = false) { 318 function getFormFileList($temp_url, $save_url, $real_size = false) 319 { 305 320 $arrRet = array(); 306 321 $cnt = 0; … … 341 356 342 357 // フォームに渡す用のダウンロードファイル情報を返す 343 function getFormDownFile() { 358 function getFormDownFile() 359 { 344 360 $arrRet = ''; 345 361 for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { … … 352 368 return $arrRet; 353 369 } 354 function getFormKikakuDownFile() { 370 function getFormKikakuDownFile() 371 { 355 372 $arrRet = array(); 356 373 $cnt = 0; … … 367 384 368 385 // DB保存用のファイル名配列を返す 369 function getDBFileList() { 386 function getDBFileList() 387 { 370 388 $cnt = 0; 371 389 $dbFileList = array(); … … 382 400 383 401 // DBで保存されたファイル名配列をセットする 384 function setDBFileList($arrVal) { 402 function setDBFileList($arrVal) 403 { 385 404 $cnt = 0; 386 405 foreach ($this->keyname as $val) { … … 393 412 394 413 // DBで保存されたダウンロードファイル名をセットする 395 function setDBDownFile($arrVal) { 414 function setDBDownFile($arrVal) 415 { 396 416 if (isset($arrVal['down_realfilename']) && $arrVal['down_realfilename'] != '') { 397 417 $this->save_file[0] = $arrVal['down_realfilename']; … … 400 420 401 421 // DBで保存されたダウンロードファイル名をセットする(setDBDownFileと統合予定) 402 function setPostFileList($arrPost) { 422 function setPostFileList($arrPost) 423 { 403 424 for ($cnt = 0;$cnt < count($this->keyname); $cnt++) { 404 425 if (isset($arrPost['temp_down_realfilename:' . ($cnt+1)])) { … … 409 430 410 431 // 画像をセットする 411 function setDBImageList($arrVal) { 432 function setDBImageList($arrVal) 433 { 412 434 $cnt = 0; 413 435 foreach ($this->keyname as $val) { … … 420 442 421 443 // DB上のファイルの内削除要求があったファイルを削除する。 422 function deleteDBFile($arrVal) { 444 function deleteDBFile($arrVal) 445 { 423 446 $objImage = new SC_Image_Ex($this->temp_dir); 424 447 $cnt = 0; … … 434 457 435 458 // DB上のダウンロードファイルの内削除要求があったファイルを削除する。 436 function deleteDBDownFile($arrVal) { 459 function deleteDBDownFile($arrVal) 460 { 437 461 $objImage = new SC_Image_Ex($this->temp_dir); 438 462 $cnt = 0; … … 445 469 446 470 // 必須判定 447 function checkExists($keyname = '') { 471 function checkExists($keyname = '') 472 { 448 473 $cnt = 0; 449 474 $arrRet = array(); … … 467 492 468 493 // 拡大率を指定して画像保存 469 function saveResizeImage($keyname, $to_w, $to_h) { 494 function saveResizeImage($keyname, $to_w, $to_h) 495 { 470 496 $path = ''; 471 497 … … 488 514 * @return string 489 515 */ 490 function lfGetTmpImageName($rename, $keyname = '', $uploadfile = '') { 516 function lfGetTmpImageName($rename, $keyname = '', $uploadfile = '') 517 { 491 518 492 519 if ($rename === true) {
Note: See TracChangeset
for help on using the changeset viewer.
