本文整理汇总了PHP中bp_is_group_admin_screen函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_group_admin_screen函数的具体用法?PHP bp_is_group_admin_screen怎么用?PHP bp_is_group_admin_screen使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_group_admin_screen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit_screen
function edit_screen()
{
global $bp;
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
?>
<p class="desc"><?php
_e("Enter RSS feed URL's for blogs you would like to attach to this group. Any future posts on these blogs will show on the group activity stream. Seperate URL's with commas.", 'bp-groups-externalblogs');
?>
</span>
<p>
<label for="blogfeeds"><?php
_e("Feed URL's:", 'bp-groups-externalblogs');
?>
</label>
<textarea name="blogfeeds" id="blogfeeds"><?php
echo attribute_escape(implode(', ', (array) groups_get_groupmeta($bp->groups->current_group->id, 'blogfeeds')));
?>
</textarea>
</p>
<input type="submit" name="save" value="<?php
_e("Update Feed URL's", 'bp-groups-externalblogs');
?>
" />
<?php
wp_nonce_field('groups_edit_save_' . $this->slug);
}
示例2: edit_screen
function edit_screen()
{
global $bp;
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
?>
<h2><?php
echo esc_attr($this->name);
?>
<?php
_e('settings for this group.', 'bp-checkins');
?>
</h2>
<p>
<input type="checkbox" name="_group_checkins_activate" value="1" <?php
if (groups_get_groupmeta($bp->groups->current_group->id, 'checkins_ok')) {
?>
checked="checked"<?php
}
?>
> <?php
_e('Activate checkins & places for this group', 'bp-checkins');
?>
</p>
<input type="submit" name="save" value="<?php
_e('Save', 'bp-checkins');
?>
" />
<?php
wp_nonce_field('groups_edit_save_' . $this->slug);
}
示例3: edit_screen
function edit_screen()
{
global $bp;
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
// Attaching the markup via a hook, so that plugins can unhook and replace with
// their own markup. This is a bit of a hack.
add_action('bp_groupblog_edit_screen_markup', 'bp_groupblog_signup_blog');
do_action('bp_groupblog_edit_screen_markup');
}
示例4: cfbgr_is_restriction_js
/**
* Load the js only when needed
*
* @return bool
*/
function cfbgr_is_restriction_js()
{
// Group create
if (bp_is_group_create() && bp_is_group_creation_step('group-settings')) {
return true;
}
// Group manage
if (bp_is_group() && bp_is_group_admin_screen('group-settings')) {
return true;
}
return false;
}
示例5: bp_group_documents_group_admin_menu
/**
* bp_group_documents_group_mod_menu()
*
* This function catches the url for the moderators' "group admin" screen.
* It will check for changes via the bp_group_documents_group_admin_save() function,
* and then call the display template.
*/
function bp_group_documents_group_admin_menu()
{
//catch the '/groupname/admin/documents' url
if (bp_is_group_admin_screen('documents')) {
die('and here');
//check if the user is submitting a form, process if neccessary
bp_group_documents_group_admin_save();
//load the display template
if ('' != locate_template(array('groups/single/home.php'), false)) {
bp_core_load_template(apply_filters('groups_template_group_home', 'groups/single/home'));
} else {
add_action('bp_template_content_header', 'bp_group_documents_group_admin_header');
add_action('bp_template_content', 'bp_group_documents_group_admin_edit');
bp_core_load_template(apply_filters('bp_core_template_plugin', '/groups/single/plugins'));
}
}
}
示例6: control
/**
* Check public group's control options and do the needed job
*/
public function control()
{
$bp = buddypress();
if (!$this->is_public_group()) {
return;
}
// Append to current group the control settings
$hidden_tabs = (array) groups_get_groupmeta($this->group->id, '_altctrl_tabs', true);
$this->group->need_request = groups_get_groupmeta($this->group->id, '_altctrl_request', true);
// Managing requests
if (bp_is_group_admin_screen('membership-requests') && bp_is_item_admin()) {
$bp->groups->current_group->status = 'private';
}
// Admin or members always have access
if (bp_is_item_admin() || groups_is_user_member(bp_loggedin_user_id(), $this->group->id)) {
return;
}
/** Group members only tabs ***************************************************/
// Hide tabs
if (!empty($bp->bp_options_nav[$this->group->slug]) && !empty($hidden_tabs)) {
foreach (array_keys($bp->bp_options_nav[$this->group->slug]) as $item_tab) {
if (!in_array($item_tab, $hidden_tabs)) {
continue;
}
$bp->bp_options_nav[$this->group->slug][$item_tab]['user_has_access'] = false;
}
}
// Redirect if trying to access the page
if (!empty($hidden_tabs) && in_array(bp_current_action(), $hidden_tabs)) {
bp_core_add_message(__('This area is restricted to group members', 'altctrl-public-group'), 'error');
bp_core_redirect(bp_get_group_permalink($this->group));
}
/** Joining group *************************************************************/
if (!empty($this->group->need_request) && is_user_logged_in()) {
// first add the request subnav
bp_core_new_subnav_item(array('name' => __('Request Membership', 'altctrl-public-group'), 'slug' => 'request-membership', 'parent_url' => bp_get_group_permalink($this->group), 'parent_slug' => $this->group->slug, 'screen_function' => 'groups_screen_group_request_membership', 'position' => 30));
// Then temporarly make the group private.
if (bp_is_group_membership_request()) {
$bp->groups->current_group->status = 'private';
}
}
}
示例7: edit_screen
public function edit_screen($group_id = null)
{
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
?>
<h2><?php
echo esc_attr($this->name);
?>
</h2>
<?php
bcg_admin_form();
wp_nonce_field('groups_edit_save_' . $this->slug);
?>
<p><input type="submit" value="<?php
_e('Save Changes', 'bcg');
?>
→" id="save" name="save" /></p>
<?php
}
示例8: printf
$tpl .= "<a href=\"%s\">%s</a>";
$tpl .= "</li>";
printf($tpl, $url, $name);
}
?>
</ul>
</div><!-- .item-list-tabs -->
<form action="<?php
bp_group_admin_form_action();
?>
" name="group-settings-form" id="group-settings-form" class="form standard-form" method="post" enctype="multipart/form-data" role="main">
<?php
do_action('bp_before_group_admin_content');
foreach ($admin_menu as $url_key => $name) {
if (bp_is_group_admin_screen($url_key)) {
bp_get_template_part('groups/single/admin/' . $url_key);
break;
}
}
do_action('groups_custom_edit_steps');
// Allow plugins to add custom group edit screens
/* This is important, don't forget it */
printf('<input type="hidden" name="group-id" id="group-id" value="%d" />', bp_get_group_id());
do_action('bp_after_group_admin_content');
?>
</form><!-- #group-settings-form -->
示例9: maybe_map_permalink_to_group
/**
* Maybe map a bbPress forum/topic/reply permalink to the corresponding group
*
* @param int $post_id
* @uses get_post()
* @uses bbp_is_reply()
* @uses bbp_get_reply_topic_id()
* @uses bbp_get_reply_forum_id()
* @uses bbp_is_topic()
* @uses bbp_get_topic_forum_id()
* @uses bbp_is_forum()
* @uses get_post_field()
* @uses bbp_get_forum_group_ids()
* @uses groups_get_group()
* @uses bp_get_group_admin_permalink()
* @uses bp_get_group_permalink()
* @return Bail early if not a group forum post
* @return string
*/
private function maybe_map_permalink_to_group($post_id = 0, $url = false)
{
switch (get_post_type($post_id)) {
// Reply
case bbp_get_reply_post_type():
$topic_id = bbp_get_reply_topic_id($post_id);
$forum_id = bbp_get_reply_forum_id($post_id);
$url_end = trailingslashit($this->reply_slug) . get_post_field('post_name', $post_id);
break;
// Topic
// Topic
case bbp_get_topic_post_type():
$topic_id = $post_id;
$forum_id = bbp_get_topic_forum_id($post_id);
$url_end = trailingslashit($this->topic_slug) . get_post_field('post_name', $post_id);
break;
// Forum
// Forum
case bbp_get_forum_post_type():
$forum_id = $post_id;
$url_end = '';
//get_post_field( 'post_name', $post_id );
break;
// Unknown
// Unknown
default:
return $url;
break;
}
// Get group ID's for this forum
$group_ids = bbp_get_forum_group_ids($forum_id);
// Bail if the post isn't associated with a group
if (empty($group_ids)) {
return $url;
}
// @todo Multiple group forums/forum groups
$group_id = $group_ids[0];
$group = groups_get_group(array('group_id' => $group_id));
if (bp_is_group_admin_screen($this->slug)) {
$group_permalink = trailingslashit(bp_get_group_admin_permalink($group));
} else {
$group_permalink = trailingslashit(bp_get_group_permalink($group));
}
return trailingslashit(trailingslashit($group_permalink . $this->slug) . $url_end);
}
示例10: inject_js
function inject_js()
{
if (bp_is_group_admin_screen($this->slug)) {
wp_enqueue_script('bpcp-js', plugin_dir_url(__FILE__) . 'bpcp.js', array('jquery'));
}
}
示例11: edit_screen
/**
*
* @global type $bp_media
* @return boolean
*/
function edit_screen($group_id = NULL)
{
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
$current_level = groups_get_groupmeta(bp_get_current_group_id(), 'rt_media_group_control_level');
if (empty($current_level)) {
$current_level = "all";
}
// HOOK to add PER GROUP MEDIA enable/diable option in rtMedia PRO
do_action('rtmedia_group_media_control_edit');
?>
<div class='rtmedia-group-media-settings'>
<?php
global $rtmedia;
$options = $rtmedia->options;
if (isset($options['general_enableAlbums']) && $options['general_enableAlbums'] == 1) {
// album is enabled
?>
<h4><?php
_e('Album Creation Control', 'rtmedia');
?>
</h4>
<p><?php
_e('Who can create Albums in this group?', 'rtmedia');
?>
</p>
<div class="radio">
<label>
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="all"<?php
checked($current_level, 'all', true);
?>
>
<strong><?php
_e('All Group Members', 'rtmedia');
?>
</strong>
</label>
<label>
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="moderators" <?php
checked($current_level, 'moderators', true);
?>
>
<strong><?php
_e('Group Admins and Mods only', 'rtmedia');
?>
</strong>
</label>
<label>
<input name="rt_album_creation_control" type="radio" id="rt_media_group_level_admin" value="admin" <?php
checked($current_level, 'admin', true);
?>
>
<strong><?php
_e('Group Admin only', 'rtmedia');
?>
</strong>
</label>
</div>
<hr>
<?php
}
?>
<?php
do_action('rtmedia_playlist_creation_settings_groups_edit');
?>
</div>
<input type="submit" name="save" value="<?php
_e('Save Changes', 'rtmedia');
?>
" />
<?php
wp_nonce_field('groups_edit_save_' . $this->slug);
}
示例12: edit_screen
/**
*
* @since 0.0.1
* @access public
* @static
* @return bool
*/
function edit_screen($group_id = NULL)
{
global $bp;
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
$url = bp_get_root_domain();
$group = groups_get_current_group();
$configstr = base64_encode(json_encode(array('group_id' => $group->id, 'url' => $url)));
?>
<p><label for"configstr"><?php
_e("Config to invite groupmember to blog.", RW_Group_Blogs::$textdomain);
?>
</label>
<input id="configstr" type="text" value="<?php
echo $configstr;
?>
"></p>
<?php
$options = groups_get_groupmeta($group->id, 'rw-group-blogs-blogdata');
$meta = groups_get_groupmeta($bp->groups->current_group->id, 'rw-group-blogs-fetchtime');
$fetch = !empty($meta) ? $meta : '30';
$times = array('10', '15', '20', '30', '60');
echo '<p><label for="fetch-time">';
_e("Refresh time:", RW_Group_Blogs::$textdomain);
echo '</label>';
echo "<select id='fetch-time' name='fetch-time'>";
$default = __('Default', RW_Group_Blogs::$textdomain);
echo "<option value='30'>{$default}</option>";
foreach ($times as $time) {
$selected = $fetch == $time ? 'selected="selected"' : '';
echo "<option value='{$time}' {$selected}>{$time}</option>";
}
echo "</select></p>";
?>
<span
class="desc"><?php
_e("Enter RSS feed URL's for blogs you would like to attach to this group. Any future posts on these blogs will show on the group activity stream. Seperate URL's with commas.", RW_Group_Blogs::$textdomain);
?>
</span>
<p>
<label for="blogfeeds"><?php
_e("Feed URL's:", RW_Group_Blogs::$textdomain);
?>
</label>
<textarea name="blogfeeds"
id="blogfeeds"><?php
echo attribute_escape(implode(', ', (array) groups_get_groupmeta($bp->groups->current_group->id, 'rw-group-blogs-feeds')));
?>
</textarea>
</p>
<input type="submit" name="save" value="<?php
_e("Update Feed URL's", RW_Group_Blogs::$textdomain);
?>
"/>
<?php
wp_nonce_field('groups_edit_save_' . $this->slug);
}
示例13: edit_screen
function edit_screen()
{
global $groups_template;
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
?>
<h2><?php
echo attribute_escape($this->name);
?>
</h2>
<div class="editfield">
<label for=""><?php
_e('Group Slug', 'bp-edit-group-slug');
?>
</label>
<p><?php
_e('This slug has been automatically created from the group name you entered in step 1.', 'bp-edit-group-slug');
?>
</p>
<p><?php
_e('You can keep it, or change it to something more accurate.', 'bp-edit-group-slug');
?>
</p>
<div class="slug-wrapper">
<?php
echo $this->get_group_slug_screen($groups_template->group->id);
?>
</div>
</div>
<div class="form-submit">
<input type="submit" name="save" value="<?php
_e("Update Slug", 'bp-edit-group-slug');
?>
" />
</div>
<?php
wp_nonce_field('groups_edit_save_' . $this->slug);
}
示例14: do_action
<?php
do_action('bp_after_group_membership_requests_admin');
?>
<?php
}
?>
<?php
do_action('groups_custom_edit_steps');
?>
<?php
/* Delete Group Option */
if (bp_is_group_admin_screen('delete-group')) {
?>
<?php
do_action('bp_before_group_delete_admin');
?>
<div id="message" class="info">
<p><?php
_e('WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress');
?>
</p>
</div>
<label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php
_e('I understand the consequences of deleting this group.', 'buddypress');
示例15: edit_screen
/**
* Edit screen.
*
* @param int $group_id The group ID.
*/
public function edit_screen($group_id = null)
{
if (!bp_is_group_admin_screen($this->slug)) {
return false;
}
$meta = groups_get_groupmeta(bp_get_current_group_id(), 'fetchtime');
$fetch = !empty($meta) ? $meta : '30';
$times = array('10', '15', '20', '30', '60');
echo '<p><label for="fetch-time">';
_e("Refresh time:", "bp-groups-externalblogs");
echo '</label>';
echo "<select id='fetch-time' name='fetch-time'>";
$default = __('Default', 'buddysuite');
echo "<option value='30'>{$default}</option>";
foreach ($times as $time) {
$selected = $fetch == $time ? 'selected="selected"' : '';
echo "<option value='{$time}' {$selected}>{$time}</option>";
}
echo "</select></p>";
?>
<span class="desc"><?php
_e("Enter RSS feed URL's for blogs you would like to attach to this group. Any future posts on these blogs will show on the group activity stream. Seperate URL's with commas.", 'bp-groups-externalblogs');
?>
</span>
<p>
<label for="blogfeeds"><?php
_e("Feed URL's:", 'bp-groups-externalblogs');
?>
</label>
<textarea name="blogfeeds" id="blogfeeds"><?php
echo implode(', ', array_map('esc_url', (array) groups_get_groupmeta(bp_get_current_group_id(), 'blogfeeds')));
?>
</textarea>
</p>
<input type="submit" name="save" value="<?php
_e("Update Feed URL's", 'bp-groups-externalblogs');
?>
" />
<?php
wp_nonce_field('groups_edit_save_' . $this->slug);
?>
<?php
}