/**
 * Loads the css and javascript when on Friends/Group BuddyDrive
 *
 * @uses bp_is_current_component()  to check for BuddyDrive component
 * @uses buddydrive_is_group() to include the group case
 * @uses wp_enqueue_style() to load BuddyDrive style
 * @uses wp_enqueue_script() to load BuddyDrive script
 * @uses buddydrive_get_includes_url() to get the includes url
 * @uses wp_localize_script() to add some translation to js messages/output
 * @uses buddydrive_get_js_l10n() to get the translation
 * @uses buddydrive_is_user_buddydrive() to check we're not on loggedin user's BuddyDrive
 */
function buddydrive_file_enqueue_scripts()
{
    if (bp_is_current_component('buddydrive') || buddydrive_is_group()) {
        $budddrive_css = apply_filters('buddydrive_global_css', array('stylesheet_uri' => buddydrive_get_includes_url() . 'css/buddydrive.css', 'deps' => array('dashicons')));
        // style is for every BuddyDrive screens
        wp_enqueue_style('buddydrive', $budddrive_css['stylesheet_uri'], $budddrive_css['deps'], buddydrive_get_version());
        // in group and friends BuddyDrive, loads a specific script
        if (!buddydrive_is_user_buddydrive()) {
            wp_enqueue_script('buddydrive-view', buddydrive_get_includes_url() . 'js/buddydrive-view.js', array('jquery'), buddydrive_get_version(), true);
            wp_localize_script('buddydrive-view', 'buddydrive_view', buddydrive_get_js_l10n());
        }
    }
}
/**
 * Outputs the BuddyDrive user's toolbar & sort selectbox.
 */
function buddydrive_item_nav()
{
    ?>
	<form action="" method="get" id="buddydrive-form-filter">
		<nav id="buddydrive-item-nav">
			<ul>

				<?php 
    do_action('buddydrive_member_before_toolbar');
    ?>

				<?php 
    if (buddydrive_is_user_buddydrive()) {
        ?>

					<li id="buddydrive-action-new-file">
						<a href="#" id="buddy-new-file" title="<?php 
        _e('New File', 'buddydrive');
        ?>
"><i class="icon bd-icon-newfile"></i></a>
					</li>
					<li id="buddydrive-action-new-folder">
						<a href="#" id="buddy-new-folder" title="<?php 
        _e('New Folder', 'buddydrive');
        ?>
"><i class="icon bd-icon-newfolder"></i></a>
					</li>
					<li id="buddydrive-action-edit-item">
						<a href="#" id="buddy-edit-item" title="<?php 
        _e('Edit Item', 'buddydrive');
        ?>
"><i class="icon bd-icon-edit"></i></a>
					</li>
					<li id="buddydrive-action-delete-item">
						<a href="#" id="buddy-delete-item" title="<?php 
        _e('Delete Item(s)', 'buddydrive');
        ?>
"><i class="icon bd-icon-delete"></i></a>
					</li>
					<li id="buddydrive-action-analytics">
						<a><i class="icon bd-icon-analytics"></i> <?php 
        buddydrive_user_used_quota();
        ?>
</a>
					</li>

				<?php 
    }
    ?>

				<?php 
    do_action('buddydrive_member_after_toolbar');
    ?>

				<li class="last"><?php 
    esc_html_e('Order by:', 'buddydrive');
    ?>
					<select name="buddydrive_filter" id="buddydrive-filter">
						<option value="title"><?php 
    esc_html_e('Name', 'buddydrive');
    ?>
</option>
						<option value="modified"><?php 
    esc_html_e('Last edit', 'buddydrive');
    ?>
</option>
					</select>
				</li>

			</ul>
		</nav>
	</form>
	<?php 
}
function buddydrive_user_files_content()
{
    ?>
	<div id="buddydrive-forms">
		<div class="buddydrive-crumbs"><a href="<?php 
    esc_url(buddydrive_component_home_url());
    ?>
" name="home" id="buddydrive-home"><i class="icon bd-icon-root"></i> <span id="folder-0" class="buddytree current"><?php 
    esc_html_e('Root folder', 'buddydrive');
    ?>
</span></a></div>

		<?php 
    if (buddydrive_is_user_buddydrive()) {
        ?>

			<div id="buddydrive-file-uploader" class="hide">
				<?php 
        buddydrive_upload_form();
        ?>
			</div>
			<div id="buddydrive-folder-editor" class="hide">
				<?php 
        buddydrive_folder_form();
        ?>
			</div>
			<div id="buddydrive-edit-item" class="hide"></div>

		<?php 
    }
    ?>

	</div>

	<?php 
    do_action('buddydrive_after_member_upload_form');
    ?>
	<?php 
    do_action('buddydrive_before_member_body');
    ?>

	<div class="buddydrive single-member" role="main">
		<?php 
    bp_get_template_part('buddydrive-loop');
    ?>
	</div><!-- .buddydrive.single-member -->

	<?php 
    do_action('buddydrive_after_member_body');
}