[ Index ]

MailPress 7.1

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

title

Body

[close]

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

   1  <?php
   2  
   3  if ( !( function_exists( 'current_user_can' ) && current_user_can( MP_AdminPage::capability ) ) ) die( 'Access denied' );
   4  
   5  global $wpdb, $mp_general, $mp_subscriptions;
   6  
   7  //
   8  // MANAGING H1
   9  //
  10  
  11  $h1 = __( 'MailPress Settings', 'MailPress' );
  12  
  13  //
  14  // MANAGING TABS
  15  //
  16  
  17  $divs = array();
  18  
  19  $_tabs = MP_AdminPage::get_tabs();
  20  
  21  $tab_active = ( isset( $mp_general['tab'] ) ) ? $mp_general['tab'] : 'general';
  22  
  23  if ( isset( MP_AdminPage::$pst_['_tab'] ) )
  24  {
  25      $no_error = true;
  26      $message = false;
  27  
  28      $mp_general['tab'] = $tab_active = MP_AdminPage::$pst_['_tab'];
  29  
  30      update_option( MailPress::option_name_general, $mp_general );
  31  
  32      $file = 'settings/' . MP_AdminPage::$pst_['_tab'] . '/update.php';
  33      include( $file );
  34  
  35      if ( !empty( MP_AdminPage::$err_mess ) ) 
  36      {
  37          foreach( MP_AdminPage::$err_mess as $message ) break;
  38          $no_error = false;
  39      }
  40  }
  41  else
  42  {
  43      $parms = MP_AdminPage::get_url_parms( array( 'tab' ) );
  44      if ( !empty( $parms ) && isset( $parms['tab'] ) )
  45      {
  46          $tab_active = $parms['tab'];
  47      }
  48  }
  49  ?>
  50  <div class="wrap">
  51      <h1>
  52          <?php echo esc_html( $h1 ); ?>
  53      </h1>
  54  <?php if ( isset( $message ) ) MP_AdminPage::message( $message, $no_error ); ?>
  55      <div id="settings-tabs">
  56          <ul>
  57  <?php 
  58      $i = $i_tab = 0;
  59      foreach( $_tabs as $_tab => $desc )
  60      {
  61          if ( $tab_active == $_tab ) $i_tab = $i;
  62          echo "\t\t\t" . '<li><a href="#fragment-' . $_tab . '" title="' . esc_attr( $desc ) . '"><span class="button-secondary">' . $desc . '</span></a></li>' . "\n";
  63          $i++;
  64      }
  65      wp_localize_script( MailPress_page_settings, 'MP_AdminPage_var', array( 'the_tab' => $i_tab, 'the_tab_name' => $tab_active ) );
  66  ?>
  67          </ul>
  68  <?php
  69      foreach( $_tabs as $_tab => $desc )
  70      {
  71  ?>
  72          <div class="fragments" id="fragment-<?php echo $_tab; ?>" data-tab="<?php echo $_tab; ?>">
  73  <?php 
  74          $file = 'settings/' . $_tab . '/form.php';
  75          include( $file );
  76  ?>
  77          </div>
  78  <?php
  79      }
  80  ?>
  81      </div>
  82  </div>


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