Esempio n. 1
0
    /**
     * Outputs the page.
     *
     * @since  1.0.0
     * @access public
     * @return void
     */
    public function page()
    {
        ?>

		<div class="wrap">

			<h1><?php 
        !$this->is_clone ? esc_html_e('Add New Role', 'members') : esc_html_e('Clone Role', 'members');
        ?>
</h1>

			<?php 
        settings_errors('members_role_new');
        ?>

			<div id="poststuff">

				<form name="form0" method="post" action="<?php 
        echo esc_url(members_get_new_role_url());
        ?>
">

					<?php 
        wp_nonce_field('new_role', 'members_new_role_nonce');
        ?>

					<div id="post-body" class="metabox-holder columns-<?php 
        echo 1 == get_current_screen()->get_columns() ? 1 : 2;
        ?>
">

						<div id="post-body-content">

							<div id="titlediv" class="members-title-div">

								<div id="titlewrap">
									<span class="screen-reader-text"><?php 
        esc_html_e('Role Name', 'members');
        ?>
</span>
									<input type="text" name="role_name" value="<?php 
        echo !$this->role && $this->clone_role ? esc_attr(sprintf(__('%s Clone', 'members'), members_get_role_name($this->clone_role))) : esc_attr($this->role_name);
        ?>
" placeholder="<?php 
        esc_attr_e('Enter role name', 'members');
        ?>
" />
								</div><!-- #titlewrap -->

								<div class="inside">
									<div id="edit-slug-box">
										<strong><?php 
        esc_html_e('Role:', 'members');
        ?>
</strong> <span class="role-slug"><?php 
        echo !$this->role && $this->clone_role ? esc_attr("{$this->clone_role}_clone") : esc_attr($this->role);
        ?>
</span> <!-- edit box -->
										<input type="text" name="role" value="<?php 
        echo members_sanitize_role($this->role);
        ?>
" />
										<button type="button" class="role-edit-button button button-small closed"><?php 
        esc_html_e('Edit', 'members');
        ?>
</button>
									</div>
								</div><!-- .inside -->

							</div><!-- .members-title-div -->

							<?php 
        $cap_tabs = new Members_Cap_Tabs('', $this->capabilities);
        ?>
							<?php 
        $cap_tabs->display();
        ?>

						</div><!-- #post-body-content -->

						<?php 
        wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
        ?>
						<?php 
        wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
        ?>

						<div id="postbox-container-1" class="postbox-container side">

							<?php 
        do_meta_boxes(get_current_screen()->id, 'side', '');
        ?>

						</div><!-- .post-box-container -->

					</div><!-- #post-body -->
				</form>

			</div><!-- #poststuff -->

		</div><!-- .wrap -->

	<?php 
    }
    /**
     * Displays the page content.
     *
     * @since  1.0.0
     * @access public
     * @return void
     */
    public function page()
    {
        ?>

		<div class="wrap">

			<h1>
				<?php 
        esc_html_e('Edit Role', 'members');
        ?>

				<?php 
        if (current_user_can('create_roles')) {
            ?>
					<?php 
            printf('<a class="page-title-action" href="%s">%s</a>', esc_url(members_get_new_role_url()), esc_html__('Add New', 'members'));
            ?>
				<?php 
        }
        ?>
			</h1>

			<?php 
        settings_errors('members_edit_role');
        ?>

			<div id="poststuff">

				<form name="form0" method="post" action="<?php 
        echo esc_url(members_get_edit_role_url($this->role->name));
        ?>
">

					<?php 
        wp_nonce_field('edit_role', 'members_edit_role_nonce');
        ?>

					<div id="post-body" class="metabox-holder columns-<?php 
        echo 1 == get_current_screen()->get_columns() ? 1 : 2;
        ?>
">

						<div id="post-body-content">

							<div id="titlediv" class="members-title-div">

								<div id="titlewrap">
									<span class="screen-reader-text"><?php 
        esc_html_e('Role Name', 'members');
        ?>
</span>
									<input type="text" disabled="disabled" readonly="readonly" value="<?php 
        echo esc_attr(members_get_role_name($this->role->name));
        ?>
" />
								</div><!-- #titlewrap -->

								<div class="inside">
									<div id="edit-slug-box">
										<strong><?php 
        esc_html_e('Role:', 'members');
        ?>
</strong> <?php 
        echo esc_attr($this->role->name);
        ?>
 <!-- edit box -->
									</div>
								</div><!-- .inside -->

							</div><!-- .members-title-div -->

							<?php 
        $cap_tabs = new Members_Cap_Tabs($this->role->name);
        ?>
							<?php 
        $cap_tabs->display();
        ?>

						</div><!-- #post-body-content -->

						<?php 
        wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
        ?>
						<?php 
        wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
        ?>

						<div id="postbox-container-1" class="postbox-container side">

							<?php 
        do_meta_boxes(get_current_screen()->id, 'side', $this->role);
        ?>

						</div><!-- .post-box-container -->

					</div><!-- #post-body -->
				</form>

			</div><!-- #poststuff -->

		</div><!-- .wrap -->
	<?php 
    }