| @@ -16,31 +16,11 @@ | ||
| 16 | 16 | * |
| 17 | 17 | * @since 1.2 |
| 18 | 18 | */ |
| 19 | 19 | class PLL_Settings extends PLL_Admin_Base { |
| 20 | + protected $active_tab, $modules; | |
| 20 | 21 | |
| 21 | 22 | /** |
| 22 | - * Name of the active module | |
| 23 | - * | |
| 24 | - * @var string $active_tab | |
| 25 | - */ | |
| 26 | - protected $active_tab; | |
| 27 | - | |
| 28 | - /** | |
| 29 | - * Array of modules classes | |
| 30 | - * | |
| 31 | - * @var array $modules | |
| 32 | - */ | |
| 33 | - protected $modules; | |
| 34 | - | |
| 35 | - /** | |
| 36 | - * Reference to PLL_Import_Export | |
| 37 | - * | |
| 38 | - * @var PLL_Import_Export $import_export | |
| 39 | - */ | |
| 40 | - protected $import_export; | |
| 41 | - | |
| 42 | - /** | |
| 43 | 23 | * Constructor |
| 44 | 24 | * |
| 45 | 25 | * @since 1.2 |
| 46 | 26 | * |
| @@ -54,12 +34,8 @@ | ||
| 54 | 34 | } |
| 55 | 35 | |
| 56 | 36 | PLL_Admin_Strings::init(); |
| 57 | 37 | |
| 58 | - if ( class_exists( 'PLL_Import_Export' ) ) { | |
| 59 | - $this->import_export = new PLL_Import_Export( $this ); | |
| 60 | - } | |
| 61 | - | |
| 62 | 38 | // FIXME put this as late as possible |
| 63 | 39 | add_action( 'admin_init', array( $this, 'register_settings_modules' ) ); |
| 64 | 40 | |
| 65 | 41 | // Adds screen options and the about box in the languages admin panel |
| @@ -76,8 +52,9 @@ | ||
| 76 | 52 | * @since 1.8 |
| 77 | 53 | */ |
| 78 | 54 | public function register_settings_modules() { |
| 79 | 55 | $modules = array( |
| 56 | + 'PLL_Settings_Tools', | |
| 80 | 57 | 'PLL_Settings_Licenses', |
| 81 | 58 | ); |
| 82 | 59 | |
| 83 | 60 | if ( $this->model->get_languages_list() ) { |
| @@ -130,9 +107,9 @@ | ||
| 130 | 107 | add_meta_box( |
| 131 | 108 | 'pll-about-box', |
| 132 | 109 | __( 'About Polylang', 'polylang' ), |
| 133 | 110 | array( $this, 'metabox_about' ), |
| 134 | - 'toplevel_page_mlang', | |
| 111 | + 'settings_page_mlang', // FIXME not shown in screen options | |
| 135 | 112 | 'normal' |
| 136 | 113 | ); |
| 137 | 114 | } |
| 138 | 115 | |
| @@ -320,10 +297,9 @@ | ||
| 320 | 297 | |
| 321 | 298 | // Handle user input |
| 322 | 299 | $action = isset( $_REQUEST['pll_action'] ) ? sanitize_key( $_REQUEST['pll_action'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification |
| 323 | 300 | if ( 'edit' === $action && ! empty( $_GET['lang'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification |
| 324 | - // phpcs:ignore WordPress.Security.NonceVerification, WordPressVIPMinimum.Variables.VariableAnalysis.UnusedVariable | |
| 325 | - $edit_lang = $this->model->get_language( (int) $_GET['lang'] ); | |
| 301 | + $edit_lang = $this->model->get_language( (int) $_GET['lang'] ); // phpcs:ignore WordPress.Security.NonceVerification | |
| 326 | 302 | } else { |
| 327 | 303 | $this->handle_actions( $action ); |
| 328 | 304 | } |
| 329 | 305 | |
| @@ -383,9 +359,9 @@ | ||
| 383 | 359 | * Get the list of predefined languages |
| 384 | 360 | * |
| 385 | 361 | * @since 2.3 |
| 386 | 362 | */ |
| 387 | - public static function get_predefined_languages() { | |
| 363 | + public function get_predefined_languages() { | |
| 388 | 364 | require_once ABSPATH . 'wp-admin/includes/translation-install.php'; |
| 389 | 365 | |
| 390 | 366 | $languages = include PLL_SETTINGS_INC . '/languages.php'; |
| 391 | 367 | $translations = wp_get_available_translations(); |