[ Index ]

MailPress 544

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

title

Body

[close]

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

   1  <?php
   2  global $wpdb, $mp_general, $mp_subscriptions;
   3  
   4  $_tabs['general'] = __('General', MP_TXTDOM);
   5  
   6  if (isset($_POST['formname']))
   7  {
   8      $form_invalid = 'form-invalid';
   9      $no_error = true;
  10  
  11      if (substr($_POST['formname'], -5) == '.form') include('settings/' . substr($_POST['formname'], 0, -5) . '.php');
  12  }
  13  
  14  if ($mp_general)
  15  {
  16      $t = apply_filters('MailPress_Swift_Connection_type', 'SMTP');
  17      $_tabs['connection_' . strtolower($t)] = $t;
  18      $_tabs = apply_filters('MailPress_settings_tab_connection', $_tabs);
  19  
  20      $_tabs['test'] = __('Test', MP_TXTDOM);
  21  
  22      $_tabs = apply_filters('MailPress_settings_tab', $_tabs);
  23  
  24      $_tabs['logs'] = __('Logs', MP_TXTDOM);
  25  }
  26  
  27  $tab_active = (isset($mp_general['tab'])) ? $mp_general['tab'] : 'general';
  28  if (!isset($_POST['formname']))
  29  {
  30      $parms = MP_AdminPage::get_url_parms(array('tab'));
  31      if (!empty($parms) && isset($parms['tab'])) $tab_active = $parms['tab'];
  32  }
  33  
  34  $divs = array();
  35  ?>
  36  <div class='wrap'>
  37      <div id='icon-mailpress-settings' class='icon32'><br /></div>
  38      <h1><?php _e('MailPress Settings', MP_TXTDOM); ?></h1>
  39  <?php if (isset($message)) MP_AdminPage::message($message, $no_error); ?>
  40      <div id='settings-tabs'>
  41          <ul>
  42  <?php 
  43      $i = $i_tab = 0;
  44      foreach($_tabs as $_tab => $desc)
  45      {
  46          if ($tab_active == $_tab) $i_tab = $i;
  47          echo "\t\t\t<li style='float:left;' ><a href='#fragment-$_tab' title='" . esc_attr($desc) . "'><span class='button-secondary'>$desc</span></a></li>\n";
  48          $i++;
  49      }
  50      wp_localize_script( MailPress_page_settings, 'MP_AdminPage_var', array( 'the_tab' => $i_tab ) );
  51  ?>
  52          </ul>
  53  <?php
  54      foreach($_tabs as $_tab => $desc)
  55      {
  56  ?>
  57          <div class='fragments' id='fragment-<?php echo $_tab; ?>'>
  58              <?php include("settings/$_tab.form.php"); ?>
  59          </div>
  60  <?php
  61      }
  62  ?>
  63      </div>
  64  </div>


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1