[ Index ]

MailPress 544

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

title

Body

[close]

/mp-content/add-ons/ -> MailPress_view_logs.php (source)

   1  <?php
   2  if ( (class_exists('MailPress')) && !class_exists('MailPress_view_logs') && (is_admin()) )
   3  {
   4  /*
   5  Plugin Name: MailPress_view_logs
   6  Plugin URI: http://blog.mailpress.org/tutorials/add-ons/view_logs/
   7  Description: Logs (view logs stored in tmp folder generated by MailPress in your browser)
   8  Version: 5.4.4
   9  */
  10  
  11  // 3.
  12  
  13  /** for admin plugin pages */
  14  define ('MailPress_page_view_logs',     'mailpress_viewlogs');
  15  define ('MailPress_page_view_log',         MailPress_page_view_logs . '&file=view_log');
  16  
  17  /** for admin plugin urls */
  18  $mp_file = 'admin.php';
  19  define ('MailPress_view_logs',     $mp_file . '?page=' . MailPress_page_view_logs);
  20  define ('MailPress_view_log',     $mp_file . '?page=' . MailPress_page_view_log);
  21  
  22  class MailPress_view_logs
  23  {
  24  	function __construct()
  25      {
  26      // for role & capabilities
  27          add_filter('MailPress_capabilities',          array(__CLASS__, 'capabilities'), 1, 1);
  28      // for load admin page
  29          add_filter('MailPress_load_admin_page',         array(__CLASS__, 'load_admin_page'), 10, 1);
  30      // for autorefresh
  31          add_filter('MailPress_autorefresh_files_js',    array(__CLASS__, 'autorefresh_js'), 8, 1);
  32      }
  33  
  34  ////  Admin  ////
  35  
  36  // for role & capabilities
  37  	public static function capabilities($capabilities)
  38      {
  39          $capabilities['MailPress_view_logs'] = array(    'name'    => __('Logs', MP_TXTDOM),
  40                                          'group'    => 'admin',
  41                                          'menu'    => 99,
  42  
  43                                          'parent'    => false,
  44                                          'page_title'=> __('MailPress Logs', MP_TXTDOM),
  45                                          'menu_title'=> __('Logs', MP_TXTDOM),
  46                                          'page'    => MailPress_page_view_logs,
  47                                          'func'    => array('MP_AdminPage', 'body')
  48                                      );
  49          return $capabilities;
  50      }
  51  
  52  // for load admin page
  53  	public static function load_admin_page($hub)
  54      {
  55          $hub[MailPress_page_view_logs] = 'view_logs';
  56          $hub[MailPress_page_view_log]  = 'view_log';
  57          return $hub;
  58      }
  59  
  60  // for autorefresh
  61  	public static function autorefresh_js($scripts)
  62      {
  63          return MP_AutoRefresh_js::register_scripts($scripts, true);
  64      }
  65  }
  66  new MailPress_view_logs();
  67  }


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