[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

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

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


Generated: Tue Mar 19 01:01:50 2019 Cross-referenced by PHPXref 0.7.1