[ 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          <ul>
  16              <li><a href="#" class="action edit"><?php _e( 'Details', 'glotpress' ); ?></a></li>
  17          </ul>
  18      </td>
  19      <?php endif; ?>
  20  </tr>
  21  <tr id="editor-<?php echo esc_attr( $entry->id ); ?>" class="hide-if-js editor">
  22      <td colspan="5">
  23          <div class="strings">
  24              <dl>
  25                  <dt><label for="glossary_entry_term_<?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Original term:', 'glossary entry', 'glotpress' ); ?></label></dt>
  26                  <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>
  27                  <dt><label for="glossary_entry_post_<?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Part of speech', 'glossary entry', 'glotpress' ); ?></label></dt>
  28                  <dd><select name="glossary_entry[<?php echo esc_attr( $entry->id ); ?>][part_of_speech]" id="glossary_entry_pos_<?php echo esc_attr( $entry->id ); ?>">
  29                  <?php
  30                      foreach ( GP::$glossary_entry->parts_of_speech as $pos => $name ) {
  31                          echo "\t<option value='" . esc_attr( $pos ) . "'" . selected( $entry->part_of_speech, $pos ) . '>' . esc_html( $name ) . "</option>\n";
  32                      }
  33                  ?>
  34                  </select></dd>
  35                  <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>
  36                  <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>
  37                  <dt><label for="glossary_entry_translation_<?php echo esc_attr( $entry->id ); ?>"><?php _ex( 'Translation', 'glossary entry', 'glotpress' ); ?></label></dt>
  38                  <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>
  39              </dl>
  40              <p>
  41                  <input type="hidden" name="glossary_entry[<?php echo esc_attr( $entry->id ); ?>][glossary_id]" value="<?php echo esc_attr( $entry->glossary_id ); ?>">
  42                  <input type="hidden" name="glossary_entry[<?php echo esc_attr( $entry->id ); ?>][glossary_entry_id]" value="<?php echo esc_attr( $entry->id ); ?>">
  43                  <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>
  44              </p>
  45          </div>
  46  
  47          <div class="meta">
  48              <h3><?php _e( 'Meta', 'glotpress' ); ?></h3>
  49              <dl>
  50                  <dt><?php _e( 'Last Modified:', 'glotpress' ); ?></dt>
  51                  <dd><?php echo esc_html( $entry->date_modified ); ?></dd>
  52              </dl>
  53              <?php if ( $entry->user_login ) : ?>
  54              <dl>
  55                  <dt><?php _ex( 'By:', 'by author', 'glotpress' ); ?></dt>
  56                  <dd>
  57                      <?php
  58                      if ( $entry->user_display_name && $entry->user_display_name !== $entry->user_login ) {
  59                          printf(
  60                              '%s (%s)',
  61                              esc_html( $entry->user_display_name ),
  62                              esc_html( $entry->user_login )
  63                          );
  64                      } else {
  65                          echo esc_html( $entry->user_login );
  66                      }
  67                      ?>
  68                  </dd>
  69              </dl>
  70              <dl>
  71                  <dt><?php _e( 'Actions:', 'glotpress' ); ?></dt>
  72                  <dd>
  73                      <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>
  74                  </dd>
  75              </dl>
  76              <?php endif; ?>
  77          </div>
  78      </td>
  79  </tr>


Generated: Fri Sep 25 01:01:51 2020 Cross-referenced by PHPXref 0.7.1