<?php
if ( ! defined( 'ABSPATH' ) ) exit; 

function hd_old() { 
global $wpdb, $post, $opt_themes, $wp_query;  
?>
<style>
	header svg.svg-5{
		height: unset!important;
	}
</style>

<header id="masthead" class="bg-white shadow-sm fixed-top site-header">
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<div class="container d-flex align-items-center" style="margin: 0;max-width: 100%"> 
	 
	<?php
	break; 	
	case 'modyolo':
	?>
	<div class="container d-flex align-items-center" >
	 
	<?php
	break; 	
	case 'reborn':
	?>
	<div class="container d-flex align-items-center" style="margin: 0;max-width: 100%"> 
	<?php
	break; 	
	case 'liteapks':
	?>
	<div class="container d-flex align-items-center" style="margin: 0;max-width: 100%"> 
	<?php	
	break; 
	default:
	?>
	<div class="container d-flex align-items-center" style="margin: 0;max-width: 100%"> 
	<?php
	break; 
	}
	?>
	
	<button class="bg-transparent border-0 d-lg-none px-0 mr-2 site-nav-toggler" style="padding-top: 0.625rem; padding-bottom: 0.625rem;" type="button" aria-label="<?php _e('menu', TEXT_DOMAIN); ?>">
	<svg class="svg-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg>
	</button>
		
	<?php 
	hd_logo(); 
	?>
		
	<nav class="mx-auto site-nav">
		<div class="d-flex d-lg-none justify-content-end">
		<button class="bg-transparent border-0 py-1 px-2 site-nav-closer" type="button"  aria-label="<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>"><svg class=" svg-5 " xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"></path></svg>
		</button>
		</div>
		
		<ul id="menu-site-navigation" class=" menu ">
		<?php 
		hd_menu(); 
		?>
		</ul>
	</nav>
	
	<div class="ml-auto ml-lg-0 mw-100" style="width: 300px;">
		<form class="form-search" method="GET" action="<?php echo esc_url( home_url( '/' ) ); ?>">
		<div class="input-group">
		<input class="form-control form-control-sm" type="text" name="s" placeholder="<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>">
			<div class="input-group-append">
				<button class="btn btn-light btn-sm" type="submit">
				<svg class="svg-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 468.9L387.1 347.5c-2.3-2.3-5.3-3.5-8.5-3.5h-13.2c31.5-36.5 50.6-84 50.6-136C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c52 0 99.5-19.1 136-50.6v13.2c0 3.2 1.3 6.2 3.5 8.5l121.4 121.4c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17zM208 368c-88.4 0-160-71.6-160-160S119.6 48 208 48s160 71.6 160 160-71.6 160-160 160z"></path></svg>
				</button>
			</div>
		</div>
		</form>
		</div>
	</div>
	
</header> 

<?php
}


function hd_new() { 
global $wpdb, $post, $opt_themes, $wp_query; 
?>  

<header class='header' id='header'>
  
  <div class='headCn'>
    <div class='headIn secIn'>
      <div class='headD headL'>
        <div class='headIc'>
          <label aria-label='<?php _e($opt_themes['text_homes'], TEXT_DOMAIN);  ?>' class='tNav tIc bIc pt-1' for='offNav' style="margin-bottom: unset;"><svg class='line' viewBox='0 0 24 24'><line x1='3' x2='21' y1='12' y2='12'></line><line x1='3' x2='21' y1='5' y2='5'></line><line x1='3' x2='21' y1='19' y2='19'></line></svg></label>
        </div>
         
        <div class='headN section' id='header-title'>
          <div class='Header'>
            <div class="headInnr">
				<?php 
				hd_logo_new();
				?>
			</div>
          </div>
        </div>
      </div>
      
      <div class='headD headM'>
        <div class='mnBr'>
          <div class='mnBrs'>
            <div class='mnH'>
              <label aria-label='<?php _e($opt_themes['text_closed'], TEXT_DOMAIN); ?>' class='c' data-text='<?php _e($opt_themes['text_closed'], TEXT_DOMAIN); ?>' for='offNav'></label>
            </div>
             
            <div class='mnMob section' id='header-Menu-mobile'>
              <div class='PageList'>
                <ul class='mMenu'>
                  <?php echo $opt_themes['menus_footer_baru']; ?>
                </ul>
              </div>
              <div class='LinkList'>
                <ul class='mSoc'>
                  <?php echo $opt_themes['menus_sosmed_baru']; ?>
                </ul>
              </div>
            </div>
            <div class='mnMen section' id='header-Menu'>
              <div class='PageList' id='PageList000'>
                <ul class='mnMn' itemscope='itemscope' itemtype='https://schema.org/SiteNavigationElement'>
                    <?php 
					hd_menu(); 
					?>				 
                </ul>
              </div>
            </div>
          </div>
        </div>
        <label class='fCls' for='offNav'></label>
      </div>
      <div class='headD headR'>
        <div class='headI'>
          <div class='headP section' id='header-icon'>
            <div class='TextList'  id='TextList000'>
              <ul class='headIc pt-2'> 
			  
                <li class='isSrh'>
                  <label aria-label='<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>' class='tSrch tIc bIc' for='offSrh'><svg class='line' viewBox='0 0 24 24'><g transform='translate(2.000000, 2.000000)'><circle cx='9.76659044' cy='9.76659044' r='8.9885584'></circle><line x1='16.0183067' x2='19.5423342' y1='16.4851259' y2='20.0000001'></line></g></svg></label>
                </li>
                
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</header>
 
<input class='srhI fixi hidden' id='offSrh' type='checkbox' />
<div class='srhB fixL'>
  <div class='srhBi fixLi'>
    <div class='srhBs fixLs section' id='search-widget'>
      <div class='BlogSearch' id='BlogSearch1'>
        <form method="GET" action='<?php echo esc_url( home_url( '/' ) ); ?>' class='srhF' target='_top'>
          <label aria-label='<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>' class='sb' for='searchIn'>
            <svg class='line' viewBox='0 0 24 24'><g transform='translate(2.000000, 2.000000)'><circle cx='9.76659044' cy='9.76659044' r='8.9885584'></circle><line x1='16.0183067' x2='19.5423342' y1='16.4851259' y2='20.0000001'></line></g></svg>
          </label>
          <input aria-label='<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>' autocomplete='off' id='searchIn' minlength='3' name='s' placeholder='<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>' required='required' type='search' value='' />
          <button aria-label='<?php echo $opt_themes['text_clear']; ?>' class='sb' data-text='<?php echo $opt_themes['text_clear']; ?>' type='reset'></button>
        </form>
        <label aria-label='<?php _e($opt_themes['text_closed'], TEXT_DOMAIN); ?>' class='srhC c pt-2' for='offSrh'></label>
      </div>
	  <?php
	  if ($opt_themes['cats_search']) { ?>
	  <div class='widget Label' >
        <h2 class='title'><?php _e($opt_themes['text_search_suggest'], TEXT_DOMAIN); ?></h2>
        <div class='wL pSml cl'>		
		<?php
		$categories = get_categories();
		$i = 0;
		foreach ($categories as $category) {
		?>
		<div class='lbSz s-4'>
			<a aria-label='<?php echo $category->name; ?>' class='lbN' href='<?php echo get_category_link($category->term_id); ?>'>
			<span class='lbT'><?php echo $category->name; ?></span>
			<span class='lbC' data-text='(<?php echo $category->category_count; ?>)'></span>
			</a>
		</div>
		<?php if (++$i == $opt_themes['limit_cats_search']) break; } ?> 
        </div>
      </div>
	  <?php  } ?>
    </div>
  </div>
  <label class='fCls' for='offSrh'></label>
</div> 
<script>var $exhemes_dev_blog = jQuery.noConflict();</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.2/jquery.min.js" integrity="sha512-tWHlutFnuG0C6nQRlpvrEhE4QpkG1nn2MOUMWmUeRePl4e3Aki0VB6W1v3oLjFtd0hVOtRQ9PHpSfN6u6/QXkQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">$(document).ready((function(){var o=document.URL.split("/").filter(Boolean).pop();console.log(o),$(".mnMn li a").each((function(){$(this).attr("href").split("/").filter(Boolean).pop()==o&&$(this).closest("li").addClass("actived")}))}));</script>

<?php
}


function hd_liteapk() { 
global $wpdb, $post, $opt_themes, $wp_query; 
?>  

<style>
	header svg.svg-5{
		height: unset!important;
	}
</style>
<header id="masthead" class="bg-primary fixed-top site-header">
	<div class="container d-flex align-items-center">
		<button class="bg-transparent border-0 d-lg-none px-0 mr-2 site-nav-toggler" style="padding-top: 0.625rem; padding-bottom: 0.625rem;" type="button" aria-label="<?php _e('menu', TEXT_DOMAIN); ?>"><svg class="svg-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></button>
		<h1 class="h2 font-weight-bold mb-0 mr-2 mr-lg-0 site-logo">
		<a class="text-white" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $opt_themes['ex_themes_header_logo_texts_']; ?></a>
		</h1>
		<nav class="mx-auto site-nav">
			<div class="d-flex d-lg-none justify-content-end">
				<button class="bg-transparent border-0 py-1 px-2 site-nav-closer" type="button" aria-label="<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>"><svg class="svg-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"></path></svg></button>
			</div>
			<ul id="menu-site-navigation" class="menu">
			<?php 
			hd_menu(); 
			?>
			</ul>
		</nav>

		<div class="ml-auto ml-lg-0 mw-100" style="width: 300px;">
			<form class="form-search" method="GET" action="<?php echo esc_url( home_url( '/' ) ); ?>">
				<div class="input-group">
					<input class="form-control border-white" type="text" name="s" placeholder="<?php _e($opt_themes['text_search'], TEXT_DOMAIN); ?>">
					<div class="input-group-append">
						<button class="btn bg-white" type="submit"><svg class="svg-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M508.5 468.9L387.1 347.5c-2.3-2.3-5.3-3.5-8.5-3.5h-13.2c31.5-36.5 50.6-84 50.6-136C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c52 0 99.5-19.1 136-50.6v13.2c0 3.2 1.3 6.2 3.5 8.5l121.4 121.4c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17zM208 368c-88.4 0-160-71.6-160-160S119.6 48 208 48s160 71.6 160 160-71.6 160-160 160z"></path></svg></button>
					</div>
				</div>
			</form>
		</div>
	</div>
</header> 
<?php
}
 

function hd_menu() { 
global $wpdb, $post, $opt_themes, $wp_query; 
  
$mainnav = array(
	'theme_location'  => 'menu_header',
	'container'	 => false,	
	//'echo'	=> false,
	//'before'	  => '',
	//'after'	   => '',
	//'link_before'     => '',
	//'link_after'	=> '',
	'items_wrap'	=> '%3$s',
	//'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
	//'item_spacing'    => 'preserve',
	'depth'	   => 2, // 1 = no dropdowns, 2 = with dropdowns.
	'walker'	  => new WP_Bootstrap_Navwalker,
    );
echo strip_tags(wp_nav_menu( $mainnav ), '<li><a><i><span>' );
  
}

function page_class(){
global $opt_themes; 
switch($opt_themes['themes_styles']){
	case 'moddroid':
	echo '<div id="page" class="mainWrp site">';
	break; 
	
	case 'modyolo':
	echo '<div id="page" class="mainWrp site bg-light">';
	break; 
	
	case 'reborn':
	echo '<div id="page" class="mainWrp ">';
	break; 
	
	case 'liteapks':
	echo '<div id="page" class="bg-light site">';
	break; 
	
	default:
	echo '<div id="page" class="mainWrp site">';
	break;
} 

}
add_action('page_class', 'page_class', 10, 1);


function header_menu(){
global $opt_themes;
switch($opt_themes['themes_styles']){
	case 'moddroid':
	hd_old(); 
	break; 
	
	case 'modyolo':
	hd_old(); 
	break; 
	
	case 'reborn':
	hd_new(); 
	break; 
	
	case 'liteapks':
	hd_liteapk(); 
	break; 
	
	default:
	hd_old(); 
	break;
}	

}
add_action('header_menu', 'header_menu', 10, 1);
//do_action('header_menu'); // print_out

function hd_logo() { 
global $wpdb, $post, $opt_themes, $wp_query;   
if ($opt_themes['ex_themes_header_logo_text_activate_']) {
if (is_home() || is_front_page()) { ?> 
	<h1 style="text-transform:uppercase" class="h3 font-weight-semibold mb-0 mr-2 mr-lg-0 site-logo"><a class="text-body" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $opt_themes['ex_themes_header_logo_texts_']; ?></a></h1>
	<?php } elseif (is_single() || is_page() || is_search() || is_archive() || is_404() || is_tag()) { ?>
	<h2 style="text-transform:uppercase" class="h3 font-weight-semibold mb-0 mr-2  mr-lg-0 site-logo"><a class="text-body" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo $opt_themes['ex_themes_header_logo_texts_']; ?></a></h2>
<?php } 
} else {   
if ($opt_themes['ex_themes_header_logo_banner_activate_']) { ?>
	<a class="text-body" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><img alt="<?php echo get_bloginfo( 'description' ); ?>" src="<?php echo $opt_themes['ex_themes_header_logo_banner_']['url']; ?>"></a>
<?php } else { if (is_home() || is_front_page()) { ?>
	<h1 style="text-transform:uppercase" class="h3 font-weight-semibold mb-0 mr-2 mr-lg-0 site-logo"><a class="text-body" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo THEMES_NAMES; echo VERSIONS_THEMES; ?></a></h1>
<?php } elseif (is_single() || is_page() || is_search() || is_archive() || is_404() || is_tag()) { ?>
	<h3 style="text-transform:uppercase" class="h3 font-weight-semibold mb-0 mr-2 mr-lg-0 site-logo"><a class="text-body" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php echo THEMES_NAMES; echo VERSIONS_THEMES; ?></a></h3>
<?php } 
} } 
}

function hd_logo_new() { 
global $wpdb, $post, $opt_themes, $wp_query;  
if ($opt_themes['ex_themes_header_logo_text_activate_']) {
if (is_home() || is_front_page()) { ?>
	<h1 class="headH hasSub">	
		<span class="headTtl"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo $opt_themes['ex_themes_header_logo_texts_']; ?></a></span>
	<span class="headSub" data-text="<?php echo $opt_themes['logo_desc']; ?>"></span>
	</h1>
<?php } elseif (is_single() || is_page() || is_search() || is_archive() || is_404() || is_tag()) { ?>
	<h2 class="headH hasSub">	
		<span class="headTtl"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo $opt_themes['ex_themes_header_logo_texts_']; ?></a></span>
	<span class="headSub" data-text="<?php echo $opt_themes['logo_desc']; ?>"></span>
	</h2>
<?php } 
} else {  
if ($opt_themes['ex_themes_header_logo_banner_activate_']) { ?>
	<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img alt="<?php echo get_bloginfo( 'description' ); ?>"  src="<?php echo $opt_themes['ex_themes_header_logo_banner_']['url']; ?>" width="150" height="30"></a>
<?php } else {
if (is_home() || is_front_page()) { ?>
	<h1 class="headH hasSub">	
	<span class="headTtl"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo THEMES_NAMES; ?></a></span>
	<span class="headSub" data-text="<?php echo $opt_themes['logo_desc']; ?>"></span>	
	</h1>
<?php } elseif (is_single() || is_page() || is_search() || is_archive() || is_404() || is_tag()) { ?>
	<h3 class="headH hasSub">	
	<span class="headTtl"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php echo THEMES_NAMES; ?></a></span>
	<span class="headSub" data-text="<?php echo $opt_themes['logo_desc']; ?>"></span>	
	</h3>
<?php } 
} } 
}


function hd_categorie() { 
global $wpdb, $post, $opt_themes, $wp_query; 
  
if(has_nav_menu( 'menu_sub_header' )){ 
?>
<nav class="navI scrlH m-1 ">
	<div class="secIn section" id="scroll-menu">
		<div class="widget LinkList" >
			<ul>
				<?php
				$menu_sub_header = array(
				'theme_location'    => 'menu_sub_header',
				'container' 		=> false,
				'items_wrap'        => '%3$s',
				//'walker'            => new menu_header_two,
				);
				wp_nav_menu( $menu_sub_header );
				?>
			</ul>
		</div>
	</div>
</nav>
<?php
}
}
 
function hd_() { 
global $wpdb, $post, $opt_themes, $wp_query; 
?>  

<?php
}
