[ Index ]

MailPress 544

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

title

Body

[close]

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

   1  <?php
   2  class MP_AdminPage extends MP_adminpage_
   3  {
   4      const screen         = MailPress_page_settings;
   5      const capability     = 'MailPress_manage_options';
   6      const help_url        = 'http://blog.mailpress.org/tutorials/';
   7      const file            = __FILE__;
   8  
   9      public static $first = true;
  10  
  11  ////  Styles  ////
  12  
  13  	public static function print_styles($styles = array()) 
  14      {
  15          wp_register_style ( self::screen, '/' . MP_PATH . 'mp-admin/css/settings.css' );
  16  
  17          $styles[] = self::screen;
  18          parent::print_styles($styles);
  19      }
  20  
  21  ////  Scripts  ////
  22  
  23  	public static function print_scripts($scripts = array()) 
  24      {
  25          wp_register_script( 'mp-smtp',    '/' . MP_PATH . 'mp-admin/js/settings_smtp.js', array(), false, 1);
  26  
  27          wp_register_script( self::screen,     '/' . MP_PATH . 'mp-admin/js/settings.js', array('jquery-ui-tabs', 'mp-smtp'), false, 1);
  28          wp_localize_script( self::screen, 'MP_AdminPageL10n', array( 'requestFile' => MP_Action_url ) );
  29  
  30          $scripts[] = self::screen;
  31          parent::print_scripts($scripts);
  32      }
  33  
  34  ////  Misc  ////
  35  
  36  	public static function save_button()
  37      {
  38  ?>
  39  <p class='submit'>
  40      <input class='button-primary' type='submit' name='Submit' value='<?php  _e('Save Changes'); ?>' />
  41  </p>
  42  <?php
  43      }
  44  
  45  	public static function logs_sub_form ($name, $data, $headertext)
  46      {
  47          if (!isset($data[$name])) $data[$name] = MailPress::$default_option_logs;
  48  
  49          $xlevel = array (        123456789    => __('No logging', MP_TXTDOM) , 
  50                              0    => __('simple log', MP_TXTDOM) , 
  51                              1     => 'E_ERROR', 
  52                              2     => 'E_WARNING', 
  53                              4     => 'E_PARSE', 
  54                              8     => 'E_NOTICE', 
  55                              16     => 'E_CORE_ERROR', 
  56                              32     => 'E_CORE_WARNING', 
  57                              64     => 'E_COMPILE_ERROR', 
  58                              128     => 'E_COMPILE_WARNING', 
  59                              256     => 'E_USER_ERROR', 
  60                              512     => '* E_USER_WARNING *', 
  61                              1024     => 'E_USER_NOTICE', 
  62                              2048     => 'E_STRICT', 
  63                              4096     => 'E_RECOVERABLE_ERROR', 
  64                              8191     => 'E_ALL' );
  65          if (self::$first)
  66          {
  67              self::$first = false;
  68  ?>
  69  <tr class='mp_sep'>
  70      <th><strong><?php _e('Logs', MP_TXTDOM); ?></strong></th>
  71      <td><strong><?php _e('Level', MP_TXTDOM); ?></strong></td>
  72      <td><strong><?php _e('Days', MP_TXTDOM); ?></strong></td>
  73      <td><strong><?php _e('Last purge', MP_TXTDOM); ?></strong></td>
  74  </tr>
  75  <?php
  76          }
  77  ?>
  78  <tr class='mp_sep'>
  79      <th><strong><?php echo $headertext; ?></strong></th>
  80      <td>
  81          <select name='logs[<?php echo $name ?>][level]'>
  82  <?php self::select_option($xlevel, $data[$name]['level']);?>
  83          </select> 
  84      </td>
  85      <td>
  86          <select name='logs[<?php echo $name ?>][lognbr]'>
  87  <?php self::select_number(1, 10, $data[$name]['lognbr']);?>
  88          </select>
  89      </td>
  90      <td>
  91          <?php if (!empty($data[$name]['lastpurge'])) echo substr($data[$name]['lastpurge'],0 , 4) . '/' . substr($data[$name]['lastpurge'],4, 2) . '/' . substr($data[$name]['lastpurge'],6, 2); ?>
  92          <input type='hidden' name='logs[<?php echo $name ?>][lastpurge]' value='<?php echo $data[$name]['lastpurge']; ?>' />
  93      </td>
  94  </tr>
  95  <?php
  96      }
  97  }


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