[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

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

   1  <?php
   2  if ( 'originals' === $kind ) {
   3      $gp_title = sprintf(
   4          /* translators: %s: Project name. */
   5          __( 'Import Originals &lt; %s &lt; GlotPress', 'glotpress' ),
   6          esc_html( $project->name )
   7      );
   8      $return_link = gp_url_project( $project );
   9      gp_breadcrumb_project( $project );
  10  } else {
  11      $gp_title = sprintf(
  12          /* translators: %s: Project name. */
  13          __( 'Import Translations &lt; %s &lt; GlotPress', 'glotpress' ),
  14          esc_html( $project->name )
  15      );
  16      $return_link = gp_url_project_locale( $project, $locale->slug, $translation_set->slug );
  17      gp_breadcrumb(
  18          array(
  19              gp_project_links_from_root( $project ),
  20              gp_link_get( $return_link, $translation_set->name ),
  21          )
  22      );
  23  }
  24  
  25  gp_title( $gp_title );
  26  gp_tmpl_header();
  27  ?>
  28  
  29  <h2><?php echo 'originals' == $kind ? __( 'Import Originals', 'glotpress' ) : __( 'Import Translations', 'glotpress' ); ?></h2>
  30  <form action="" method="post" enctype="multipart/form-data">
  31      <dl>
  32      <dt><label for="import-file"><?php _e( 'Import File:', 'glotpress' ); ?></label></dt>
  33      <dd><input type="file" name="import-file" id="import-file" /></dd>
  34  <?php
  35      $format_options         = array();
  36      $format_options['auto'] = __( 'Auto Detect', 'glotpress' );
  37      foreach ( GP::$formats as $slug => $format ) {
  38          $format_options[ $slug ] = $format->name;
  39      }
  40  
  41      $status_options = array();
  42      if ( isset( $can_import_current ) && $can_import_current ) {
  43          $status_options['current'] = __( 'Current', 'glotpress' );
  44      }
  45      if ( isset( $can_import_waiting ) && $can_import_waiting ) {
  46          $status_options['waiting'] = __( 'Waiting', 'glotpress' );
  47      }
  48  ?>
  49      <dt><label for="format"><?php _e( 'Format:', 'glotpress' ); ?></label></dt>
  50      <dd>
  51          <?php echo gp_select( 'format', $format_options, 'auto' ); ?>
  52      </dd>
  53  <?php if ( ! empty( $status_options ) ) : ?>
  54      <dt><label for="status"><?php _e( 'Status:', 'glotpress' ); ?></label></dt>
  55      <dd>
  56          <?php if ( count( $status_options ) === 1 ) : ?>
  57              <input type="hidden" name="status" value="<?php echo esc_attr( key( $status_options ) ); ?>" />
  58              <?php echo esc_html( reset( $status_options ) ); ?>
  59          <?php elseif ( count( $status_options ) > 1 ) : ?>
  60              <?php echo gp_select( 'status', $status_options, 'current' ); ?>
  61          <?php endif; ?>
  62      </dd>
  63  <?php endif; ?>
  64      <dt>
  65          <div class="button-group">
  66              <input class="button is-primary" type="submit" name="submit" value="<?php esc_attr_e( 'Import', 'glotpress' ); ?>" id="submit" />
  67              <a class="button is-link" href="<?php echo esc_url( $return_link ); ?>"><?php _e( 'Cancel', 'glotpress' ); ?></a>
  68          </div>
  69      </dt>
  70      </dl>
  71      <?php gp_route_nonce_field( ( 'originals' === $kind ? 'import-originals_' : 'import-translations_' ) . $project->id ); ?>
  72  </form>
  73  
  74  <?php
  75  gp_tmpl_footer();


Generated: Thu Nov 21 01:01:07 2024 Cross-referenced by PHPXref 0.7.1