Пример #1
0
<?php

if (empty($_POST['createdid'])) {
    ?>

	<tr id="item-<?php 
    buddydrive_item_id();
    ?>
">

<?php 
}
?>

		<td>
			<?php 
buddydrive_owner_or_cb();
?>
		</td>
		<td>
			<div class="buddydrive-file-content"><?php 
buddydrive_item_icon();
?>
&nbsp;<a href="<?php 
buddydrive_action_link();
?>
" class="<?php 
buddydrive_action_link_class();
?>
" title="<?php 
esc_attr(buddydrive_item_title());
Пример #2
0
    function course_drive()
    {
        ?>
		<form action="" method="get" id="buddydrive-form-filter">
			<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
				<ul>

					<?php 
        do_action('buddydrive_member_before_toolbar');
        ?>
						<li class="current">
							<a href="<?php 
        esc_url(buddydrive_component_home_url());
        ?>
" name="home" id="buddydrive-home" data-project="<?php 
        echo esc_attr($post->id);
        ?>
"><?php 
        _e('All Files', 'buddydrive');
        ?>
</a>
						</li>
						<li id="buddydrive-action-new-file">
							<a href="#" id="buddy-new-file" title="<?php 
        _e('New File', 'buddydrive');
        ?>
"><?php 
        _e('New File', 'buddydrive');
        ?>
</a>
						</li>
						<!--li id="buddydrive-action-new-folder">
							<a href="#" id="buddy-new-folder" title="<?php 
        _e('New Folder', 'buddydrive');
        ?>
"><?php 
        _e('New Folder', 'buddydrive');
        ?>
</a>
						</li-->

					<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>
			</div>	
		</form>

		<div id="buddydrive-forms">

			<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>

		</div>

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


				<div class="buddydrive single-project" role="main"> 
								
				<?php 
        do_action('buddydrive_before_loop');
        ?>

				<?php 
        if (buddydrive_has_items(buddydrive_querystring())) {
            ?>

					<?php 
            if (empty($_POST['page']) && empty($_POST['folder'])) {
                ?>

						<table id="buddydrive-dir" class="user-dir">
							<thead>
								<tr><th><?php 
                buddydrive_th_owner_or_cb();
                ?>
</th><th class="buddydrive-item-name"><?php 
                _e('Name', 'buddydrive');
                ?>
</th><th class="buddydrive-privacy"><?php 
                _e('Privacy', 'buddydrive');
                ?>
</th><th class="buddydrive-mime-type"><?php 
                _e('Type', 'buddydrive');
                ?>
</th><th class="buddydrive-last-edit"><?php 
                _e('Last edit', 'buddydrive');
                ?>
</th></tr>
							</thead>
							<tbody>
					<?php 
            }
            ?>

					<?php 
            while (buddydrive_has_items()) {
                buddydrive_the_item();
                ?>

						<?php 
                if (empty($_POST['createdid'])) {
                    ?>

						<tr id="item-<?php 
                    buddydrive_item_id();
                    ?>
">

						<?php 
                }
                ?>

								<td>
									<?php 
                buddydrive_owner_or_cb();
                ?>
								</td>
								<td>
									<div class="buddydrive-file-content"><?php 
                buddydrive_item_icon();
                ?>
&nbsp;<a href="<?php 
                buddydrive_action_link();
                ?>
" class="<?php 
                buddydrive_action_link_class();
                ?>
" title="<?php 
                esc_attr(buddydrive_item_title());
                ?>
"<?php 
                buddydrive_item_attribute();
                ?>
><?php 
                buddydrive_item_title();
                ?>
</a></div>
									<?php 
                buddydrive_row_actions();
                ?>
								</td>
								<td>
									<?php 
                buddydrive_item_privacy();
                ?>
								</td>
								<td>
									<?php 
                buddydrive_item_mime_type();
                ?>
								</td>
								<td>
									<?php 
                buddydrive_item_date();
                ?>
								</td>

						<?php 
                if (empty($_POST['createdid'])) {
                    ?>

							</tr>

						<?php 
                }
                ?>


					<?php 
            }
            ?>

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

						<tr>
							<td class="buddydrive-load-more" colspan="5">
								<a href="#more-buddydrive"><?php 
                _e('Load More', 'buddydrive');
                ?>
</a>
							</td>
						</tr>

					<?php 
            }
            ?>

					<?php 
            if (empty($_POST['page']) && empty($_POST['folder'])) {
                ?>
							</tbody>
						</table>

					<?php 
            }
            ?>

				<?php 
        } else {
            ?>

					<?php 
            if (empty($_POST['page']) && empty($_POST['folder'])) {
                ?>
						<table id="buddydrive-dir" class="user-dir">
							<thead>
								<tr><th><?php 
                buddydrive_th_owner_or_cb();
                ?>
</th><th class="buddydrive-item-name"><?php 
                _e('Name', 'buddydrive');
                ?>
</th><th class="buddydrive-privacy"><?php 
                _e('Privacy', 'buddydrive');
                ?>
</th><th class="buddydrive-mime-type"><?php 
                _e('Type', 'buddydrive');
                ?>
</th><th class="buddydrive-last-edit"><?php 
                _e('Last edit', 'buddydrive');
                ?>
</th></tr>
							</thead>
							<tbody>
					<?php 
            }
            ?>
							<tr id="no-buddyitems">
								<td colspan="5">
									<div id="message" class="info">
										<p><?php 
            printf(__('Sorry, there was no %s items found.', 'buddydrive'), buddydrive_get_name());
            ?>
</p>
									</div>
								</td>
							</tr>
					<?php 
            if (empty($_POST['page']) && empty($_POST['folder'])) {
                ?>
							</tbody>
						</table>
					<?php 
            }
            ?>
					

				<?php 
        }
        ?>

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

				<?php 
        if (empty($_POST['page']) && empty($_POST['folder'])) {
            ?>

					<form action="" name="buddydrive-loop-form" id="buddydrive-loop-form" method="post">

						<?php 
            wp_nonce_field('buddydrive_actions', '_wpnonce_buddydrive_actions');
            ?>

					</form>
				<?php 
        }
        ?>
			</div>
		<?php 
    }
Пример #3
0
/**
 * Builds an admin BuddyDrive Items loop
 * @param  integer $folder_id the folder id
 * @param  integer $paged     the page to load
 * @uses add_query_args() to add some args to the url
 * @uses bp_get_admin_url() to build the admin url
 * @uses The BuddyDrive loop with some template tags
 * @uses wp_nonce_url() for security reasons
 */
function buddydrive_admin_edit_files_loop($folder_id = 0, $paged = 1)
{
    $form_url = add_query_arg(array('page' => 'buddydrive-files'), bp_get_admin_url('admin.php'));
    if (buddydrive_has_items(array('buddydrive_parent' => $folder_id, 'paged' => $paged))) {
        ?>

		<?php 
        while (buddydrive_has_items()) {
            buddydrive_the_item();
            ?>

			<tr id="item-<?php 
            buddydrive_item_id();
            ?>
">
				<td>
					<input type="checkbox" name="bid[]" class="buddydrive-item-cb" value="<?php 
            esc_attr(buddydrive_item_id());
            ?>
">
				</td>
				<td>
					<?php 
            buddydrive_item_icon();
            ?>
&nbsp;<a href="<?php 
            buddydrive_action_link();
            ?>
" class="<?php 
            buddydrive_action_link_class();
            ?>
" title="<?php 
            esc_attr(buddydrive_item_title());
            ?>
"<?php 
            buddydrive_item_attribute();
            ?>
><?php 
            esc_html(buddydrive_item_title());
            ?>
</a>
					<div class="row-actions">
						<?php 
            $base_url = add_query_arg(array('bid' => buddydrive_get_item_id()), $form_url);
            $edit_url = add_query_arg(array('action' => 'edit'), $base_url);
            $delete_url = wp_nonce_url($base_url . "&amp;action=delete", 'buddydrive-delete');
            ?>
						<span class="edit">
							<a href="<?php 
            echo esc_url($edit_url);
            ?>
"><?php 
            esc_html_e('Edit', 'buddydrive');
            ?>
</a> |
						</span>
						<span class="delete">
							<a href="<?php 
            echo esc_url($delete_url);
            ?>
"><?php 
            esc_html_e('Delete', 'buddydrive');
            ?>
</a>
						</span>
					</div>
				</td>
				<td>
					<?php 
            buddydrive_item_mime_type();
            ?>
				</td>
				<td>
					<?php 
            buddydrive_item_date();
            ?>
				</td>
			</tr>

		<?php 
        }
        ?>

		<?php 
        if (buddydrive_has_more_items()) {
            ?>
			<tr>
				<td class="buddydrive-load-more" colspan="4">
					<a href="#more-buddydrive"><?php 
            _e('Load More', 'buddydrive');
            ?>
</a>
				</td>
			</tr>
		<?php 
        }
        ?>

	<?php 
    } else {
        ?>
		<tr><td colspan="4"><?php 
        _e('No files attached to this folder', 'buddydrive');
        ?>
</td></tr>
	<?php 
    }
}