| @@ -1,26 +1,34 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | /** |
| 3 | - * Displays the Languages admin panel | |
| 4 | - * | |
| 5 | - * @package Polylang | |
| 4 | + * displays the Languages admin panel | |
| 6 | 5 | */ |
| 7 | 6 | |
| 8 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | - exit; // Don't access directly | |
| 8 | + exit; // don't access directly | |
| 10 | 9 | }; |
| 11 | - | |
| 12 | -require ABSPATH . 'wp-admin/options-head.php'; // Displays the errors messages as when we were a child of options-general.php | |
| 13 | 10 | ?> |
| 14 | 11 | <div class="wrap"> |
| 15 | - <h1><?php echo esc_html( $GLOBALS['title'] ); ?></h1> | |
| 16 | - <?php | |
| 12 | + <h1><?php esc_html_e( 'Languages', 'polylang' ); ?></h1> | |
| 13 | + <h2 class="nav-tab-wrapper"><?php | |
| 14 | + // display tabs | |
| 15 | + foreach ( $tabs as $key => $name ) { | |
| 16 | + printf( | |
| 17 | + '<a href="options-general.php?page=mlang&tab=%1$s" id="nav-tab-%1$s" class="nav-tab %2$s">%3$s</a>', | |
| 18 | + esc_attr( $key ), | |
| 19 | + $key == $this->active_tab ? 'nav-tab-active' : '', | |
| 20 | + esc_html( $name ) | |
| 21 | + ); | |
| 22 | + }?> | |
| 23 | + </h2><?php | |
| 24 | + | |
| 17 | 25 | switch ( $this->active_tab ) { |
| 18 | 26 | case 'lang': // Languages tab |
| 19 | - case 'strings': // String translations tab | |
| 20 | - case 'settings': // Settings tab | |
| 21 | - include __DIR__ . '/view-tab-' . $this->active_tab . '.php'; | |
| 22 | - // Intentional fall-through to upgrade to fire the action below. | |
| 27 | + case 'strings': // string translations tab | |
| 28 | + case 'settings': // settings tab | |
| 29 | + include( PLL_SETTINGS_INC.'/view-tab-' . $this->active_tab . '.php' ); | |
| 30 | + break; | |
| 23 | 31 | |
| 24 | 32 | default: |
| 25 | 33 | /** |
| 26 | 34 | * Fires when loading the active Polylang settings tab |
| @@ -28,8 +36,8 @@ | ||
| 28 | 36 | * |
| 29 | 37 | * @since 1.5.1 |
| 30 | 38 | */ |
| 31 | 39 | do_action( 'pll_settings_active_tab_' . $this->active_tab ); |
| 32 | - break; | |
| 33 | - } | |
| 34 | - ?> | |
| 40 | + break; | |
| 41 | + }?> | |
| 42 | + | |
| 35 | 43 | </div><!-- wrap --> |