[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-templates/ -> project-permissions.php (source)

   1  <?php
   2  gp_title( sprintf( __( 'Permissions &lt; %s &lt; GlotPress', 'glotpress' ), $project->name ) );
   3  gp_breadcrumb_project( $project );
   4  gp_tmpl_header();
   5  ?>
   6  <h2><?php _e( 'Permissions', 'glotpress' ); ?></h2>
   7  <h3 id="validators">
   8      <?php _e( 'Validators', 'glotpress' ); ?>
   9      <?php if ( count( $permissions ) + count( $parent_permissions ) > 10 ): ?>
  10      <a href="#add" onclick="jQuery('#user_login').focus(); return false;" class="secondary"><?php _e( 'Add', 'glotpress' ); ?> &rarr;</a>
  11      <?php endif; ?>
  12  </h3>
  13      <?php if ( $permissions ): ?>
  14      <?php if ( $parent_permissions ): ?>
  15  <h4 id="validators"><?php _e( 'Validators for this project', 'glotpress' ); ?></h4>
  16      <?php endif; ?>
  17  
  18      <table class="permissions">
  19          <thead>
  20              <tr>
  21                  <th><?php _e( 'User', 'glotpress' ); ?></th>
  22                  <th><?php _e( 'Permission', 'glotpress' ); ?></th>
  23                  <th><?php _e( 'Locale', 'glotpress' ); ?></th>
  24                  <th><?php _e( 'Slug', 'glotpress' ); ?></th>
  25                  <th>&mdash;</th>
  26              </tr>
  27          </thead>
  28          <tbody>
  29              <?php foreach ( $permissions as $permission ) : ?>
  30                  <tr>
  31                      <td><?php printf( '<a href="%s">%s</a>', esc_url( gp_url_profile( $permission->user->user_nicename ) ), esc_html( $permission->user->user_login ) ); ?></td>
  32                      <td><?php echo esc_html( $permission->action ); ?></td>
  33                      <td><?php echo esc_html( $permission->locale_slug ); ?></td>
  34                      <td><?php echo esc_html( $permission->set_slug ); ?></td>
  35                      <td><a href="<?php echo esc_url( gp_route_nonce_url( gp_url_join( gp_url_current(), '-delete/' . $permission->id ), 'delete-project-permission_' . $permission->id ) ); ?>" class="action delete"><?php _e( 'Delete', 'glotpress' ); ?></a></td>
  36                  </tr>
  37              <?php endforeach; ?>
  38          </tbody>
  39      </table>
  40      <?php endif; ?>
  41      <?php  if ( $parent_permissions ) : ?>
  42  <h4 id="validators"><?php _e( 'Validators for parent projects', 'glotpress' ); ?></h4>
  43      <table class="permissions">
  44          <thead>
  45              <tr>
  46                  <th><?php _e( 'User', 'glotpress' ); ?></th>
  47                  <th><?php _e( 'Permission', 'glotpress' ); ?></th>
  48                  <th><?php _e( 'Locale', 'glotpress' ); ?></th>
  49                  <th><?php _e( 'Slug', 'glotpress' ); ?></th>
  50                  <th><?php _e( 'Parent', 'glotpress' ); ?></th>
  51              </tr>
  52          </thead>
  53          <tbody>
  54              <?php foreach ( $parent_permissions as $permission ) : ?>
  55                  <tr>
  56                      <td><?php printf( '<a href="%s">%s</a>', esc_url( gp_url_profile( $permission->user->user_nicename ) ), esc_html( $permission->user->user_login ) ); // WPCS: XSS ok. ?></td>
  57                      <td><?php echo esc_html( $permission->action ); ?></td>
  58                      <td><?php echo esc_html( $permission->locale_slug ); ?></td>
  59                      <td><?php echo esc_html( $permission->set_slug ); ?></td>
  60                      <td><?php gp_link_project( $permission->project, esc_html( $permission->project->name ) ); ?></td>
  61                  </tr>
  62              <?php endforeach; ?>
  63          </tbody>
  64      </table>
  65      <?php endif; ?>
  66      <?php if ( ! $permissions && !$parent_permissions ): ?>
  67          <strong><?php _e( 'No validators defined for this project.', 'glotpress' ); ?></strong>
  68      <?php endif; ?>
  69  <form action="" method="post" class="secondary">
  70      <h3 id="add"><?php _e( 'Add a validator for this project', 'glotpress' ); ?></h3>
  71      <dl>
  72          <dt><label for="user_login"><?php _e( 'Username:', 'glotpress' ); ?></label></dt>
  73          <dd><input type="text" name="user_login" value="" id="user_login" /></dd>
  74          <dt><label for="locale"><?php _e( 'Locale:', 'glotpress' ); ?></label></dt>
  75          <dd><?php echo gp_locales_by_project_dropdown( $project->id, 'locale' ); ?></dd>
  76          <dt><label for="set-slug"><?php _e( 'Translation set slug:', 'glotpress' ); ?></label></dt>
  77          <dd><input type="text" name="set-slug" value="default" id="set-slug" /></dd>
  78  
  79          <dt>
  80              <input type="submit" name="submit" value="<?php esc_attr_e( 'Add', 'glotpress' ); ?>" id="submit" />
  81              <input type="hidden" name="action" value="add-validator" />
  82          </dt>
  83          <?php gp_route_nonce_field( 'add-project-permissions_' . $project->id ); ?>
  84  </form>
  85  <?php
  86  gp_tmpl_footer();


Generated: Thu Mar 21 01:01:48 2019 Cross-referenced by PHPXref 0.7.1