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


Generated: Fri Apr 26 01:01:24 2024 Cross-referenced by PHPXref 0.7.1