[ Index ]

MailPress 7.1

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

title

Body

[close]

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

   1  <?php
   2  
   3  if ( !( function_exists( 'current_user_can' ) && current_user_can( MP_AdminPage::capability ) ) ) die( 'Access denied' );
   4  
   5  $url_parms = MP_AdminPage::get_url_parms();
   6  
   7  //
   8  // MANAGING H1
   9  //
  10  
  11  $h1 = __( 'Logs', 'MailPress' );
  12  
  13  //
  14  // MANAGING MESSAGE / CHECKBOX RESULTS
  15  //
  16  
  17  $results = array(    'deleted'    =>     array(     's' => __( '%s file deleted', 'MailPress' ), 
  18                                      'p' => __( '%s files deleted', 'MailPress' ) 
  19                              ),
  20  );
  21  
  22  foreach ( $results as $k => $v )
  23  {
  24      if ( isset( MP_AdminPage::$get_[$k] ) && MP_AdminPage::$get_[$k] )
  25      {
  26          if ( !isset( $message ) ) 
  27          {
  28              $message = '';
  29          }
  30          $message .= sprintf( _n( $v['s'], $v['p'], MP_AdminPage::$get_[$k] ), MP_AdminPage::$get_[$k] );
  31          $message .=  '<br />';
  32      }
  33  }
  34  
  35  //
  36  // MANAGING BULK ACTIONS
  37  //
  38  
  39  $bulk_actions['']        = __( 'Bulk Actions' );
  40  $bulk_actions['delete']    = __( 'Delete', 'MailPress' );
  41  
  42  //
  43  // MANAGING LIST
  44  //
  45  
  46  $url_parms['paged'] = isset( $url_parms['paged'] ) ? $url_parms['paged'] : 1;
  47  $_per_page = MP_AdminPage::get_per_page();
  48  
  49  do
  50  {
  51      $start = ( $url_parms['paged'] - 1 ) * $_per_page;
  52      list( $items, $total, $subsubsub_urls ) = MP_AdminPage::get_list( array( 'start' => $start, '_per_page' => $_per_page, 'url_parms' => $url_parms ) );
  53      $url_parms['paged']--;
  54  } while ( $total <= $start );
  55  $url_parms['paged']++;
  56  
  57  ?>
  58  <div class="wrap">
  59      <h1>
  60          <?php echo esc_html( $h1 ); ?> 
  61  <?php if ( isset( $url_parms['s'] ) ) printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_attr( $url_parms['s'] ) ); ?>
  62      </h1>
  63  <?php if ( isset( $message ) ) MP_AdminPage::message( $message ); ?>
  64  
  65      <ul class="subsubsub"><?php echo $subsubsub_urls; ?></ul>
  66  
  67      <form id="posts-filter" method="get">
  68  
  69          <input type="hidden" name="page" value="<?php echo MP_AdminPage::screen; ?>" />
  70  
  71          <p class="search-box">
  72              <input type="text" name="s" class="search-input" value="<?php if ( isset( $url_parms['s'] ) ) echo esc_attr( $url_parms['s'] ); ?>" />
  73              <input type="submit" class="button" value="<?php _e( 'Search', 'MailPress' ); ?>" />
  74          </p>
  75  <?php
  76  if ( $items )
  77  {
  78  ?>
  79          <div class="tablenav top">
  80              <div class="alignleft actions bulkactions">
  81  <?php    MP_AdminPage::get_bulk_actions( $bulk_actions ); ?>
  82              </div>
  83  
  84  <?php MP_AdminPage::pagination( $total ); ?>
  85  
  86              <br class="clear" />
  87          </div>
  88          <div class="clear"></div>
  89  
  90          <table class="wp-list-table widefat fixed striped zyxw">
  91              <thead>
  92                  <tr>
  93  <?php MP_AdminPage::columns_list(); ?>
  94                    </tr>
  95              </thead>
  96              <tbody id="the-file-list" class="list:file">
  97  <?php    foreach ( $items as $item ) echo MP_AdminPage::get_row( $item, $url_parms ); ?>
  98              </tbody>
  99              <tfoot>
 100                  <tr>
 101  <?php MP_AdminPage::columns_list( false ); ?>
 102                    </tr>
 103              </tfoot>
 104          </table>
 105          <div class="tablenav bottom">
 106  <?php MP_AdminPage::pagination( $total, 'bottom' ); ?>
 107              <div class="alignleft actions bulkactions">
 108  <?php    MP_AdminPage::get_bulk_actions( $bulk_actions, 'action2' ); ?>
 109              </div>
 110              <br class="clear" />
 111          </div>
 112      </form>
 113  
 114      <form id="get-extra-files" method="post" class="hidden add:the-extra-file-list:">
 115  
 116  <?php  MP_AdminPage::post_url_parms( ( array ) $url_parms ); ?>
 117  <?php wp_nonce_field( 'add-file', '_ajax_nonce', false ); ?>
 118  
 119      </form>
 120  
 121      <div id="ajax-response"></div>
 122  <?php
 123  }
 124  else
 125  {
 126  ?>
 127      </form>
 128      <p>
 129          <?php ( is_dir( '../' . MP_AdminPage::get_path() ) ) ? _e( 'No logs available', 'MailPress' ) : printf( __( 'Wrong path : %s', 'MailPress' ), '../' . MP_AdminPage::get_path() ); ?>
 130      </p>
 131  <?php
 132  }
 133  ?>
 134  </div>


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