users_who_can('', COLS_ID_NAME_RS); $agent_list_prefix[ROLE_BASIS_USER] = ''; } if ( GROUP_ROLES_RS && ( $is_administrator ) ) { if ( $agents[ROLE_BASIS_GROUPS] = ScoperAdminLib::get_all_groups(UNFILTERED_RS) ) { $role_bases []= ROLE_BASIS_GROUPS; $agent_list_prefix[ROLE_BASIS_GROUPS] = __('Groups') . ': '; } } if ( empty($role_bases) ) wp_die(__awp('Cheatin’ uh?')); $duration_limits_enabled = scoper_get_option('role_duration_limits'); $content_date_limits_enabled = scoper_get_option('role_content_date_limits'); $agent_names = array(); foreach ( $role_bases as $role_basis ) foreach( $agents[$role_basis] as $agent ) $agent_names[$role_basis][$agent->ID] = str_replace(' ', ' ', $agent->display_name); if ( count($role_bases) > 1 ) { $agent_caption = __('User / Group', 'scoper'); $agent_caption_plural = __('Users or Groups', 'scoper'); } elseif ( isset($agents[ROLE_BASIS_USER]) ) { $agent_caption = __('User', 'scoper'); $agent_caption_plural = __awp('Users'); } elseif ( isset($agents[ROLE_BASIS_GROUPS]) ) { $agent_caption = __('Group', 'scoper'); $agent_caption_plural = __('Groups', 'scoper'); } echo ''; $err = 0; $role_codes = array(); //generate temporary numeric id for each defined role, to reduce html bulk $i = 0; $role_defs = array(); $date_key = ''; // temp foreach( $scoper->role_defs->get_matching('rs') as $role_handle => $role_def) { // user can only view/assign roles they have // instead of hiding unowned roles, just make them uneditable //if ( $is_administrator || ! array_diff(array_keys($scoper->role_defs->role_caps[$role_handle]), $current_rs_user->allcaps) ) { $role_defs[$role_handle] = $role_def; $role_codes[$role_handle] = $i; $i++; //} } if ( isset($_POST['rs_submit']) ) : ?>

start_date_gmt || ( $date_entries_gmt->end_date_gmt != SCOPER_MAX_DATE_STRING ) || ! empty( $_POST['start_date_gmt_keep-timestamp'] ) || ! empty( $_POST['end_date_gmt_keep-timestamp'] ) ); $args[ 'set_role_duration' ] = (object) array( 'date_limited' => $is_limited, 'start_date_gmt' => $date_entries_gmt->start_date_gmt, 'end_date_gmt' => $date_entries_gmt->end_date_gmt ); } if( $content_date_limits_enabled && ! empty($_POST['set_content_date_limits']) ) { $is_limited = ( $date_entries_gmt->content_min_date_gmt || ( $date_entries_gmt->content_max_date_gmt != SCOPER_MAX_DATE_STRING ) || ! empty( $_POST['content_min_date_gmt_keep-timestamp'] ) || ! empty( $_POST['content_max_date_gmt_keep-timestamp'] ) ); $args[ 'set_content_date_limits' ] = (object) array( 'content_date_limited' => $is_limited, 'content_min_date_gmt' => $date_entries_gmt->content_min_date_gmt, 'content_max_date_gmt' => $date_entries_gmt->content_max_date_gmt ); } $role_assigner->assign_roles( BLOG_SCOPE_RS, '', 0, $blog_roles[$role_basis], $role_basis, $args ); } // end foreach role basis ?>

__('Assign', 'scoper'), REMOVE_ASSIGNMENT_RS =>__('Remove', 'scoper') ); ?>

'; _e("Supplement any user's site-wide WordPress Role with additional, type-specific role(s). This does not alter the WordPress role.", 'scoper'); echo '
'; } ?>
blogrole_scroll_links(); //echo '
'; // ============ Users / Groups Selection Display ================ echo "

"; ?>

  • 1. '; _e('Select Assignment Mode', 'scoper'); echo '

  • '; $number = ( $duration_limits_enabled || $content_date_limits_enabled ) ? 5 : 4; echo '
  • ' . $number . '. '; _e('Confirm and Submit', 'scoper'); echo '

  • '; echo ''; ?>

    2. '; //printf( _ x('Select %s to Modify', 'Users or Groups', 'scoper'), $agent_caption_plural ); printf( __('Select %s to Modify', 'scoper'), $agent_caption_plural ); echo '

    '; $args = array( 'suppress_extra_prefix' => true, 'filter_threshold' => 20, 'default_hide_threshold' => 20, 'check_for_incomplete_submission' => true ); require_once( dirname(__FILE__).'/agents_checklist_rs.php'); ScoperAgentsChecklist::all_agents_checklist($role_bases, $agents, $args); echo '

    '; //=================== end users/groups selection display ==================== echo '

    '; if ( $duration_limits_enabled || $content_date_limits_enabled ) { echo '

    3. '; _e('Set Role Duration and/or Content Date Limits (optional)', 'scoper'); echo '

    '; ScoperAdminBulkLib::display_date_limit_inputs( $duration_limits_enabled, $content_date_limits_enabled ); echo '

    4. '; } else echo '

    3. '; _e('Select Roles to Assign / Remove', 'scoper'); echo '

    '; echo ""; _e('select all roles', 'scoper'); echo " | "; echo ""; _e('unselect all roles', 'scoper'); echo ' | '; if ( in_array(ROLE_BASIS_USER, $role_bases) ) { echo ""; _e('hide users', 'scoper'); echo ' | '; } if ( in_array(ROLE_BASIS_GROUPS, $role_bases) ) { echo ""; _e('hide groups', 'scoper'); echo ' | '; } // Hide Empty $js_call = " agp_display_marked_elements('li','no-role-li','none'); agp_setcss('.no-role','display','none'); agp_setcss('.user-csv','display','inline'); agp_setcss('.groups-csv','display','inline'); "; echo ""; _e('hide empty', 'scoper'); echo ' | '; // Show All $tr_display = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) ? 'block' : 'table-row'; $js_call = " agp_display_marked_elements('li','role-li','block'); agp_setcss('.no-role','display','$tr_display'); agp_setcss('.user-csv','display','inline'); agp_setcss('.groups-csv','display','inline'); "; echo ""; _e('show all', 'scoper'); echo ''; $all_roles = array(); $otype_source = array(); foreach ( $scoper->data_sources->get_all() as $src_name => $src) { if ( ! empty($src->taxonomy_only) ) continue; $object_types = $src->object_types; if ( 'post' == $src_name ) { $use_post_types = scoper_get_option( 'use_post_types' ); $use_post_types['nav_menu_item'] = true; // currently no RS Options switch for this $object_types['nav_menu_item'] = (object) array( 'labels' => (object) array( 'name' => __( 'Nav Menu Manager', 'scoper' ) ) ); } $include_taxonomy_otypes = true; foreach ( $object_types as $object_type => $otype ) { if ( ( 'post' == $src_name ) && ( empty( $use_post_types[$object_type] ) ) ) continue; $otype_roles = array(); $otype_roles[$object_type] = $scoper->role_defs->get_matching( 'rs', $src_name, $object_type ); $otype_source[$object_type] = $src_name; $uses_taxonomies = scoper_get_taxonomy_usage( $src_name, $object_type ); if ( $include_taxonomy_otypes ) { foreach ( $uses_taxonomies as $taxonomy) if ( $tx_roles = $scoper->role_defs->get_matching( 'rs', $src_name, $taxonomy ) ) $otype_roles[$taxonomy] = $tx_roles; } if ( ! $otype_roles ) continue; echo "

    "; printf( __('Modify role assignments for %s', 'scoper'), $otype->labels->name ); echo '

    '; //display each role eligible for group/user assignment $row_class = 'rs-backwhite'; ?> '; echo '
    '; } // end foreach object_type } // end foreach data source echo '' . __('top', 'scoper') . ''; ?>