Beispiel #1
0
 public function __construct(&$links_model)
 {
     parent::__construct($links_model);
     $this->active_tab = !empty($_GET['tab']) ? $_GET['tab'] : 'lang';
     PLL_Admin_Strings::init();
     // FIXME put this as late as possible
     add_action('admin_init', array(&$this, 'register_settings_modules'));
     // adds screen options and the about box in the languages admin panel
     add_action('load-settings_page_mlang', array(&$this, 'load_page'));
     // saves per-page value in screen option
     add_filter('set-screen-option', create_function('$s, $o, $v', 'return $v;'), 10, 3);
 }
Beispiel #2
0
 public function __construct(&$polylang)
 {
     $this->links_model =& $polylang->links_model;
     $this->model =& $polylang->model;
     $this->options =& $polylang->options;
     $this->active_tab = !empty($_GET['tab']) ? $_GET['tab'] : 'lang';
     PLL_Admin_Strings::init();
     // adds screen options and the about box in the languages admin panel
     add_action('load-settings_page_mlang', array(&$this, 'load_page'));
     // saves per-page value in screen option
     add_filter('set-screen-option', create_function('$s, $o, $v', 'return $v;'), 10, 3);
 }
Beispiel #3
0
 /**
  * Constructor
  *
  * @since 1.2
  *
  * @param object $links_model
  */
 public function __construct(&$links_model)
 {
     parent::__construct($links_model);
     $this->active_tab = 'mlang' === $_GET['page'] ? 'lang' : substr($_GET['page'], 6);
     PLL_Admin_Strings::init();
     // FIXME put this as late as possible
     add_action('admin_init', array($this, 'register_settings_modules'));
     // adds screen options and the about box in the languages admin panel
     add_action('load-toplevel_page_mlang', array($this, 'load_page'));
     add_action('load-languages_page_mlang_strings', array($this, 'load_page_strings'));
     // saves per-page value in screen option
     add_filter('set-screen-option', array($this, 'set_screen_option'), 10, 3);
 }
Beispiel #4
0
 public static function get_strings()
 {
     static $strings = array();
     if (empty($strings)) {
         PLL_Admin_Strings::init();
         // enables sanitization filter
         foreach (PLL_Admin_Strings::get_strings() as $string) {
             $strings[$string['context']]['context'] = $string['context'];
             $strings[$string['context']]['count'] = empty($strings[$string['context']]['count']) ? 1 : $strings[$string['context']]['count'] + 1;
         }
         $strings = array_values($strings);
     }
     return $strings;
 }