Ejemplo n.º 1
0
/**
 * Get the name of the user locking the current document, if any
 *
 * @package BuddyPress Docs
 * @since 1.0-beta-2
 *
 * @return string $locker_name The full name of the locking user
 */
function bp_docs_get_current_doc_locker_name()
{
    $locker_name = '';
    $locker_id = bp_docs_is_doc_edit_locked();
    if ($locker_id) {
        $locker_name = bp_core_get_user_displayname($locker_id);
    }
    return apply_filters('bp_docs_get_current_doc_locker_name', $locker_name, $locker_id);
}
Ejemplo n.º 2
0
	<?php 
}
?>
    
    <?php 
add_filter('bp_docs_get_create_link', 'bboss_bpd_sg_get_create_link', 99);
?>
	<?php 
include apply_filters('bp_docs_header_template', bp_docs_locate_template('docs-header.php'));
?>
    <?php 
remove_filter('bp_docs_get_create_link', 'bboss_bpd_sg_get_create_link', 99);
?>

	<?php 
if (bp_docs_is_doc_edit_locked() && current_user_can('bp_docs_edit')) {
    ?>
		<div class="toggleable doc-is-locked">
			<span class="toggle-switch" id="toggle-doc-is-locked"><?php 
    _e('Locked', 'bp-docs');
    ?>
 <span class="hide-if-no-js description"><?php 
    _e('(click for more info)', 'bp-docs');
    ?>
</span></span>
			<div class="toggle-content">
				<p><?php 
    printf(__('This doc is currently being edited by %1$s. In order to prevent edit conflicts, only one user can edit a doc at a time.', 'bp-docs'), bp_docs_get_current_doc_locker_name());
    ?>
</p>