[ Index ]

MailPress 7.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/includes/ -> revision.php (source)

   1  <?php
   2  
   3  if ( !( function_exists( 'current_user_can' ) && current_user_can( MP_AdminPage::capability ) ) ) die( 'Access denied' );
   4  
   5  $id        = absint( MP_AdminPage::$get_['id'] );
   6  $mail     = MP_Mail::get( $id );
   7  
   8  //
   9  // MANAGING H1
  10  //
  11  
  12  $edit_url        = esc_url( add_query_arg( 'id', $id, MailPress_edit ) );
  13  $mail_title    = '<a href="' . $edit_url . '">' . $mail->subject . '</a>';
  14  $return_to_edit    = '<a href="' . $edit_url . '">' . __( '&larr; Return to editor' ) . '</a>';
  15  
  16  $h1 = sprintf( __( 'Compare Revisions of &#8220;%1$s&#8221;' ), $mail_title );
  17  
  18  ?>
  19  <div class="wrap">
  20      <h1 class="long-header">
  21          <?php echo $h1; ?>
  22      </h1>
  23      <?php echo $return_to_edit; ?>
  24  </div>
  25  <script id="tmpl-revisions-frame" type="text/html">
  26      <div class="revisions-control-frame"></div>
  27      <div class="revisions-diff-frame"></div>
  28  </script>
  29  
  30  <script id="tmpl-revisions-buttons" type="text/html">
  31      <div class="revisions-previous">
  32          <input type="button" class="button" value="<?php echo esc_attr( _x( 'Previous', 'Button label for a previous revision' ) ); ?>" />
  33      </div>
  34  
  35      <div class="revisions-next">
  36          <input type="button" class="button" value="<?php echo esc_attr( _x( 'Next', 'Button label for a next revision' ) ); ?>" />
  37      </div>
  38  </script>
  39  
  40  <script id="tmpl-revisions-checkbox" type="text/html">
  41      <div class="revision-toggle-compare-mode">
  42          <label>
  43              <input type="checkbox" class="compare-two-revisions"
  44              <#
  45              if ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) {
  46                  #> checked="checked"<#
  47              }
  48              #>
  49              />
  50              <?php esc_html( _e( 'Compare any two revisions' ) ); ?>
  51          </label>
  52      </div>
  53  </script>
  54  
  55  <script id="tmpl-revisions-meta" type="text/html">
  56      <# if ( ! _.isUndefined( data.attributes ) ) { #>
  57          <div class="diff-title">
  58          <# if ( 'from' === data.type ) { #>
  59              <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
  60          <# } else if ( 'to' === data.type ) { #>
  61              <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
  62          <# } #>
  63          <div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
  64              {{{ data.attributes.author.avatar }}}
  65              <div class="author-info">
  66              <# if ( data.attributes.autosave ) { #>
  67                  <span class="byline"><?php printf( __( 'Autosave by %s' ),
  68                      '<span class="author-name">{{ data.attributes.author.name }}</span>' ); ?></span>
  69              <# } else if ( data.attributes.current ) { #>
  70                  <span class="byline"><?php printf( __( 'Current Revision by %s' ),
  71                      '<span class="author-name">{{ data.attributes.author.name }}</span>' ); ?></span>
  72                  <# } else { #>
  73                      <span class="byline"><?php printf( __( 'Revision by %s' ),
  74                          '<span class="author-name">{{ data.attributes.author.name }}</span>' ); ?></span>
  75                  <# } #>
  76                      <span class="time-ago">{{ data.attributes.timeAgo }}</span>
  77                      <span class="date">( {{ data.attributes.dateShort }} )</span>
  78                  </div>
  79              <# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
  80                  <input  <?php if ( MP_Mail_lock::check( $mail->id ) ) { ?>
  81                      disabled="disabled"
  82                  <?php } else { ?>
  83                      <# if ( data.attributes.current ) { #>
  84                          disabled="disabled"
  85                      <# } #>
  86                  <?php } ?>
  87                  <# if ( data.attributes.autosave ) { #>
  88                      type="button" class="restore-revision button button-primary" value="<?php echo esc_attr( __( 'Restore This Autosave' ) ); ?>" />
  89                  <# } else { #>
  90                      type="button" class="restore-revision button button-primary" value="<?php echo esc_attr( __( 'Restore This Revision' ) ); ?>" />
  91                  <# } #>
  92              <# } #>
  93          </div>
  94      <# if ( 'tooltip' === data.type ) { #>
  95          <div class="revisions-tooltip-arrow"><span></span></div>
  96      <# } #>
  97  <# } #>
  98  </script>
  99  
 100  <script id="tmpl-revisions-diff" type="text/html">
 101      <div class="loading-indicator"><span class="spinner"></span></div>
 102      <div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
 103      <div class="diff">
 104      <# _.each( data.fields, function( field ) { #>
 105          <h3>{{ field.name }}</h3>
 106          {{{ field.diff }}}
 107      <# } ); #>
 108      </div>
 109  </script>


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1