| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | +/** | |
| 3 | + * @package Polylang | |
| 4 | + */ | |
| 2 | 5 | |
| 3 | 6 | /** |
| 4 | 7 | * A class for the Polylang settings pages |
| 5 | 8 | * accessible in $polylang global object |
| @@ -32,15 +35,8 @@ | ||
| 32 | 35 | */ |
| 33 | 36 | protected $modules; |
| 34 | 37 | |
| 35 | 38 | /** |
| 36 | - * Reference to PLL_Import_Export | |
| 37 | - * | |
| 38 | - * @var PLL_Import_Export $import_export | |
| 39 | - */ | |
| 40 | - protected $import_export; | |
| 41 | - | |
| 42 | - /** | |
| 43 | 39 | * Constructor |
| 44 | 40 | * |
| 45 | 41 | * @since 1.2 |
| 46 | 42 | * |
| @@ -54,13 +50,8 @@ | ||
| 54 | 50 | } |
| 55 | 51 | |
| 56 | 52 | PLL_Admin_Strings::init(); |
| 57 | 53 | |
| 58 | - if ( class_exists( 'PLL_Import_Export' ) ) { | |
| 59 | - $this->import_export = new PLL_Import_Export( $this ); | |
| 60 | - } | |
| 61 | - | |
| 62 | - // FIXME put this as late as possible | |
| 63 | 54 | add_action( 'admin_init', array( $this, 'register_settings_modules' ) ); |
| 64 | 55 | |
| 65 | 56 | // Adds screen options and the about box in the languages admin panel |
| 66 | 57 | add_action( 'load-toplevel_page_mlang', array( $this, 'load_page' ) ); |
| @@ -75,28 +66,21 @@ | ||
| 75 | 66 | * |
| 76 | 67 | * @since 1.8 |
| 77 | 68 | */ |
| 78 | 69 | public function register_settings_modules() { |
| 79 | - $modules = array( | |
| 80 | - 'PLL_Settings_Licenses', | |
| 81 | - ); | |
| 70 | + $modules = array(); | |
| 82 | 71 | |
| 83 | 72 | if ( $this->model->get_languages_list() ) { |
| 84 | - $modules = array_merge( | |
| 85 | - array( | |
| 86 | - 'PLL_Settings_Url', | |
| 87 | - 'PLL_Settings_Browser', | |
| 88 | - 'PLL_Settings_Media', | |
| 89 | - 'PLL_Settings_CPT', | |
| 90 | - 'PLL_Settings_Sync', | |
| 91 | - 'PLL_Settings_WPML', | |
| 92 | - 'PLL_Settings_Share_Slug', | |
| 93 | - 'PLL_Settings_Translate_Slugs', | |
| 94 | - ), | |
| 95 | - $modules | |
| 73 | + $modules = array( | |
| 74 | + 'PLL_Settings_Url', | |
| 75 | + 'PLL_Settings_Browser', | |
| 76 | + 'PLL_Settings_Media', | |
| 77 | + 'PLL_Settings_CPT', | |
| 96 | 78 | ); |
| 97 | 79 | } |
| 98 | 80 | |
| 81 | + $modules[] = 'PLL_Settings_Licenses'; | |
| 82 | + | |
| 99 | 83 | /** |
| 100 | 84 | * Filter the list of setting modules |
| 101 | 85 | * |
| 102 | 86 | * @since 1.8 |
| @@ -116,9 +100,9 @@ | ||
| 116 | 100 | * |
| 117 | 101 | * @since 0.8 |
| 118 | 102 | */ |
| 119 | 103 | public function metabox_about() { |
| 120 | - include PLL_SETTINGS_INC . '/view-about.php'; | |
| 104 | + include __DIR__ . '/view-about.php'; | |
| 121 | 105 | } |
| 122 | 106 | |
| 123 | 107 | /** |
| 124 | 108 | * Adds screen options and the about box in the languages admin panel |
| @@ -327,9 +311,9 @@ | ||
| 327 | 311 | $this->handle_actions( $action ); |
| 328 | 312 | } |
| 329 | 313 | |
| 330 | 314 | // Displays the page |
| 331 | - include PLL_SETTINGS_INC . '/view-languages.php'; | |
| 315 | + include __DIR__ . '/view-languages.php'; | |
| 332 | 316 | } |
| 333 | 317 | |
| 334 | 318 | /** |
| 335 | 319 | * Enqueues scripts and styles |
| @@ -386,9 +370,9 @@ | ||
| 386 | 370 | */ |
| 387 | 371 | public static function get_predefined_languages() { |
| 388 | 372 | require_once ABSPATH . 'wp-admin/includes/translation-install.php'; |
| 389 | 373 | |
| 390 | - $languages = include PLL_SETTINGS_INC . '/languages.php'; | |
| 374 | + $languages = include __DIR__ . '/languages.php'; | |
| 391 | 375 | $translations = wp_get_available_translations(); |
| 392 | 376 | |
| 393 | 377 | // Keep only languages with existing WP language pack |
| 394 | 378 | // Unless the transient has expired and we don't have an internet connection to refresh it |