| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) { |
| 2 |
exit; |
| 3 |
} |
| 4 |
/** |
| 5 |
* Tabs menu for Settings |
| 6 |
* |
| 7 |
* @package Wow_Plugin |
| 8 |
* @copyright Copyright (c) 2018, Dmytro Lobov |
| 9 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 10 |
* @since 1.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
$tab_elements = array( |
| 14 |
'main' => esc_attr__( 'Main', $this->plugin['text'] ), |
| 15 |
'menu' => esc_attr__( 'Menu', $this->plugin['text'] ), |
| 16 |
'popup' => esc_attr__( 'Popup', $this->plugin['text'] ), |
| 17 |
); |
| 18 |
|
| 19 |
$tab_li = ''; |
| 20 |
$tab_content = ''; |
| 21 |
$i = '1'; |
| 22 |
foreach ( $tab_elements as $key => $val ) { |
| 23 |
// $active = ( $i == 1 ) ? 'is-active' : ''; |
| 24 |
// $tab_li .= '<li class="' . esc_attr( $active ) . ' is-marginless" data-tab="' . absint( $i ) . '"><a>' . esc_attr( $val ) . '</a></li>'; |
| 25 |
// $tab_content .= '<div class="' . esc_attr( $active ) . ' tab-content" data-content="' . absint( $i ) . '">'; |
| 26 |
// ob_start(); |
| 27 |
// include( $key . '.php' ); |
| 28 |
// $tab_content .= ob_get_contents(); |
| 29 |
// ob_end_clean(); |
| 30 |
// $tab_content .= '</div>'; |
| 31 |
// $i ++; |
| 32 |
} |
| 33 |
?> |
| 34 |
|
| 35 |
<div class="tabs is-centered" id="tab"> |
| 36 |
<ul> |
| 37 |
<li class="is-active" data-tab="1"><a><?php esc_html_e( 'Settings', $this->plugin['text'] );?></a></li> |
| 38 |
<li data-tab="2"><a><?php esc_html_e( 'Menu', $this->plugin['text'] );?></a></li> |
| 39 |
<li data-tab="3"><a><?php esc_html_e( 'Popup', $this->plugin['text'] );?></a></li> |
| 40 |
</ul> |
| 41 |
</div> |
| 42 |
<div id="tab-content" class="inside"> |
| 43 |
<div class="is-active tab-content" data-content="1"> |
| 44 |
<?php include_once ('main.php');?> |
| 45 |
</div> |
| 46 |
</div> |