当前位置: 首页>>代码示例>>PHP>>正文


PHP scoper_get_option函数代码示例

本文整理汇总了PHP中scoper_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP scoper_get_option函数的具体用法?PHP scoper_get_option怎么用?PHP scoper_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了scoper_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_reqd_caps

 function get_reqd_caps()
 {
     $reqd_caps = array();
     $generic_uri = in_array($GLOBALS['pagenow'], array('index.php', 'comments.php'));
     if (!$generic_uri && ($_post_type = cr_find_post_type('', false))) {
         // arg: don't return 'post' as default if detection fails
         $post_types = array($_post_type => get_post_type_object($_post_type));
     } else {
         $post_types = array_diff_key(get_post_types(array('public' => true), 'object'), array('attachment' => true));
     }
     $use_post_types = scoper_get_option('use_post_types');
     $post_statuses = get_post_stati(array('internal' => null), 'object');
     foreach ($post_types as $_post_type => $type_obj) {
         if (empty($use_post_types[$_post_type])) {
             continue;
         }
         foreach ($post_statuses as $status => $status_obj) {
             $reqd_caps[$_post_type][$status] = array($type_obj->cap->edit_others_posts);
             if (scoper_get_option('require_moderate_comments_cap')) {
                 $reqd_caps[$_post_type][$status][] = 'moderate_comments';
             }
             if ($status_obj->private) {
                 $reqd_caps[$_post_type][$status][] = $type_obj->cap->edit_private_posts;
             }
             if ($status_obj->public || 'future' == $status) {
                 $reqd_caps[$_post_type][$status][] = $type_obj->cap->edit_published_posts;
             }
         }
     }
     return $reqd_caps;
 }
开发者ID:joostrijneveld,项目名称:cscircles-wp-content,代码行数:31,代码来源:comments-interceptor-admin_rs.php

示例2: flt_dropdown_pages

 function flt_dropdown_pages($orig_options_html)
 {
     if ('no_parent_filter' == scoper_get_option('lock_top_pages')) {
         return $orig_options_html;
     }
     if (!strpos($orig_options_html, 'parent_id') || !$orig_options_html || is_content_administrator_rs()) {
         return $orig_options_html;
     }
     $post_type = awp_post_type_from_uri();
     // User can't associate or de-associate a page with Main page unless they have edit_pages blog-wide.
     // Prepend the Main Page option if appropriate (or, to avoid submission errors, if we generated no other options)
     if (!$GLOBALS['scoper_admin_filters']->user_can_associate_main($post_type)) {
         $is_new = $GLOBALS['post']->post_status == 'auto-draft';
         if (!$is_new) {
             global $post;
             $object_id = !empty($post->ID) ? $post->ID : (int) $GLOBALS['scoper']->data_sources->detect('id', 'post', 0, 'post');
             $stored_parent_id = !empty($post->ID) ? $post->post_parent : get_post_field('post_parent', $object_id);
         }
         if ($is_new || $stored_parent_id) {
             $mat = array();
             preg_match('/<option[^v]* value="">[^<]*<\\/option>/', $orig_options_html, $mat);
             if (!empty($mat[0])) {
                 return str_replace($mat[0], '', $orig_options_html);
             }
         }
     }
     return $orig_options_html;
 }
开发者ID:btj,项目名称:cscircles-wp-content,代码行数:28,代码来源:hardway-parent_rs.php

示例3: scoper_requested_file_rule_expire

function scoper_requested_file_rule_expire()
{
    if (scoper_get_option('file_filtering')) {
        if ($key = scoper_get_option('file_filtering_regen_key')) {
            if (!empty($_GET['key']) && $key == $_GET['key']) {
                // user must store their own non-null key before this will work
                global $wpdb;
                if (IS_MU_RS) {
                    $blog_ids = scoper_get_col("SELECT blog_id FROM {$wpdb->blogs} ORDER BY blog_id");
                    $orig_blog_id = $GLOBALS['blog_id'];
                    foreach ($blog_ids as $id) {
                        switch_to_blog($id);
                        scoper_query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '_rs_file_key'");
                    }
                } else {
                    scoper_query("DELETE FROM {$wpdb->postmeta} WHERE meta_key = '_rs_file_key'");
                }
                scoper_expire_file_rules();
                if (IS_MU_RS) {
                    _e("File attachment access keys and rewrite rules will be regenerated for each site at next access.", 'scoper');
                } else {
                    _e("File attachment access keys and rewrite rules were regenerated.", 'scoper');
                }
            } else {
                _e('Invalid argument.', 'scoper');
            }
        } else {
            _e('Please configure File Filtering options!', 'scoper');
        }
    } else {
        _e('The function is disabled.', 'scoper');
    }
    exit(0);
}
开发者ID:joostrijneveld,项目名称:cscircles-wp-content,代码行数:34,代码来源:attachment-helper_rs.php

示例4: scoper_review_file_htaccess

function scoper_review_file_htaccess()
{
    $min_date = (int) scoper_get_site_option('file_htaccess_min_date');
    $last_regen = (int) scoper_get_option('file_htaccess_date');
    if (!$last_regen || $min_date > $last_regen) {
        scoper_flush_file_rules();
    }
}
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:8,代码来源:mu-init_rs.php

示例5: user_can_admin_role_rs

function user_can_admin_role_rs($role_handle, $item_id, $src_name = '', $object_type = '')
{
    if (is_user_administrator_rs()) {
        return true;
    }
    global $scoper;
    static $require_blogwide_editor;
    if (!isset($require_blogwide_editor)) {
        $require_blogwide_editor = scoper_get_option('role_admin_blogwide_editor_only');
    }
    if ('admin' == $require_blogwide_editor) {
        return false;
    }
    // User Admins already returned true
    if ('admin_content' == $require_blogwide_editor && !is_content_administrator_rs()) {
        return false;
    }
    static $role_ops;
    if (!isset($role_ops)) {
        $role_ops = array();
    }
    if (!isset($role_ops[$role_handle])) {
        $role_ops[$role_handle] = $scoper->cap_defs->get_cap_ops(array_keys($scoper->role_defs->role_caps[$role_handle]));
    }
    // user can't view or edit role assignments unless they have all rolecaps
    // however, if this is a new post, allow read role to be assigned even if contributor doesn't have read_private cap blog-wide
    if ($item_id || $role_ops[$role_handle] != array('read' => 1)) {
        static $reqd_caps;
        if (!isset($reqd_caps)) {
            $reqd_caps = array();
        }
        if (!isset($reqd_caps[$role_handle])) {
            $reqd_caps[$role_handle] = $scoper->role_defs->role_caps[$role_handle];
        }
        $type_caps = $scoper->cap_defs->get_matching($src_name, $object_type);
        $reqd_caps[$role_handle] = array_intersect_key($reqd_caps[$role_handle], $type_caps);
        if (is_null($item_id)) {
            $item_id = 0;
        }
        if (!cr_user_can(array_keys($reqd_caps[$role_handle]), $item_id)) {
            return false;
        }
        // are we also applying the additional requirement (based on RS Option setting) that the user is a blog-wide editor?
        if ($require_blogwide_editor) {
            static $can_edit_blogwide;
            if (!isset($can_edit_blogwide)) {
                $can_edit_blogwide = array();
            }
            if (!isset($can_edit_blogwide[$src_name][$object_type])) {
                $can_edit_blogwide[$src_name][$object_type] = user_can_edit_blogwide_rs($src_name, $object_type, array('require_others_cap' => true));
            }
            if (!$can_edit_blogwide[$src_name][$object_type]) {
                return false;
            }
        }
    }
    return true;
}
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:58,代码来源:permission_lib_rs.php

示例6: otype_option_checkboxes

 function otype_option_checkboxes($option_name, $caption, $tab_name, $section_name, $hint_text, $trailing_html, $args = array())
 {
     global $scoper, $scoper_admin;
     $defaults = array('caption_header' => true);
     $args = array_merge($defaults, $args);
     extract($args);
     $return = array('in_scope' => false, 'val' => array());
     if (in_array($option_name, $this->form_options[$tab_name][$section_name])) {
         $this->all_otype_options[] = $option_name;
         if (isset($this->def_otype_options[$option_name])) {
             if (!($return['val'] = scoper_get_option($option_name, $this->sitewide, $this->customize_defaults))) {
                 $return['val'] = array();
             }
             $return['val'] = array_merge($this->def_otype_options[$option_name], $return['val']);
             $label_property = isset($args['label_property']) ? $args['label_property'] : 'name';
             $first_pass = true;
             foreach ($return['val'] as $src_otype => $val) {
                 if ($caption_header && $first_pass) {
                     printf($caption, $scoper_admin->interpret_src_otype($src_otype, $label_property));
                     echo '<br /><div style="margin-left: 2em">';
                     $first_pass = false;
                 }
                 $arr_src_otype = explode(':', $src_otype);
                 if (!scoper_get_otype_option('use_object_roles', $arr_src_otype[0], $arr_src_otype[1])) {
                     continue;
                 }
                 $item_label = $scoper_admin->interpret_src_otype($src_otype, $label_property);
                 //arg: use plural display name
                 $id = str_replace(':', '_', $option_name . '-' . $src_otype);
                 echo "<label for='{$id}'>";
                 echo "<input name='{$id}' type='checkbox' id='{$id}' value='1' ";
                 checked('1', $val);
                 echo " /> ";
                 if ($caption_header) {
                     echo $item_label;
                 } else {
                     printf($caption, $item_label);
                 }
                 echo '</label><br />';
             }
             // end foreach src_otype
             if ($caption_header) {
                 echo '</div>';
             }
             if ($hint_text && $this->display_hints) {
                 echo "<span class='rs-subtext'>" . $hint_text . "</span>";
             }
             if ($trailing_html) {
                 echo $trailing_html;
             }
         }
         // endif default option isset
         $return['in_scope'] = true;
     }
     // endif in this option is controlled in this scope
     return $return;
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:57,代码来源:options.php

示例7: flt_recent_comments

 function flt_recent_comments($query)
 {
     // Due to missing get_comments hook prior to WP 3.1, this filter operates on every front-end query.
     // If query doesn't pertain to comments, skip out with as little overhead as possible.
     if (strpos($query, 'comment') && strpos($query, "ELECT") && !strpos($query, 'posts as parent') && !strpos($query, "COUNT") && strpos($query, "comment_approved")) {
         if (!is_attachment() && !is_content_administrator_rs()) {
             global $wpdb;
             if (strpos($query, " {$wpdb->posts} ")) {
                 return $query;
             }
             if (awp_is_plugin_active('wp-wall')) {
                 $options = WPWall_GetOptions();
                 if (strpos($query, 'comment_post_ID=' . $options['pageId'])) {
                     return $query;
                 }
             }
             if (strpos($query, $wpdb->comments)) {
                 $query = str_replace(" post_status = 'publish'", " {$wpdb->posts}.post_status = 'publish'", $query);
                 // theoretically, a slight performance enhancement if we can simplify the query to skip filtering of attachment comments
                 if (defined('SCOPER_NO_ATTACHMENT_COMMENTS') || false !== strpos($query, 'comment_post_ID =')) {
                     if (!strpos($query, "JOIN {$wpdb->posts}")) {
                         $query = preg_replace("/FROM\\s*{$wpdb->comments}\\s*WHERE /", "FROM {$wpdb->comments} INNER JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID WHERE ", $query);
                     }
                     $query = apply_filters('objects_request_rs', $query, 'post', '', array('skip_teaser' => true));
                 } else {
                     $query = str_replace("user_id ", "{$wpdb->comments}.user_id ", $query);
                     $query = str_replace("SELECT {$wpdb->comments}.* FROM {$wpdb->comments}", "SELECT DISTINCT {$wpdb->comments}.* FROM {$wpdb->comments}", $query);
                     if (!strpos($query, ' DISTINCT ')) {
                         $query = str_replace("SELECT ", "SELECT DISTINCT ", $query);
                     }
                     $post_types = array_diff(get_post_types(array('public' => true)), array('attachment'));
                     $post_type_in = "'" . implode("','", $post_types) . "'";
                     $join = "LEFT JOIN {$wpdb->posts} as parent ON parent.ID = {$wpdb->posts}.post_parent AND parent.post_type IN ({$post_type_in}) AND {$wpdb->posts}.post_type = 'attachment'";
                     $use_post_types = scoper_get_option('use_post_types');
                     $where = array();
                     foreach ($post_types as $type) {
                         if (!empty($use_post_types[$type])) {
                             $where_post = apply_filters('objects_where_rs', '', 'post', $type, array('skip_teaser' => true));
                         } else {
                             $where_post = "AND 1=1";
                         }
                         $where[] = "{$wpdb->posts}.post_type = '{$type}' {$where_post}";
                         $where[] = "{$wpdb->posts}.post_type = 'attachment' AND parent.post_type = '{$type}' " . str_replace("{$wpdb->posts}.", "parent.", $where_post);
                     }
                     $where = agp_implode(' ) OR ( ', $where, ' ( ', ' ) ');
                     if (!strpos($query, "JOIN {$wpdb->posts}")) {
                         $query = str_replace("WHERE ", "INNER JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID {$join} WHERE ( {$where} ) AND ", $query);
                     } else {
                         $query = str_replace("WHERE ", "{$join} WHERE {$where} AND ", $query);
                     }
                 }
             }
         }
     }
     return $query;
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:56,代码来源:hardway-front-legacy_rs.php

示例8: flt_comments_clauses

 function flt_comments_clauses($clauses, &$qry_obj)
 {
     global $wpdb;
     if (is_admin() && defined('SCOPER_NO_COMMENT_FILTERING') && empty($GLOBALS['current_user']->allcaps['moderate_comments'])) {
         return $clauses;
     }
     if (empty($clauses['join'])) {
         $clauses['join'] = "JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID";
     }
     // for WP 3.1 and any manual 3rd-party join construction (subsequent filter will expand to additional statuses as appropriate)
     $clauses['where'] = preg_replace("/ post_status\\s*=\\s*[']?publish[']?/", " {$wpdb->posts}.post_status = 'publish'", $clauses['where']);
     // performance enhancement: simplify comments query if there are no attachment comments to filter (TODO: cache this result)
     $qry_any_attachment_comments = "SELECT ID FROM {$wpdb->posts} AS p INNER JOIN {$wpdb->comments} AS c ON p.ID = c.comment_post_ID WHERE p.post_type = 'attachment' LIMIT 1";
     $post_type_arg = isset($qry_obj->query_vars['post_type']) ? $qry_obj->query_vars['post_type'] : '';
     $post_id = !empty($qry_obj->query_vars['post_id']) ? $qry_obj->query_vars['post_id'] : 0;
     $attachment_query = 'attachment' == $post_type_arg || $post_id && 'attachment' == get_post_field('post_type', $post_id);
     $args = array('skip_teaser' => true);
     if (is_admin()) {
         require_once 'admin/comments-interceptor-admin_rs.php';
         $args['force_reqd_caps'] = CommentsInterceptorAdmin_RS::get_reqd_caps();
     }
     // $attachment_query: current query is for attachment post type, or for a specific post which is an attachment
     // $post_id: current query is for a specific post
     // 	 NOTE: even if not $attachment_query, attachment comments are included by default along with comments on other post types (i.e. for Recent Comments sidebar)
     if (defined('SCOPER_NO_ATTACHMENT_COMMENTS') || !$attachment_query && ($post_id || !defined('SCOPER_ATTACHMENT_COMMENTS') && !scoper_get_var($qry_any_attachment_comments))) {
         $clauses['where'] = " AND " . $clauses['where'];
         $clauses['where'] = "1=1" . apply_filters('objects_where_rs', $clauses['where'], 'post', $post_type_arg, $args);
     } else {
         if (false === strpos($clauses['fields'], 'DISTINCT ')) {
             $clauses['fields'] = 'DISTINCT ' . $clauses['fields'];
         }
         if ($post_type_arg) {
             $post_types = (array) $post_type_arg;
         } else {
             $post_types = array_diff(get_post_types(array('public' => true)), array('attachment'));
         }
         $post_type_in = "'" . implode("','", $post_types) . "'";
         $clauses['join'] .= " LEFT JOIN {$wpdb->posts} as parent ON parent.ID = {$wpdb->posts}.post_parent AND parent.post_type IN ({$post_type_in}) AND {$wpdb->posts}.post_type = 'attachment'";
         $use_post_types = scoper_get_option('use_post_types');
         $where = array();
         foreach ($post_types as $type) {
             if (!empty($use_post_types[$type])) {
                 $where_post = apply_filters('objects_where_rs', '', 'post', $type, $args);
             } else {
                 $where_post = "AND 1=1";
             }
             $where[] = "{$wpdb->posts}.post_type = '{$type}' {$where_post}";
             $where[] = "{$wpdb->posts}.post_type = 'attachment' AND parent.post_type = '{$type}' " . str_replace("{$wpdb->posts}.", "parent.", $where_post);
         }
         $clauses['where'] = preg_replace("/\\s*AND\\s*{$wpdb->posts}.post_status\\s*=\\s*[']?publish[']?/", "", $clauses['where']);
         $clauses['where'] .= ' AND ( ' . agp_implode(' ) OR ( ', $where, ' ( ', ' ) ') . ' )';
     }
     return $clauses;
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:54,代码来源:comments-interceptor_rs.php

示例9: act_attachment_access

 function act_attachment_access()
 {
     if (is_admin() || defined('DISABLE_QUERYFILTERS_RS') || is_content_administrator_rs() || !scoper_get_option('file_filtering')) {
         return;
     }
     // if ( is_attachment() ) {  as of WP 2.6, is_attachment() returns false for custom permalink attachment URL
     if (is_attachment_rs()) {
         //rs_errlog( 'IS an attachment:' );
         require_once dirname(__FILE__) . '/attachment-template_rs.php';
         AttachmentTemplate_RS::attachment_access();
     }
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:12,代码来源:attachment-interceptor_rs.php

示例10: _validate_assigner_roles

 function _validate_assigner_roles($scope, $src_or_tx_name, $item_id, $roles)
 {
     if (!$item_id && !is_user_administrator_rs()) {
         return false;
     }
     $user_has_role = array();
     if (TERM_SCOPE_RS == $scope) {
         foreach (array_keys($roles) as $role_handle) {
             $role_attributes = $this->scoper->role_defs->get_role_attributes($role_handle);
             $args = array('src_name' => $role_attributes->src_name, 'object_type' => $role_attributes->object_type);
             $user_has_role[$role_handle] = $this->user_has_role_in_term($role_handle, $src_or_tx_name, $item_id, $args);
         }
     } else {
         if ($require_blogwide_editor = scoper_get_option('role_admin_blogwide_editor_only')) {
             global $current_user;
             $is_user_administrator = is_user_administrator_rs();
             $is_content_administrator = is_content_administrator_rs();
         }
         foreach (array_keys($roles) as $role_handle) {
             // a user must have a blog-wide edit cap to modify editing role assignments (even if they have Editor role assigned for some current object)
             if ($require_blogwide_editor) {
                 if (!$is_user_administrator && 'admin' == $require_blogwide_editor) {
                     $user_has_role[$role_handle] = false;
                     continue;
                 }
                 if (!$is_content_administrator && 'admin_content' == $require_blogwide_editor) {
                     $user_has_role[$role_handle] = false;
                     continue;
                 }
                 $src_name = $this->scoper->role_defs->member_property($role_handle, 'src_name');
                 $object_type = $this->scoper->role_defs->member_property($role_handle, 'object_type');
                 static $can_edit_blogwide;
                 if (!isset($can_edit_blogwide)) {
                     $can_edit_blogwide = array();
                 }
                 if (!isset($can_edit_blogwide[$src_name][$object_type])) {
                     $can_edit_blogwide[$src_name][$object_type] = $this->scoper->user_can_edit_blogwide($src_name, $object_type, array('require_others_cap' => true));
                 }
                 if (!$can_edit_blogwide[$src_name][$object_type]) {
                     $user_has_role[$role_handle] = false;
                     continue;
                 }
             }
             if (!empty($this->scoper->role_defs->role_caps[$role_handle])) {
                 $user_has_role[$role_handle] = cr_user_can(array_keys($this->scoper->role_defs->role_caps[$role_handle]), $item_id);
             }
         }
     }
     return $user_has_role;
 }
开发者ID:btj,项目名称:cscircles-wp-content,代码行数:50,代码来源:role_assigner_rs.php

示例11: available_menu_items_parse_query

 function available_menu_items_parse_query(&$query)
 {
     if (scoper_get_option('admin_nav_menu_filter_items')) {
         $query->query_vars['include'] = '';
         $query->query_vars['post__in'] = '';
         $query->query_vars_hash = '';
         $query->query_vars_changed = true;
         $query->query['include'] = '';
         $query->query['post__in'] = '';
         $query->query_vars['suppress_filters'] = false;
         $query->query_vars['post_status'] = '';
         $query->query['suppress_filters'] = false;
         $query->query['post_status'] = '';
     }
 }
开发者ID:joostrijneveld,项目名称:cscircles-wp-content,代码行数:15,代码来源:filters-nav-menu-query_rs.php

示例12: organize_assigned_roles

 function organize_assigned_roles($scope, $src_or_tx_name, $obj_or_term_id, $role_handles = '', $role_basis = ROLE_BASIS_USER, $get_defaults = false)
 {
     $assignments = array();
     if ($get_defaults) {
         $obj_or_term_id = intval($obj_or_term_id);
     }
     $args = array('role_handles' => $role_handles);
     $args['id'] = $obj_or_term_id || $get_defaults ? $obj_or_term_id : false;
     $roles = ScoperRoleAssignments::get_assigned_roles($scope, $role_basis, $src_or_tx_name, $args);
     $role_duration_enabled = scoper_get_option('role_duration_limits');
     $content_date_limits_enabled = scoper_get_option('content_date_limits');
     if (!isset($roles[$obj_or_term_id])) {
         return array();
     }
     foreach ($roles[$obj_or_term_id] as $role_handle => $agents) {
         foreach ($agents as $ug_id => $ass) {
             $ass_id = $ass['assignment_id'];
             $assign_for = $ass['assign_for'];
             $assignments[$role_handle]['assigned'][$ug_id]['inherited_from'] = $ass['inherited_from'];
             $assignments[$role_handle]['assigned'][$ug_id]['assign_for'] = $assign_for;
             $assignments[$role_handle]['assigned'][$ug_id]['assignment_id'] = $ass_id;
             if ($role_duration_enabled && $ass['date_limited']) {
                 $assignments[$role_handle]['assigned'][$ug_id]['date_limited'] = $ass['date_limited'];
                 $assignments[$role_handle]['assigned'][$ug_id]['start_date_gmt'] = $ass['start_date_gmt'];
                 $assignments[$role_handle]['assigned'][$ug_id]['end_date_gmt'] = $ass['end_date_gmt'];
             }
             if ($content_date_limits_enabled && $ass['content_date_limited']) {
                 $assignments[$role_handle]['assigned'][$ug_id]['content_date_limited'] = $ass['content_date_limited'];
                 $assignments[$role_handle]['assigned'][$ug_id]['content_min_date_gmt'] = $ass['content_min_date_gmt'];
                 $assignments[$role_handle]['assigned'][$ug_id]['content_max_date_gmt'] = $ass['content_max_date_gmt'];
             }
             // also save the calling function some work by returning each flavor of assignment as an array keyed by user/group id
             if ('children' == $assign_for || 'both' == $assign_for) {
                 $assignments[$role_handle]['children'][$ug_id] = $ass_id;
             }
             if ('entity' == $assign_for || 'both' == $assign_for) {
                 $assignments[$role_handle]['entity'][$ug_id] = $ass_id;
             }
             if ($ass['inherited_from']) {
                 $assignments[$role_handle]['propagated'][$ass['inherited_from']] = $ass_id;
             }
         }
     }
     return $assignments;
 }
开发者ID:btj,项目名称:cscircles-wp-content,代码行数:45,代码来源:role_assignment_lib_rs.php

示例13: TemplateInterceptor_RS

 function TemplateInterceptor_RS()
 {
     $this->scoper =& $GLOBALS['scoper'];
     if (scoper_get_option('strip_private_caption')) {
         add_filter('the_title', array(&$this, 'flt_title'), 10, 3);
         if (defined('WPLANG') && WPLANG) {
             add_filter('gettext', array(&$this, 'flt_gettext'), 10, 3);
         }
     }
     if (defined('SCOPER_FILTER_COMMENT_COUNT')) {
         add_filter('get_comments_number', array(&$this, 'flt_get_comments_number'));
     }
     // this filter should pass post_id as 2nd arg, but does not as of WP 2.7
     if (awp_is_plugin_active('events-calendar')) {
         add_filter('query', array(&$this, 'ec_getDaysEvents'));
     }
     if (awp_is_plugin_active('eventcalendar3')) {
         add_filter('query', array(&$this, 'ec3_query'));
     }
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:20,代码来源:template-interceptor_rs.php

示例14: scoper_mu_users_menu

function scoper_mu_users_menu()
{
    if (!defined('DEFINE_GROUPS_RS') || !scoper_get_site_option('mu_sitewide_groups')) {
        return;
    }
    $cap_req = is_user_administrator_rs() || current_user_can('recommend_group_membership') ? 'read' : 'manage_groups';
    $groups_caption = defined('GROUPS_CAPTION_RS') ? GROUPS_CAPTION_RS : __('Role Groups', 'scoper');
    global $scoper_admin;
    $menu_name = awp_ver('3.1') ? 'users.php' : 'ms-admin.php';
    add_submenu_page($menu_name, $groups_caption, $groups_caption, $cap_req, 'rs-groups', array(&$scoper_admin, 'menu_handler'));
    if (scoper_get_option('mu_sitewide_groups')) {
        global $plugin_page_cr;
        // satisfy WordPress' demand that all admin links be properly defined in menu
        if ('rs-default_groups' == $plugin_page_cr) {
            add_submenu_page($menu_name, __('User Groups', 'scoper'), __('Default Groups', 'scoper'), $cap_req, 'rs-default_groups', array(&$scoper_admin, 'menu_handler'));
        }
        if ('rs-group_members' == $plugin_page_cr) {
            add_submenu_page($menu_name, __('User Groups', 'scoper'), __('Group Members', 'scoper'), $cap_req, 'rs-group_members', array(&$scoper_admin, 'menu_handler'));
        }
    }
}
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:21,代码来源:admin_lib-mu_rs.php

示例15: flt_manage_posts_columns

 function flt_manage_posts_columns($defaults)
 {
     global $current_user, $scoper, $scoper_role_usage;
     $object_type = cr_find_post_type();
     if ($blogwide_role_requirement = scoper_get_option('role_admin_blogwide_editor_only')) {
         if ('admin' == $blogwide_role_requirement && !is_user_administrator_rs()) {
             return $defaults;
         } elseif ('content_admin' == $blogwide_role_requirement && !is_content_administrator_rs()) {
             return $defaults;
         } elseif ($blogwide_role_requirement) {
             if (!$scoper->user_can_edit_blogwide('post', $object_type, array('require_others_cap' => true))) {
                 return $defaults;
             }
         }
     }
     $use_object_roles = scoper_get_otype_option('use_object_roles', 'post', $object_type);
     $use_term_roles = scoper_get_otype_option('use_term_roles', 'post', $object_type);
     if ($use_term_roles && !empty($scoper_role_usage->any_restricted_terms) || $use_object_roles && !empty($scoper_role_usage->any_restricted_objects)) {
         if (scoper_get_otype_option('restrictions_column', 'post', $object_type)) {
             $defaults['restricted'] = __('Restrict', 'scoper');
         }
     }
     if (!empty($scoper_role_usage->have_termrole_ids['post'])) {
         if (scoper_get_otype_option('term_roles_column', 'post', $object_type)) {
             $defaults['termroles'] = __('Term Roles', 'scoper');
         }
     }
     if ($use_object_roles && !empty($scoper_role_usage->have_objrole_ids['post'])) {
         if (scoper_get_otype_option('object_roles_column', 'post', $object_type)) {
             $otype_display_name = $scoper->data_sources->member_property('post', 'object_types', $object_type, 'display_name');
             //$defaults['objroles'] = sprintf( _ x('%s Roles', 'Post or Page', 'scoper'), $otype_display_name);
             $defaults['objroles'] = sprintf(__('%s Roles', 'scoper'), $otype_display_name);
         }
     }
     return $defaults;
 }
开发者ID:Netsoro,项目名称:gdnlteamgroup,代码行数:36,代码来源:filters-admin-ui-listing_rs.php


注:本文中的scoper_get_option函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。