/**
     * Display the Planner files
     * @static
     * @param $planner_id
     * @since 1.0
     */
    public static function display_files($planner_id)
    {
        global $post_planner_files_mb, $post;
        $post_planner_files_mb->the_meta($planner_id);
        echo '<div class="post-planner-box">';
        do_action('post_planner_before_files');
        if ($post_planner_files_mb->have_value('post-planner-files')) {
            echo apply_filters('post_planner_files_description', '<p class="description">' . esc_html__('Organize the files in the order you want them to appear by dragging and dropping the items.', 'post-planner') . '<br />' . __('Use the Insert button to add only that specific file. Use Insert List to add a list of all the files.', 'post-planner') . '</p>');
            ?>

			<ul class="post-planner-sortable files">
				<?php 
            while ($post_planner_files_mb->have_fields('post-planner-files')) {
                ?>

					<?php 
                if ($post_planner_files_mb->have_value('file')) {
                    $attachment_id = PostPlanner_Lib::get_attachment_id_from_src($post_planner_files_mb->get_the_value('file'));
                    $inserted = PostPlanner_Lib::is_attached($attachment_id, $post->ID) ? ' inserted' : '';
                    ?>

						<li class="ui-state-default<?php 
                    echo $inserted;
                    ?>
" id="<?php 
                    echo absint($attachment_id);
                    ?>
">
							<?php 
                    $icon = PostPlanner_Lib::get_attachment_icon($attachment_id);
                    ?>
							<img src="<?php 
                    echo POSTPLANNER_PLUGIN_URL;
                    ?>
/css/images/<?php 
                    echo $icon;
                    ?>
" alt="" />
							<a href="<?php 
                    esc_url($post_planner_files_mb->the_value('file'));
                    ?>
" class="file-info"><?php 
                    sanitize_text_field($post_planner_files_mb->the_value('title'));
                    ?>
</a>
							<input type="button" class="button-secondary planner-insert-file" value="<?php 
                    esc_attr_e('Insert', 'post-planner');
                    ?>
"/>
						</li>

					<?php 
                }
                ?>

				<?php 
            }
            ?>
			</ul>

			<input type="button" class="button-secondary" id="planner-insert-file-list" value="<?php 
            echo apply_filters('post_planner_insert_files', esc_attr__('Insert File List', 'post-planner'));
            ?>
"/>

		<?php 
        } else {
            echo '<p>' . apply_filters('post_planner_no_files', esc_html__('No files found', 'post-planner')) . '</p>';
        }
        do_action('post_planner_after_files');
        echo '</div>';
    }