function d3download_file_upload( $mydirname, $upload_arr, $maxsize, $id, $uid ) { // 環境チェック $config_error = "" ; $config_error = d3download_upload_config_check( $mydirname ); if( ! empty( $config_error ) ){ redirect_header( XOOPS_URL."/modules/$mydirname/" , 10 , $config_error ) ; exit(); } for( $loop = 0 ; $loop <= 1 ; $loop++ ) { $name = $upload_arr['name'][$loop] ; $tmp_name = $upload_arr['tmp_name'][$loop] ; $error = $upload_arr['error'][$loop] ; if( ! empty( $name ) ){ $result[] = d3download_upload_execution( $mydirname, $name, $tmp_name, $error, $maxsize, $id, $uid, $loop ) ; } else { $result[] = array( 'url' => '' , 'file_name' => '', 'ext' => '' , 'size' => '' , 'error' => '' , ) ; } } return $result ; }
$breadcrumbs[] = array( 'name' => $formtitle.':'.$title4assign ) ; // 管理者の投稿フォーム用に HISTORY DATA を取得 $history = new history_download( $mydirname ) ; $history4assign = $history->get_history_list( $lid ); // 同一リンクの再登録を認めるかどうか $check_url = ! empty( $xoopsModuleConfig['check_url'] ) ? 1 : 0 ; // maxfilesize(テンプレートへのアサイン用) $upload_max_filesize = d3download_get_maxsize( $mydirname ); $max_submit_size = sprintf( _MD_D3DOWNLOADS_SUBMIT_MAXFILESIZE , number_format( $upload_max_filesize ) ) ; $submit_extension = d3download_get_allowed_extension( $mydirname ); // 環境チェックし error の場合はアップロードフォームを選択できないようにする $config_error = d3download_upload_config_check( $mydirname ); // LiveValidationによるValidationをアサイン require_once dirname( dirname(__FILE__) ).'/include/upload_submit_rules.inc.php' ; $liveValidator=""; $liveform = new My_MassValidatePHP( 'makedownloadform', $_POST ); $liveformrules = $formRules['makedownloadform'] ; if( ! empty( $canupload ) && empty( $config_error ) ) $liveformrules = array_merge( $liveformrules , $formRules['fileupload'] ) ; if( ! empty( $select_license ) ) $liveformrules = array_merge( $liveformrules , $formRules['license'] ) ; $liveform->addRules( $liveformrules ); $liveValidator = $liveform ->generateAll(); $xoopsTpl->assign( 'liveValidator', $liveValidator ); // TRANSACTION PART