| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* displays the Languages admin panel |
| 5 |
*/ |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // don't access directly |
| 9 |
}; |
| 10 |
?> |
| 11 |
<div class="wrap"> |
| 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 |
|
| 25 |
switch ( $this->active_tab ) { |
| 26 |
case 'lang': // Languages tab |
| 27 |
case 'strings': // string translations tab |
| 28 |
case 'settings': // settings tab |
| 29 |
include( PLL_SETTINGS_INC.'/view-tab-' . $this->active_tab . '.php' ); |
| 30 |
break; |
| 31 |
|
| 32 |
default: |
| 33 |
/** |
| 34 |
* Fires when loading the active Polylang settings tab |
| 35 |
* Allows plugins to add their own tab |
| 36 |
* |
| 37 |
* @since 1.5.1 |
| 38 |
*/ |
| 39 |
do_action( 'pll_settings_active_tab_' . $this->active_tab ); |
| 40 |
break; |
| 41 |
}?> |
| 42 |
|
| 43 |
</div><!-- wrap --> |
| 44 |
|