* @copyright Copyright (c) 2010 - 2016, Vladimir Garagulya **/ class URE_User_View extends URE_View { private $user_to_edit = null; public function __construct() { parent::__construct(); $this->user_to_edit = $this->editor->get('user_to_edit'); } // end of __construct() public function display_edit_dialogs() { } // end of display_edit_dialogs() /** * output HTML code to create URE toolbar * * @param boolean $role_delete * @param boolean $capability_remove */ public function toolbar() { ?>
user_to_edit->ID}", "ure_user_{$this->user_to_edit->ID}") . '" >'; $anchor_end = ''; if (class_exists('user_switching') && current_user_can('switch_to_user', $this->user_to_edit->ID)) { $switch_to_user_link = user_switching::switch_to_url($this->user_to_edit); $switch_to_user = '' . esc_html__('Switch To', 'user-switching') . ''; } } else { $anchor_start = ''; $anchor_end = ''; } $user_info = ' ' . $anchor_start . $this->user_to_edit->user_login; if ($this->user_to_edit->display_name !== $this->user_to_edit->user_login) { $user_info .= ' (' . $this->user_to_edit->display_name . ')'; } $user_info .= $anchor_end . ''; if (is_multisite() && $this->lib->is_super_admin($this->user_to_edit->ID)) { $user_info .= ' ' . esc_html__('Network Super Admin', 'user-role-editor') . ''; } if (!empty($switch_to_user)) { $user_info .= '    ' . $switch_to_user; } return $user_info; } // end of get_user_info() public function show_primary_role_dropdown_list($user_roles) { ?> lib->show_admin_role_allowed(); $values = array_values($this->user_to_edit->roles); $primary_role = array_shift($values); // get 1st element from roles array $roles = $this->editor->get('roles'); foreach ($roles as $role_id => $role) { if (($show_admin_role || $role_id != 'administrator') && ($role_id !== $primary_role)) { if ($this->editor->user_can($role_id)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '
'; } } } // end of show_secondary_roles() public function display() { $caps_readable = $this->editor->get('caps_readable'); $show_deprecated_caps = $this->editor->get('show_deprecated_caps'); $edit_user_caps_mode = $this->editor->get_edit_user_caps_mode(); $caps_access_restrict_for_simple_admin = $this->lib->get_option('caps_access_restrict_for_simple_admin', 0); $user_info = $this->get_user_info(); $select_primary_role = apply_filters('ure_users_select_primary_role', true); ?>
  lib->is_super_admin() || !$this->multisite || !class_exists('User_Role_Editor_Pro') || !$caps_access_restrict_for_simple_admin) { if ($caps_readable) { $checked = 'checked="checked"'; } else { $checked = ''; } ?> onclick="ure_turn_caps_readable(user_to_edit->ID; ?>);" />     onclick="ure_turn_deprecated_caps(user_to_edit->ID; ?>);"/>
lib->is_super_admin()) { ?>
show_primary_role_dropdown_list($this->user_to_edit->roles); } if (function_exists('bbp_filter_blog_editable_roles') ) { // bbPress plugin is active ?>
user_to_edit->ID); if (!empty($bbp_user_role)) { echo $dynamic_roles[$bbp_user_role]['name']; } } ?>
show_secondary_roles(); ?>
display_caps(false, $edit_user_caps_mode ); ?>