if( $module_admin ){ $xoopsOption['template_main'] = $mydirname.'_admin_submit.html' ; } else { $xoopsOption['template_main'] = $mydirname.'_main_submit.html' ; } // 管理者以外の投稿フォーム説明文を取得 $message = d3download_submit_message( $mydirname, $cid ) ; $formtitle = _MD_D3DOWNLOADS_SUBMIT_EDIT ; // GET LID FROM $_GET $id = isset( $_GET['lid'] ) ? intval( $_GET['lid'] ) : 0 ; // 編集可能なカテゴリリストのみ取得 if( $module_admin ) $category = d3download_categories_selbox( $mydirname, $whr_cat4edit ); else $category = d3download_categories_selbox( $mydirname, $whr_cat4edit, $cid ); // 利用可能な OS/ソフト等のリストを取得 $submit_download = new submit_download( $mydirname ) ; $select_platform = $submit_download->Select_Platform() ; // ライセンスのリストを取得 $select_license = $submit_download->Select_License() ; // スクリーンショット画像の取得 $canuseshots = $submit_download->can_useshots() ; $usealbum = $submit_download->can_albumselect() ; if( ! empty( $canuseshots ) ){ $shots_dir = d3download_shots_dir( $mydirname, $cid ); $img_ar = $submit_download->shots_img_ar( $cid, $shots_dir ); if( empty( $usealbum ) ) $shots_help = sprintf( _MD_D3DOWNLOADS_SUBMIT_LOGOURL_DESC , $shots_dir );
$category4assin = d3download_categories_selbox( $mydirname, '', 0, 1, 1 ) ; $user_access = new user_access( $mydirname ) ; if( ! empty( $_POST['category_select'] ) ) $cid = intval( $_POST['category_select'] ); elseif( ! empty( $_GET['cid'] ) ) $cid = intval( $_GET['cid'] ); else $cid = $user_access->get_top_weightid( 1 ) ; // GET CATEGORY TITLE $mycategory = new MyCategory( $mydirname, 'Show', $cid ) ; $title = $mycategory->return_title() ; $formtitle = ( $title ) ? sprintf( _MD_D3DOWNLOADS_H2USERACCESS , $title ) : _MD_D3DOWNLOADS_NEWCID_USERACCESS ; $parentid = $mycategory->return_pid() ; $maincid = ( $parentid != 0 ) ? $mycategory->get_my_maincid( $cid ) : 0 ; $category_tree = ( $parentid != 0 ) ? d3download_category_tree( $mydirname, $cid, 'index.php?page=user_access' ) : '' ; $copyselect = d3download_categories_selbox( $mydirname, '', 0, 0, 1, '----' , 1, $cid ) ; $categorycount = count( $copyselect ) ; // GROUP FORM $group_trs = ( $categorycount > 1 ) ? $user_access->get_group_form( $cid, $parentid, 0, 1 ) : $user_access->get_group_form( $cid, $parentid ) ; // USER FORM $user_trs = ( $categorycount > 1 ) ? $user_access->get_user_form( $cid, $parentid, 0, 1 ) : $user_access->get_user_form( $cid, $parentid ) ; // NEW USER FORM if( $categorycount > 1 && $parentid == 0 ) $newuser_trs = $user_access->get_newuser_form( $cid, 1 ) ; elseif( $parentid == 0 ) $newuser_trs = $user_access->get_newuser_form( $cid ) ; else $newuser_trs = '' ; // TRANSACTION PART if( isset( $_POST['group_update'] ) ){
$xoops_uname = $xoopsUser->getVar('uname') ; $xoops_isadmin = $xoopsUserIsAdmin ; } else { $xoops_isuser = false ; $xoops_userid = 0 ; $xoops_uname = '' ; $xoops_isadmin = false ; } $unapproval = new unapproval_download( $mydirname ) ; // GET REQUESTID FROM $_GET $requestid = isset( $_GET['requestid'] ) ? intval( $_GET['requestid'] ) : ""; // CATEGORY LIST $category = d3download_categories_selbox( $mydirname, '', 0, 0, 1 ) ; // GET PLATFORM LIST $select_platform = $unapproval->Select_Platform() ; // GET LICENSE LIST $select_license = $unapproval->Select_License() ; $formtitle = _MD_D3DOWNLOADS_SUBMIT_APPROVAL ; // GET UNAPROVALDATA $mod_url = XOOPS_URL.'/modules/'.$mydirname ; $downdata = $unapproval->get_unapprovaldata( $requestid, $category ); // 存在しない aprovalid の場合リダイレクト if( empty( $downdata ) ) {
$error_message = implode( '<br />' , $message ) ; } if( empty( $iserror ) ) { foreach( $_POST['action_selects'] as $id => $value ) { if( empty( $value ) ) continue ; $lid = intval( $id ) ; // 「投稿をユーザーの投稿数に反映」が有効な場合、投稿数に反映 d3download_delete_lid( $mydirname ,$lid ); } redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=filemanager&cid=$category_select" , 2 , _MD_D3DOWNLOADS_DELETED ) ; exit() ; } } // MOVE $moveselect = d3download_categories_selbox( $mydirname, '', 0, 0, 1, '----' , 0, $category_select ) ; if( ! empty( $_POST['move'] ) ) { if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) { redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors()); } $cid = intval( @$_POST['move_select'] ) ; if( empty( $_POST['action_selects'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_FILSE ; if( empty( $cid ) ) $message[] = _MD_D3DOWNLOADS_NO_MOVEED ; if( ! empty( $message ) ){ $iserror = 1 ; $error_message = implode( '<br />' , $message ) ; } if( empty( $iserror ) ) { $errors = d3download_file_manager_move_action( $mydirname, $cid ) ; d3download_delete_cache_of_categories( $mydirname ) ;
// 閲覧可能な登録データを取得 if( empty( $cid ) && empty( $mypost ) ){ $limit = $xoopsModuleConfig['newdownloads'] ; $download4assign = $mydownload->get_downdata_for_topview( $whr_cat4read, $limit ) ; } else { $download4assign = $mydownload->get_downdata_for_catview( $cid, $whr_cat4read, $orderby, $select_perpage, $current_start, $submitter, $mypost, $intree ) ; } $lang_directcatsel = _MD_D3DOWNLOADS_SEL_CATEGORY; // スクリーンショット画像を使用するかどうか $canuseshots = ! empty( $xoopsModuleConfig['useshots'] ) ? 1 : 0 ; // 投稿可能なカテゴリリストのみ取得 $category4post = d3download_categories_selbox( $mydirname, $whr_cat4post ) ; if( ! empty( $_POST['file_post'] ) && ! empty( $_POST['category_select'] ) ) { $post_cid = intval( $_POST['category_select']) ; redirect_header( XOOPS_URL."/modules/$mydirname/index.php?page=submit&cid=$post_cid", 2, _MD_D3DOWNLOADS_REDIRECT_NEWSUBMIT ) ; exit ; } if( ! empty( $_POST['cat_edit'] ) && ! empty( $_POST['category_select'] ) ) { $edit_cid = intval( $_POST['category_select'] ) ; redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categoryedit&cid=$edit_cid", 2, _MD_D3DOWNLOADS_REDIRECT_NEWSUBMIT ) ; exit ; } $xoops_module_header = d3download_dbmoduleheader( $mydirname ) ; $xoopsTpl->assign( 'xoops_module_header', $xoops_module_header . "\n" . $xoopsTpl->get_template_vars('xoops_module_header' ) ) ;