<?php
/**
 * Common Template - tpl_main_page.php
 *
 * @package Genesis
 */

if (in_array($current_page_base,explode(",",'checkout_success,checkout_confirmation,checkout_payment_address,checkout_shipping_address,checkout_payment,checkout_shipping,shopping_cart,login,create_account,account,account_edit,account_history,account_history_info,account_newsletters,account_notifications,account_password,address_book,address_book_process')) ) {
  $flag_disable_right = true;
  $flag_disable_left = true;
}

$header_template = 'tpl_header.php';
$footer_template = 'tpl_footer.php';
$left_column_file = 'column_left.php';
$right_column_file = 'column_right.php';
$body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);

if (COLUMN_LEFT_STATUS == 0 || $this_is_home_page || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_LEFT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  $flag_disable_left = true;
}
if (COLUMN_RIGHT_STATUS == 0 || $this_is_home_page || (CUSTOMERS_APPROVAL == '1' and $_SESSION['customer_id'] == '') || (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_COLUMN_RIGHT_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == ''))) {
  $flag_disable_right = true;
}

?>

<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
  <div class="container">
    <div id="content" class="site-content">
      <!--Header-->
      <?php
      if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
        $flag_disable_header = true;
      }
      require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');
      ?>
      <!--Header-->

      <?php if ((DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) && !$this_is_home_page ) : ?>
        <div id="navBreadCrumb">
          <div class="inner-container">
            <h2 class="breadcrumb-title"><?php echo $breadcrumb->last(); ?></h2>
            <div class="breadcrumb"><?php echo $breadcrumb->trail('&raquo;'); ?></div>
          </div>
        </div>
      <?php endif; ?>

      <?php
        if ($this_is_home_page){
          require($template->get_template_dir('tpl_hero.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_hero.php');
        }
      ?>

      <div id="main-container" class="inner-container <?php echo genesis_layout_class(); ?>">
        <div id="main-row" class="row">

          <div id="primary" class="content-area <?php echo genesis_center_column_class(); ?>">

            <?php require($body_code); ?>
          </div>

          <?php if (!isset($flag_disable_left) || !$flag_disable_left) : ?>
            <div id="secondary-left" class="sidebar col-md-3 <?php echo ( !$flag_disable_right ? 'col-md-pull-6' : 'col-md-pull-9' ); ?>" role="complementary">
              <?php require(DIR_WS_MODULES . zen_get_module_directory('column_left.php')); ?>
            </div>
          <?php endif; ?>

          <?php if (!isset($flag_disable_right) || !$flag_disable_right) : ?>
            <div id="secondary-right" class="sidebar col-md-3" role="complementary">
              <?php require(DIR_WS_MODULES . zen_get_module_directory('column_right.php')); ?>
            </div>
          <?php endif; ?>

        </div>
      </div>

      <?php
        if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_FOOTER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
          $flag_disable_footer = true;
        }
        require($template->get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');
      ?>

    </div>
  </div>
<?php if(zen_not_null($genesis_options['site_btt'])) : ?>
  <a id="back-top" href="#">&uarr;</a>
<?php endif; ?>

<!-- Photoswipe Element -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> <div class="pswp__bg"></div><div class="pswp__scroll-wrap"> <div class="pswp__container"> <div class="pswp__item"></div><div class="pswp__item"></div><div class="pswp__item"></div></div><div class="pswp__ui pswp__ui--hidden"> <div class="pswp__top-bar"> <div class="pswp__counter"></div><button class="pswp__button pswp__button--close" title="Close (Esc)"></button> <button class="pswp__button pswp__button--share" title="Share"></button> <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button> <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button> <div class="pswp__preloader"> <div class="pswp__preloader__icn"> <div class="pswp__preloader__cut"> <div class="pswp__preloader__donut"></div></div></div></div></div><div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"> <div class="pswp__share-tooltip"></div></div><button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"> </button> <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"> </button> <div class="pswp__caption"> <div class="pswp__caption__center"></div></div></div></div></div>
<!-- Photoswipe Element -->
<?php genesis_footer(); ?>
</body>
