Guest User

Untitled

a guest
Mar 13th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.69 KB | None | 0 0
  1. <?php
  2. global $avia_config;
  3.  
  4. $responsive = avia_get_option('responsive_active') != "disabled" ? "responsive" : "fixed_layout";
  5. $headerS = avia_header_setting();
  6. $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => '');
  7. $icons = !empty($headerS['header_social']) ? avia_social_media_icons($social_args, false) : "";
  8.  
  9. if(isset($headerS['disabled'])) return;
  10.  
  11. ?>
  12.  
  13. <header id='header' class='all_colors header_color <?php avia_is_dark_bg('header_color'); echo " ".$headerS['header_class']; ?>' <?php avia_markup_helper(array('context' => 'header','post_type'=>'forum'));?>>
  14.  
  15. <?php
  16.  
  17. if($responsive)
  18. {
  19. echo '<a id="advanced_menu_toggle" href="#" '.av_icon_string('mobile_menu').'></a>';
  20. echo '<a id="advanced_menu_hide" href="#" '.av_icon_string('close').'></a>';
  21. }
  22.  
  23.  
  24. //subheader, only display when the user chooses a social header
  25. if($headerS['header_topbar'] == true)
  26. {
  27. ?>
  28. <div id='header_meta' class='container_wrap container_wrap_meta <?php echo avia_header_class_string(array('header_social', 'header_secondary_menu', 'header_phone_active'), 'av_'); ?>'>
  29.  
  30. <div class='container'>
  31. <?php
  32. /*
  33. * display the themes social media icons, defined in the wordpress backend
  34. * the avia_social_media_icons function is located in includes/helper-social-media-php
  35. */
  36. $nav = "";
  37.  
  38. //display icons
  39. if(strpos( $headerS['header_social'], 'extra_header_active') !== false) echo $icons;
  40.  
  41. //display navigation
  42. if(strpos( $headerS['header_secondary_menu'], 'extra_header_active') !== false )
  43. {
  44. //display the small submenu
  45. $avia_theme_location = 'avia2';
  46. $avia_menu_class = $avia_theme_location . '-menu';
  47. $args = array(
  48. 'theme_location'=>$avia_theme_location,
  49. 'menu_id' =>$avia_menu_class,
  50. 'container_class' =>$avia_menu_class,
  51. 'fallback_cb' => '',
  52. 'container'=>'',
  53. 'echo' =>false
  54. );
  55.  
  56. $nav = wp_nav_menu($args);
  57. }
  58.  
  59. if(!empty($nav) || apply_filters('avf_execute_avia_meta_header', false))
  60. {
  61. echo "<nav class='sub_menu' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
  62. echo $nav;
  63. do_action('avia_meta_header'); // Hook that can be used for plugins and theme extensions (currently: the wpml language selector)
  64. echo '</nav>';
  65. }
  66.  
  67.  
  68. //phone/info text
  69. $phone = $headerS['header_phone_active'] != "" ? $headerS['phone'] : "";
  70. $phone_class = !empty($nav) ? "with_nav" : "";
  71. if($phone) { echo "<div class='phone-info {$phone_class}'><span>".do_shortcode($phone)."</span></div>"; }
  72.  
  73.  
  74. ?>
  75. </div>
  76. </div>
  77.  
  78. <?php }
  79.  
  80.  
  81.  
  82. $output = "";
  83. $temp_output = "";
  84. $icon_beside = "";
  85.  
  86. if($headerS['header_social'] == 'icon_active_main' && empty($headerS['bottom_menu']))
  87. {
  88. $icon_beside = " av_menu_icon_beside";
  89. }
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. ?>
  97. <div id='header_main' class='container_wrap container_wrap_logo'>
  98.  
  99. <?php
  100. /*
  101. * Hook that can be used for plugins and theme extensions (currently: the woocommerce shopping cart)
  102. */
  103. do_action('ava_main_header');
  104.  
  105. if($headerS['header_position'] != "header_top") do_action('ava_main_header_sidebar');
  106.  
  107.  
  108. $output .= "<div class='container av-logo-container'>";
  109.  
  110. $output .= "<div class='inner-container'>";
  111.  
  112. /*
  113. * display the theme logo by checking if the default logo was overwritten in the backend.
  114. * the function is located at framework/php/function-set-avia-frontend-functions.php in case you need to edit the output
  115. */
  116. $addition = false;
  117. if( !empty($headerS['header_transparency']) && !empty($headerS['header_replacement_logo']) )
  118. {
  119. $addition = "<img src='".$headerS['header_replacement_logo']."' class='alternate' alt='' title='' />";
  120. }
  121.  
  122. $output .= avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true);
  123.  
  124. if(!empty($headerS['bottom_menu']))
  125. {
  126. ob_start();
  127. do_action('ava_before_bottom_main_menu'); // todo: replace action with filter, might break user customizations
  128. $output .= ob_get_clean();
  129. }
  130.  
  131. if($headerS['header_social'] == 'icon_active_main' && !empty($headerS['bottom_menu']))
  132. {
  133. $output .= $icons;
  134. }
  135.  
  136.  
  137. /*
  138. * display the main navigation menu
  139. * modify the output in your wordpress admin backend at appearance->menus
  140. */
  141.  
  142. if($headerS['bottom_menu'])
  143. {
  144. $output .= "</div>";
  145. $output .= "</div>";
  146.  
  147. if( !empty( $headerS['header_menu_above'] ))
  148. {
  149. $avia_config['temp_logo_container'] = "<div class='av-section-bottom-logo header_color'>".$output."</div>";
  150. $output = "";
  151. }
  152.  
  153. $output .= "<div id='header_main_alternate' class='container_wrap'>";
  154. $output .= "<div class='container'>";
  155. }
  156.  
  157.  
  158. if( function_exists( 'ubermenu' ) ){
  159. $output.= ubermenu( 'main' , array( 'theme_location' => 'avia' , 'echo' => false ) );
  160. }
  161. else{
  162. $output .= "<nav class='main_menu' data-selectname='".__('Select a page','avia_framework')."' ".avia_markup_helper(array('context' => 'nav', 'echo' => false)).">";
  163. $avia_theme_location = 'avia';
  164. $avia_menu_class = $avia_theme_location . '-menu';
  165. $args = array(
  166. 'theme_location' => $avia_theme_location,
  167. 'menu_id' => $avia_menu_class,
  168. 'menu_class' => 'menu av-main-nav',
  169. 'container_class' => $avia_menu_class.' av-main-nav-wrap'.$icon_beside,
  170. 'fallback_cb' => 'avia_fallback_menu',
  171. 'echo' => false,
  172. 'walker' => new avia_responsive_mega_menu()
  173. );
  174.  
  175. $main_nav = wp_nav_menu($args);
  176. $output .= $main_nav;
  177.  
  178.  
  179. /*
  180. * Hook that can be used for plugins and theme extensions
  181. */
  182. ob_start();
  183. do_action('ava_inside_main_menu'); // todo: replace action with filter, might break user customizations
  184. $output .= ob_get_clean();
  185.  
  186. if($icon_beside)
  187. {
  188. $output .= $icons;
  189. }
  190.  
  191. $output .= '</nav>';
  192.  
  193. /*
  194. * Hook that can be used for plugins and theme extensions
  195. */
  196. ob_start();
  197. do_action('ava_after_main_menu'); // todo: replace action with filter, might break user customizations
  198. $output .= ob_get_clean();
  199. }
  200.  
  201. /* inner-container */
  202. $output .= "</div>";
  203.  
  204. /* end container */
  205. $output .= " </div> ";
  206.  
  207.  
  208. //output the whole menu
  209. echo $output;
  210.  
  211.  
  212. ?>
  213.  
  214. <!-- end container_wrap-->
  215. </div>
  216.  
  217. <div class='header_bg'></div>
  218.  
  219. <!-- end header -->
  220. </header>
Advertisement
Add Comment
Please, Sign In to add comment