?> </label></th> <td><input type="text" name="group_name" id="group_name" value="" class="regular-text" /> </td> </tr> <tr class="form-field"> <th><label for="description"><?php echo __ppw('Description', 'pp'); ?> </label></th> <td><input type="text" name="description" id="description" value="" class="regular-text" size="80" /></td> </tr> </table> <?php if (pp_has_group_cap('pp_manage_members', 0, $agent_type)) { PP_GroupsUI::_draw_member_checklists(0, $agent_type); } echo '<div style="clear:both;margin-top:10px;"><br />'; _e('Note: Supplemental Roles and other group settings can be configured here after the new group is created.', 'pp'); echo '</div>'; do_action('pp_new_group_ui'); ?> <?php submit_button(__('Create Group', 'pp'), 'primary large pp-submit'); ?> </form> </div>
} } require_once dirname(__FILE__) . '/profile_ui_pp.php'; PP_ProfileUI::display_ui_user_groups(false, array('initial_hide' => true, 'selected_only' => true, 'force_display' => true, 'edit_membership_link' => true, 'hide_checkboxes' => true, 'user_id' => $agent_id)); $role_group_caption = sprintf(__('Supplemental Roles %1$s(from primary role or %2$sgroup membership%3$s)%4$s', 'pp'), '<small>', "<a class='pp-show-groups' href='#'>", '</a>', '</small>'); PP_GroupsUI::_current_roles_ui($roles, array('read_only' => true, 'class' => 'pp-group-roles', 'caption' => $role_group_caption)); $exceptions = array(); $args = array('assign_for' => '', 'inherited_from' => 0, 'extra_cols' => array('i.assign_for', 'i.eitem_id'), 'post_types' => array_keys($post_types), 'taxonomies' => array_keys($taxonomies), 'return_raw_results' => true); foreach (array_keys($user->groups) as $agent_type) { $args['agent_type'] = $agent_type; $args['ug_clause'] = " AND e.agent_type = '{$agent_type}' AND e.agent_id IN ('" . implode("','", array_keys($user->groups[$agent_type])) . "')"; $args['query_agent_ids'] = array_keys($user->groups[$agent_type]); $exceptions = array_merge($exceptions, ppc_get_exceptions($args)); } $role_group_caption = sprintf(__('Exceptions %1$s(from primary role or %2$sgroup membership%3$s)%4$s', 'pp'), '<small>', "<a class='pp-show-groups' href='#'>", '</a>', '</small>'); PP_GroupsUI::_current_exceptions_ui($exceptions, array('read_only' => true, 'class' => 'pp-group-roles', 'caption' => $role_group_caption)); } else { ?> <h4> <?php $url = "users.php"; printf(__('View currently stored user permissions:', 'pp')); ?> </h4> <ul class="pp-notes"> <li><?php printf(__('%1$sUsers who have Supplemental Roles assigned directly%2$s', 'pp'), "<a href='{$url}?pp_user_roles=1'>", '</a>'); ?> </li> <li><?php printf(__('%1$sUsers who have Exceptions assigned directly%2$s', 'pp'), "<a href='{$url}?pp_user_exceptions=1'>", '</a>');
public static function display_ui_user_roles($user) { $roles = array(); $post_types = pp_get_enabled_post_types(array(), 'object'); $taxonomies = pp_get_enabled_taxonomies(array(), 'object'); $is_administrator = pp_bulk_roles_enabled() && current_user_can('pp_manage_groups'); $edit_url = $is_administrator ? "admin.php?page=pp-edit-permissions&action=edit&agent_id={$user->ID}&agent_type=user" : ''; $user->retrieve_extra_groups(); foreach (array_keys($user->groups) as $agent_type) { foreach (array_keys($user->groups[$agent_type]) as $agent_id) { $roles = array_merge($roles, ppc_get_roles($agent_type, $agent_id, array('post_types' => $post_types, 'taxonomies' => $taxonomies, 'query_agent_ids' => array_keys($user->groups[$agent_type])))); } } $link = current_user_can('pp_assign_roles') ? "admin.php?page=pp-edit-permissions&action=edit&agent_type=user&agent_id={$user->ID}" : ''; PP_GroupsUI::_current_roles_ui($roles, array('read_only' => true, 'link' => '', 'caption' => sprintf(__('Supplemental Roles %1$s(from primary role or group membership)%2$s', 'pp'), '<small>', '</small>'))); self::abbreviated_exceptions_ui('user', $user->ID, array('edit_url' => '', 'class' => 'pp-group-roles', 'caption' => __('Exceptions (from primary role or group membership)', 'pp'), 'join_groups' => 'groups_only', 'display_limit' => 12)); }