[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/gp-templates/ -> note.php (source)

   1  <?php
   2  /**
   3   * Template for the single note side by the editor
   4   *
   5   * @package    GlotPress
   6   * @subpackage Templates
   7   */
   8  
   9  $can_edit = GP::$permission->current_user_can( 'admin', 'notes', $translation->id );
  10  $note     = GP::$notes->get( $note->id );
  11  ?>
  12  <div class="note">
  13      <?php gp_link_user( get_userdata( $note->user_id ) ); ?>
  14      <?php _e( 'Commented', 'glotpress' ); ?>
  15      <span class="date">
  16          <?php
  17              /* translators: How much time before was sent the note */
  18              echo esc_html( sprintf( __( '%s ago', 'glotpress' ), human_time_diff( strtotime( $note->date_added ), time() ) ) );
  19          ?>
  20      </span>
  21      <?php if ( $can_edit || get_current_user_id() === (int) $note->user_id ) : ?>
  22          <button class="note-actions" ><?php _e( 'edit', 'glotpress' ); ?></button>
  23      <?php endif; ?>
  24      <div class="note-body">
  25          <?php echo make_clickable( nl2br( esc_html( $note->note ) ) ); // WPCS: XSS ok. ?>
  26      </div>
  27      <?php if ( $can_edit || get_current_user_id() === (int) $note->user_id ) : ?>
  28      <div class="note-body edit-note-body" style="display: none;">
  29          <textarea autocomplete="off" class="foreign-text" name="edit-note[<?php echo esc_attr( $note->id ); ?>]" id="edit-note-<?php echo esc_attr( $note->id ); ?>"><?php echo esc_html( $note->note ); ?></textarea>
  30          <button class="update-note" tabindex="-1" data-note-id="<?php echo esc_attr( $note->id ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edit-note-' . $note->id ) ); ?>">
  31              <?php esc_attr_e( 'Update Note', 'glotpress' ); ?>
  32          </button>
  33          <button class="update-cancel" tabindex="-1">
  34              <?php esc_attr_e( 'Cancel', 'glotpress' ); ?>
  35          </button>
  36          <button class="delete-note" tabindex="-1" data-note-id="<?php echo esc_attr( $note->id ); ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'delete-note-' . $note->id ) ); ?>">
  37              <?php esc_attr_e( 'Delete', 'glotpress' ); ?>
  38          </button>
  39      </div>
  40      <?php endif; ?>
  41  </div>


Generated: Fri Apr 17 01:01:46 2020 Cross-referenced by PHPXref 0.7.1