[ Index ]

MailPress 7.1

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

title

Body

[close]

/mp-admin/includes/ -> themes.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 = __( 'MailPress Themes', 'MailPress' ); 
  12  
  13  //
  14  // MANAGING LIST
  15  //
  16  
  17  $th = MP_AdminPage::get_list( array() );
  18  
  19  $themes = $th->themes;
  20  
  21  //
  22  // MANAGING MESSAGE / CHECKBOX RESULTS
  23  //
  24  
  25  switch (true)
  26  {
  27      case ( ! $th->validate_current_theme() ) :
  28          $message = __( 'The active MailPress theme is broken.  Reverting to the default MailPress theme.', 'MailPress' );
  29      break;
  30          case ( isset( MP_AdminPage::$get_['activated'] ) ) :
  31          $message = __( 'New MailPress theme activated.', 'MailPress' );
  32      break;
  33  }
  34  
  35  ?>
  36  <div class="wrap">
  37      <h1 class="wp-heading-inline">
  38          <?php echo esc_html( $h1 ); ?>
  39          <span class="title-count theme-count">
  40              <?php echo count( $themes ); ?>
  41          </span>
  42      </h1>
  43      <hr class="wp-header-end">
  44  
  45  <?php if ( isset( $message ) ) MP_AdminPage::message( $message ); ?>
  46  
  47      <div class="theme-browser rendered">
  48          <div class="themes wp-clearfix">
  49  <?php
  50  
  51  if ( $themes ) 
  52  {
  53      $active = true;
  54      foreach( $themes as $theme )
  55      {
  56          echo MP_AdminPage::get_row( $theme, $active );
  57          $active = false;
  58      }
  59  }
  60  ?>
  61          </div>
  62      </div>
  63  <?php
  64  // List broken themes, if any.
  65  $broken_themes = $th->get_broken_themes();
  66  if ( count( $broken_themes ) ) 
  67  {
  68  ?>
  69      <h2><?php _e( 'Broken Themes' ); ?></h2>
  70      <p><?php _e( 'The following themes are installed but incomplete.  Themes must have a stylesheet and a template.' ); ?></p>
  71  
  72      <table class="wp-list-table widefat fixed striped theme" width="100%">
  73          <thead>
  74              <tr>
  75                  <th><?php _e( 'Folder', 'MailPress' ); ?></th>
  76                  <th><?php _e( 'Name', 'MailPress' ); ?></th>
  77                  <th><?php _e( 'Description', 'MailPress' ); ?></th>
  78              </tr>
  79          </thead>
  80  <?php
  81      $class = '';
  82      foreach ( $broken_themes as $theme ) 
  83      {
  84          $class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
  85  ?>
  86          <tbody>
  87              <tr<?php echo $class;?>>
  88                   <td><?php echo $theme['Folder'];?></td>
  89                   <td><?php echo $theme['Title'];?></td>
  90                   <td><?php echo $theme['Description'];?></td>
  91              </tr>
  92          </tbody>
  93  <?php
  94      }
  95  ?>
  96      </table>
  97  <?php
  98  }
  99  ?>
 100  </div>


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