<?php
add_action( 'add_meta_boxes', 'wpas_add_attachment_widget' );
/**
 * Register the metabox
 */
function wpas_add_attachment_widget() {
	add_meta_box( 'wpas_ticket_attachments', __('Attachments', 'wpas'), 'wpas_ticket_attachments', wpas_get_slug(), 'normal', 'default' );
}

function wpas_ticket_attachments() {
	global $post;
	
	if( ($attachments = get_post_meta( $post->ID, WPAS_PREFIX.'attachments', true )) == '' || !is_array($attachments) ) {
		_e('No attachments.', 'wpas');
		return;
	} ?>

	<div class="wpas_attachements wpas_attachementstop">
		<ul>
			<?php wpas_get_uploaded_files( $post->ID ); ?>
		</ul>
	</div>		
<?php }