[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-templates/ -> glossary-entry-row.php (source)

   1  
   2  <tr class='view' data-id="<?php echo esc_attr( $entry->id ); ?>">
   3      <td><?php echo esc_html( $entry->term ); ?></td>
   4      <td><?php echo esc_html( $entry->part_of_speech ); ?></td>
   5      <td><?php echo esc_html( $entry->translation ); ?></td>
   6      <td><?php echo make_clickable( nl2br( esc_html( $entry->comment ) ) ); ?></td>
   7  
   8      <?php if ( $can_edit) : ?>
   9      <td class="actions">
  10          <ul>
  11              <li><a href="#" class="action edit"><?php _e( 'Details', 'glotpress' ); ?></a></li>
  12          </ul>
  13      </td>
  14      <?php endif; ?>
  15  </tr>
  16  <tr id="editor-<?php echo esc_attr( $entry->id ); ?>" class="hide-if-js editor">
  17      <td colspan="5">
  18          <div class="strings">
  19              <dl>
  20                  <dt><label for="glossary_entry_term_<?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Original term:', 'glossary entry', 'glotpress' ); ?></label></dt>
  21                  <dd><input type="text" name="glossary_entry[<?php echo esc_attr( $entry->id );?>][term]" id="glossary_entry_term_<?php echo esc_attr( $entry->id ); ?>" value="<?php echo esc_attr( $entry->term ); ?>"></dd>
  22                  <dt><label for="glossary_entry_post_<?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Part of speech', 'glossary entry', 'glotpress' ); ?></label></dt>
  23                  <dd><select name="glossary_entry[<?php echo esc_attr( $entry->id );?>][part_of_speech]" id="glossary_entry_pos_<?php echo esc_attr( $entry->id ); ?>">
  24                  <?php
  25                      foreach ( GP::$glossary_entry->parts_of_speech as $pos => $name ) {
  26                          $selected = $pos == $entry->part_of_speech ? " selected='selected'" : '';
  27                          echo "\t<option value='".esc_attr( $pos )."' $selected>" . esc_html( $name ) . "</option>\n";
  28                      }
  29                  ?>
  30                  </select></dd>
  31                  <dt><label for="glossary_entry_comments_<?php echo esc_attr( $entry->id ); ?><?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Comments', 'glossary entry', 'glotpress' ); ?></label></dt>
  32                  <dd><textarea type="text" name="glossary_entry[<?php echo esc_attr( $entry->id );?>][comment]" id="glossary_entry_comments_<?php echo esc_attr( $entry->id ); ?>"><?php echo esc_textarea( $entry->comment );?></textarea></dd>
  33                  <dt><label for="glossary_entry_translation_<?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Translation', 'glossary entry', 'glotpress' ); ?></label></dt>
  34                  <dd><input type="text" name="glossary_entry[<?php echo esc_attr( $entry->id );?>][translation]" id="glossary_entry_translation_<?php echo esc_attr( $entry->id ); ?>" value="<?php echo esc_attr( $entry->translation ); ?>"></dd>
  35              </dl>
  36              <p>
  37                  <input type="hidden" name="glossary_entry[<?php echo esc_attr( $entry->id );?>][glossary_id]" value="<?php echo esc_attr( $entry->glossary_id );?>">
  38                  <input type="hidden" name="glossary_entry[<?php echo esc_attr( $entry->id );?>][glossary_entry_id]" value="<?php echo esc_attr( $entry->id );?>">
  39                  <button class="action save" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edit-glossary-entry_' . $entry->id ) ); ?>"><?php _e( 'Save', 'glotpress' ); ?></button><span class="or-cancel"><?php _e( 'or', 'glotpress' ); ?> <a href="#" class="action cancel"><?php _e( 'Cancel', 'glotpress' ); ?></a></span>
  40              </p>
  41          </div>
  42  
  43          <div class="meta">
  44              <h3><?php _e( 'Meta', 'glotpress' ); ?></h3>
  45              <dl>
  46                  <dt><?php _e( 'Last Modified:', 'glotpress' ); ?></dt>
  47                  <dd><?php echo $entry->date_modified; ?></dd>
  48              </dl>
  49              <?php if ( $entry->user_login ): ?>
  50              <dl>
  51                  <dt><?php _x( 'By:','by author', 'glotpress' ); ?></dt>
  52                  <dd><?php
  53                  if ( $entry->user_display_name && $entry->user_display_name != $entry->user_login ) {
  54                      printf( '%s (%s)', $entry->user_display_name, $entry->user_login );
  55                  } else {
  56                      echo $entry->user_login;
  57                  }
  58                  ?></dd>
  59              </dl>
  60              <dl>
  61                  <dt><?php _e( 'Actions:', 'glotpress' ); ?></dt>
  62                  <dd>
  63                      <button class="delete" tabindex="-1" data-nonce="<?php echo esc_attr( wp_create_nonce( 'delete-glossary-entry_' . $entry->id ) ); ?>"><?php _ex( 'Delete', 'delete glossary entry', 'glotpress' ); ?></button>
  64                  </dd>
  65              </dl>
  66              <?php endif; ?>
  67          </div>
  68      </td>
  69  </tr>
  70  <?php //TODO: last modified, by who ?>


Generated: Tue Jan 22 01:02:31 2019 Cross-referenced by PHPXref 0.7.1