/** * Same as previous except it's for the admin part of the plugin * * @uses buddydrive_admin_edit_files_loop() to list the files * @return string more files if there are any */ function buddydrive_admin_ajax_loadmore() { $folder_id = !empty($_POST['folder']) ? intval($_POST['folder']) : -1; $paged = !empty($_POST['page']) ? intval($_POST['page']) : -1; ob_start(); buddydrive_admin_edit_files_loop($folder_id, $paged); $result = ob_get_contents(); ob_end_clean(); echo $result; die; }
/** * List the files of a folder in a metabox * * @param object $item BuddyDrive Item object * @uses buddydrive_get_folder_post_type() to check for the BuddyFolder post type * @uses buddydrive_admin_edit_files_loop() to list the attached files */ function buddydrive_admin_edit_metabox_list_files($item) { $is_folder = $item->post_type == buddydrive_get_folder_post_type() ? true : false; ?> <?php if (!empty($is_folder)) { ?> <div class="buddydrive-children-section" id="buddydrive-children-section-files"> <label for="buddydrive-list-files"></label> <div class="alignleft actions"> <select name="action2"> <option value="-1" selected="selected"><?php _e('Bulk Actions', 'buddydrive'); ?> </option> <option value="delete"><?php _e('Delete', 'buddydrive'); ?> </option> </select> <input type="submit" name="" id="doaction" class="button action" value="Apply"> </div> <table class="widefat" id="buddydrive-admin-files" data-folder="<?php echo $item->ID; ?> "> <thead> <tr><th colspan="2"><?php _e('Name', 'buddydrive'); ?> </th><th><?php _e('Mime type', 'buddydrive'); ?> </th><th><?php _e('Last Edit', 'buddydrive'); ?> </th></tr> </thead> <tbody> <?php buddydrive_admin_edit_files_loop($item->ID); ?> </tbody> </table> </div> <?php } else { ?> <div class="buddydrive-children-section" id="buddydrive-children-section-files"> <?php _e('The item displayed is a file, the list of files is only available for a folder', 'buddydrive'); ?> </div> <?php } ?> <?php }