[ Index ]

MailPress 7.1

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

title

Body

[close]

/mp-includes/class/options/dashboard/widgets/ -> recent_archives.php (source)

   1  <?php
   2  global $mp_mails;
   3  $mp_mails = new MP_Query();
   4  $mp_mails->query();
   5  if ( $mp_mails->mail_count )
   6  {
   7  class MP_Dashboard_recent_archives extends MP_WP_Dashboard_widget_
   8  {
   9      var $id = 'mp_recent_archives';
  10  
  11  	function __construct( $name )
  12      {
  13          wp_register_script( 'mp-thickbox',         '/' . MP_PATH . 'mp-includes/js/mp_thickbox.js', array( 'thickbox' ), false, 1 );
  14          wp_enqueue_script ( 'mp-thickbox' );
  15  
  16          parent::__construct( $name );
  17      }
  18  
  19  	function widget()
  20      {
  21          global $mp_mails;
  22          $i = 0;
  23  ?>
  24  <ul>
  25  <?php             
  26          while ( $mp_mails->have_mails() ) : $mp_mails->the_mail();
  27              $args = array( 'id' => $mp_mails->get_the_ID(), 'action' => 'mp_ajax', 'mp_action' => 'iview', 'TB_iframe' => 'true' );
  28              $view_url = esc_url( add_query_arg( $args, admin_url( 'admin-ajax.php' ) ) );    
  29  ?>
  30      <li id="mail-<?php $mp_mails->the_ID(); ?>">
  31          <h4 style="font-weight:normal;">
  32              <a class="thickbox thickbox-preview" title="<?php _e( 'View', 'MailPress' ); ?>" href="<?php echo $view_url; ?>" >
  33                  <?php $mp_mails->the_subject(); ?>
  34              </a>
  35              <abbr title="<?php $mp_mails->the_date( 'Y/m/d g:i:s A' ); ?>" style="color:#999;font-family:'Lucida Grande',Verdana,Arial,'Bitstream Vera Sans',sans-serif;font-size:11px;margin-left:3px;">
  36                  <?php $mp_mails->the_date(); ?>
  37              </abbr>
  38          </h4>
  39          <p style="margin:0;padding:0;">
  40          <?php $mp_mails->the_Theme(); ?> ( <?php $mp_mails->the_Template(); ?> )
  41          </p>
  42      </li>
  43  <?php
  44              $i++;
  45              if ( $i == 10 ) break;    
  46          endwhile;
  47  ?>
  48  </ul>
  49  <p class="textright">
  50      <a class="button" href="<?php echo esc_url( add_query_arg( 'status', archived, MailPress_mails ) ); ?>">
  51          <?php _e( 'View all' ); ?>
  52      </a>
  53  </p>
  54  <?php
  55      }
  56  }
  57  new MP_Dashboard_recent_archives( __( 'MailPress - Recent Archives', 'MailPress' ) );
  58  }


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