[ Index ]

MailPress 7.0.1

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

title

Body

[close]

/mp-includes/meta_boxes/post/ -> drafts.php (source)

   1  <?php
   2  global $wpdb;
   3  
   4  // drafts
   5  $results = $wpdb->get_results( $wpdb->prepare( "SELECT id, subject FROM $wpdb->mp_mails WHERE status = %s ORDER BY subject ASC;", 'draft' ) );
   6  if ( empty( $results ) )
   7  {
   8      _e( 'No results found.', 'MailPress' );
   9      return;
  10  }
  11  $x = new MP_Mail();
  12  foreach( $results as $draft ) $drafts[$draft->id] = $x->viewsubject( $draft->subject, $draft->id, $draft->id );
  13  unset( $results );
  14  
  15  // posts in drafts
  16  $post_drafts = MP_Post::get_term_objects( $post->ID );
  17  
  18  ?>
  19  <div id="mpdrafts">
  20      <ul id="mpdraftchecklist" class="list:mpdraft mpdraftchecklist" data-wp-lists="list:mpdraft">
  21  <?php
  22  
  23  if ( !empty( $post_drafts ) )
  24  {
  25      foreach( $post_drafts as $id )
  26      {
  27          if ( !isset( $drafts[$id] ) ) continue;
  28          echo MailPress_post::get_draft_row( $id, $drafts[$id] );
  29      }
  30  }
  31  ?>
  32      </ul>
  33  </div>
  34  <div id="mpdraft-adder" class="wp-hidden-children">
  35      <h4>
  36          <a id="mpdraft-add-toggle" class="hide-if-no-js" href="#mpdraft-add"><?php _e( '+ Add New Draft', 'MailPress' ); ?></a> 
  37      </h4>
  38      <p id="mpdraft-add" class="wp-hidden-child">
  39          <select name="newmpdraft" id="newmpdraft" style="width:100%;font-size:11px;height:2em;padding:2px;">
  40  <?php
  41  foreach( $drafts as $k => $v )
  42  {
  43  ?>
  44              <option id="newmpdraft-<?php echo $k; ?>" value="<?php echo $k; ?>"><?php echo $v; ?></option>
  45  <?php
  46  }
  47  ?>
  48          </select>
  49          <input type="button" id="mpdraft-add-submit" class="add:mpdraftchecklist:mpdraft-add button" data-wp-lists="add:mpdraftchecklist:mpdraft-add button" value="<?php echo esc_attr( __( 'Add', 'MailPress' ) ); ?>" tabindex="3" />
  50  <?php    wp_nonce_field( 'add-mpdraft', '_ajax_nonce', false ); ?>
  51          <span id="mpdraft-ajax-response"></span>
  52      </p>
  53  </div>


Generated: Mon Jan 28 00:07:10 2019 Cross-referenced by PHPXref 0.7.1