Exemplo n.º 1
0
// DELETE
if( ! empty( $_POST['delete'] ) ) {
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());
	}
	if( empty( $_POST['action_selects'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_CATEGORY ;
	if( ! empty( $message ) ){
		$iserror = 1 ;
		$error_message = implode( '<br />' , $message ) ;
	}
	if( empty( $iserror ) ) {
		foreach( $_POST['action_selects'] as $id => $value ) {
			$cid = intval( $id ) ;
			d3download_delcat( $mydirname , $cid  );
			$mycategory->serialize_insertdb() ;
			$mycategory->category_tree_check() ;
			$user_access->my_user_access_check() ;
		}
		redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categorymanager&amp;perpage=$select_perpage" , 2 , _MD_D3DOWNLOADS_DELETED ) ;
		exit() ;
	}
}

// TOP MOVE
if( ! empty( $_POST['category_top_move'] ) ) {
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());
	}
	if( empty( $_POST['action_selects'] ) ) $message[] = _MD_D3DOWNLOADS_ERROR_SEL_CATEGORY ;
	if( ! empty( $message ) ){
		$iserror = 1 ;
Exemplo n.º 2
0
		}
		if( empty( $edit_id ) ) $edit_id = $new_cid ;
		if( $old_pid != 0  && $pid == 0 ){
			// SET DEFAULT USER ACCESS
			$my_maincid= $category_edit->get_my_maincid( $old_pid ) ;
			$error = $category_edit->my_user_access_copy( $my_maincid, $edit_id, 1 ) ;
		} elseif( $old_pid == 0 ){
			// GROUP UPDATE
			$error = $user_access->group_update( $edit_id, $pid ) ;
			// USER UPDATE
			$error = $user_access->user_update( $edit_id, $pid ) ;
		} else {
			$category_edit->date_save_cat_table( $edit_id ) ;
		}
		$category_edit->serialize_insertdb() ;
		$category_edit->category_tree_check() ;
		$user_access->my_user_access_check() ;
		d3download_delete_cache_of_categories( $mydirname ) ;
		if( ! empty( $_POST['categoryform_post'] ) ) {
			redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categorymanager" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_REGSTERED ) ;
		} else {
			redirect_header( XOOPS_URL."/modules/$mydirname/admin/index.php?page=categoryedit&amp;cid=$edit_id" , 2 , $error ? sprintf( _MD_D3DOWNLOADS_ERROR_MESSEAGE , $error ) : _MD_D3DOWNLOADS_REGSTERED ) ;
		}
		exit();
	}
}

// DELETE SQL
if( isset( $_POST['categoryform_delete'] ) ) {
	if ( ! $xoopsGTicket->check( true , 'd3downloads' ) ) {
		redirect_header(XOOPS_URL.'/modules/'.$mydirname.'/admin/index.php',3,$xoopsGTicket->getErrors());