[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/includes/settings/roles_and_capabilities/ -> form.php (source)

   1  <?php // roles_and_capabilities
   2  global $wp_roles;
   3  
   4  $capabilities = MailPress::capabilities();
   5  $capability_groups = MailPress::capability_groups();
   6  $grouping_cap = array();
   7  foreach ( $capabilities as $capability => $v )    $grouping_cap[$v['group']] [$capability] = null;
   8  
   9  ?>
  10  <form name="<?php echo basename(__DIR__); ?>" method="post" class="mp_settings">
  11      <input type="hidden" name="_tab" value="<?php echo basename(__DIR__); ?>" />
  12      <table class="form-table rc-table">
  13  
  14  
  15          <tr>
  16              <th></th>
  17  <?php
  18  foreach( $wp_roles->role_names as $role => $name )
  19  {
  20      if ( 'administrator' == $role ) continue;
  21      $name = __( $name );
  22  ?>
  23              <th><?php echo $name; ?></th>
  24  <?php
  25  }
  26  ?>
  27          </tr>
  28  <?php
  29  $prev_groupname = false;
  30  foreach ( $capability_groups as $group => $groupname )
  31  {
  32      if ( !isset( $grouping_cap[$group] ) ) continue;
  33  
  34      $class = ' class="mp_sep"';
  35  
  36      foreach ( $grouping_cap[$group] as $capability => $v )
  37      {
  38          $capname = $capabilities[$capability]['name'];
  39  ?>
  40          <tr<?php echo $class; $class = ''; ?>>
  41              <th><?php if ( $prev_groupname != $groupname ) {$prev_groupname = $groupname; echo $groupname;} ?></th>
  42  <?php
  43          foreach( $wp_roles->role_names as $role => $name )
  44          {
  45              if ( 'administrator' == $role ) continue;
  46              $rcs = get_option( 'MailPress_r&c_' . $role );
  47  ?>
  48              <td class="capacity">
  49                  <label for="<?php echo 'check_' . $role . '_' . $capability; ?>">
  50                      <input type="checkbox" name="cap[<?php echo $role; ?>][<?php echo $capability; ?>]" id="<?php echo 'check_' . $role . '_' . $capability; ?>"<?php checked( isset( $rcs[$capability] ) ); ?> />
  51                      <span id="<?php echo $role . '_' . $capability; ?>" class="<?php echo ( isset( $rcs[$capability] ) ) ? 'crok' : 'crko'; ?>"><?php echo $capname; ?></span>
  52                  </label>
  53              </td>
  54  <?php
  55          }
  56  ?>
  57          </tr>
  58  <?php
  59      }
  60  }
  61  ?>
  62  
  63      </table>
  64  
  65  <?php MP_AdminPage::save_button(); ?>
  66  
  67  </form>


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1