/**
	 * Returns the table lines for the requested Attachment ID'S (ajax call)
	 * 
	 * @param array $file_ids
	 * @param string $email_subject
	 * @param int $product_id			needed to create unique name, if more products are displayed (e.g. product page)
	 * @param bool $new_attachments
	 * @return string			HTML Code to insert in table on settings page
	 */
	public function &get_attachment_files_info( array $file_ids, $email_subject, $product_id = 0, $new_attachments = false )
	{
		$html = '';
		
		if( empty( $file_ids ) )
			return $html;
		
		$selected_files = $this->wc_email_att->get_attachment_files_info ( $file_ids );
		
		$id = $this->inputfields_param[ $email_subject ]['att_name'];
		$wpml_lang = isset( $this->options[ $this->inputfields_param[ $email_subject ]['att_wpml_id'] ] ) ? $this->options[ $this->inputfields_param[ $email_subject ]['att_wpml_id'] ] : array();
		$lang = $new_attachments ? array() :  $wpml_lang;

		if( $product_id != 0 )
		{
			$id = str_replace( '[]', '[' . $product_id . '][]', $id );
			if( ! $new_attachments )
			{		//	load existing language settings
				$pm = get_post_meta( $product_id );
				$lang = isset( $pm[ $this->inputfields_param[ $email_subject ]['att_wpml_id'] ]) ? $this->inputfields_param[ $email_subject ]['att_wpml_id'] : array();
			}
		}
		
		$columns = array(
				'thumb' => __( 'Thumb', WC_Email_Att::TEXT_DOMAIN ),
				'name' => __( 'Name', WC_Email_Att::TEXT_DOMAIN ),
			);
		$columns = apply_filters( 'wc_eatt_wpml_column', $columns );
		
		$columns['id'] = __( 'ID', WC_Email_Att::TEXT_DOMAIN );
		$columns['path'] = __( 'Location', WC_Email_Att::TEXT_DOMAIN );
		$columns['button_remove'] = '';
		
		$element = array(
				'type'				=> WC_Addons_Email_Att::FILE_MEDIA,
				'button_remove'		=> __( 'Remove', WC_Email_Att::TEXT_DOMAIN ),
				'button_remove_tip' => __( 'Removes this file from the list of attachments for this email, but does not delete the file. You can reuse it later at any time.', WC_Email_Att::TEXT_DOMAIN ),
				'info'				=> __( 'Selected files:', WC_Email_Att::TEXT_DOMAIN ),
				'columns'			=> $columns,
				'js_prefix'			=> ($product_id == 0) ? self::PREFIX_JS_NAMES : self::PREFIX_JS_NAMES_PROD,
				'id'				=> $id,
				'std'				=> $selected_files,
				'attachment_infos'	=> $this->wc_email_att->attachment_infos,
				'language_name'		=> $this->inputfields_param[ $email_subject ]['att_wpml_name'],
				'language'			=> $lang,
				'subject'			=> $email_subject,
				'rows_only'			=> true,
				'wc_settings_page'	=> true,
				'product_id'		=> $product_id
			);
		
			ob_start();
			do_action( 'woocommerce_admin_field_' . WC_Addons_Email_Att::FILE_MEDIA, $element );
			$buffer = ob_get_contents();
			ob_clean();
			
			return $buffer;
	}