[ Index ]

MailPress 544

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

title

Body

[close]

/mp-includes/class/ -> MP_AutoRefresh_js.class.php (source)

   1  <?php
   2  class MP_AutoRefresh_js
   3  {
   4  	public static function register_scripts($scripts, $file = false)
   5      {
   6          $every   = apply_filters('MailPress_autorefresh_every', 30);
   7  
   8          $checked = checked(isset($_GET['autorefresh']), true, false);
   9          $time    = (isset($_GET['autorefresh'])) ?  $_GET['autorefresh'] : $every;
  10          $time    = (is_numeric($time) && ($time > $every)) ? $time : $every;
  11          $time    = "<input type='text' value='$time' maxlength='5' id='MP_Refresh_every' class='screen-per-page' style='width:5em;'/>";
  12          $option  = '<h5>' . __('Auto refresh', MP_TXTDOM) . '</h5>';
  13          $option .= "<div><input id='MP_Refresh' type='checkbox'$checked style='margin:0 5px 0 2px;' /><span class='MP_Refresh'>" . sprintf(__('%1$s Autorefresh %2$s every %3$s sec', MP_TXTDOM), "<label for='MP_Refresh' style='vertical-align:inherit;'>", '</label>', $time) . "</span></div>";
  14  
  15          $_script = 'mp_refresh';
  16          $localize = array('screen' => MP_AdminPage::screen, 'every' => $every, 'message' => __('Autorefresh in %i% sec', MP_TXTDOM), 'option'    => $option);
  17          if ($file)
  18          {
  19              $_script = 'mp_refresh_i';
  20              $localize['iframe'] = 'mp';
  21              $localize['src']   = get_option('siteurl') . '/' . MP_AdminPage::get_path() . '/' . $_GET['id'];
  22              $localize['url']      = MP_Action_url;
  23          }
  24          $localize['l10n_print_after'] = 'try{convertEntities(adminMpRefreshL10n);}catch(e){};';
  25  
  26          wp_register_script( $_script,     '/' . MP_PATH . "mp-includes/js/$_script.js", array('schedule'), false, 1);
  27          wp_localize_script( $_script,     'adminMpRefreshL10n', $localize );
  28          $scripts[] = $_script;
  29  
  30          return $scripts;
  31      }
  32  }


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