示例#1
0
 function execute()
 {
     global $oscTemplate, $cPath;
     $OSCOM_CategoryTree = new category_tree();
     $OSCOM_CategoryTree->setCategoryPath($cPath, '<strong>', '</strong>');
     $OSCOM_CategoryTree->setSpacerString('&nbsp;&nbsp;', 1);
     $OSCOM_CategoryTree->setParentGroupString('<ul class="nav nav-list">', '</ul>', true);
     $data = '<div class="panel panel-default">' . '  <div class="panel-heading">' . MODULE_BOXES_CATEGORIES_BOX_TITLE . '</div>' . '  <div class="panel-body">' . $OSCOM_CategoryTree->getTree() . '</div>' . '</div>';
     $oscTemplate->addBlock($data, $this->group);
 }
 function execute()
 {
     global $oscTemplate, $cPath;
     $OSCOM_CategoryTree = new category_tree();
     $OSCOM_CategoryTree->setCategoryPath($cPath, '<strong>', '</strong>');
     $OSCOM_CategoryTree->setSpacerString('&nbsp;&nbsp;', 1);
     $OSCOM_CategoryTree->setParentGroupString('<ul class="nav nav-pills nav-stacked">', '</ul>', true);
     $category_tree = $OSCOM_CategoryTree->getTree();
     ob_start();
     include 'includes/modules/boxes/templates/categories.php';
     $data = ob_get_clean();
     $oscTemplate->addBlock($data, $this->group);
 }
<?php

$main_category_tree = new category_tree();
$row = 0;
$mobile_category_tree = $main_category_tree->zen_category_tree();
?>
<div id="cat" style="position: absolute; width: 100%; display: none; overflow: visible; min-height: 600px; z-index: 500; margin-top: 75px; background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(204, 204, 204, 1.0)), to(rgba(204, 204, 204, 0.50))); background-color: transparent;" class="ui-page ui-body-b">

	<div data-role="content" class="ui-content">	
		<ul data-role="listview" data-inset="true" class="ui-listview ui-listview-inset ui-corner-all ui-shadow">
		<?php 
for ($i = 0; $i < sizeof($mobile_category_tree); $i++) {
    ?>
			<li class="ui-li ui-li-static ui-body-c"><a href="category<?php 
    echo htmlspecialchars(preg_replace('/^cPath=/', '', $mobile_category_tree[$i]['path']));
    ?>
_1.htm?cPath=<?php 
    echo htmlspecialchars(preg_replace('/^cPath=/', '', $mobile_category_tree[$i]['path']));
    ?>
" class="ui-link"><?php 
    echo $mobile_category_tree[$i]['name'];
    ?>
 </a></li>
		<?php 
}
?>
		</ul>
	</div><!-- /content -->	
	
</div><!-- /page -->
示例#4
0
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id$
//
global $gBitDb, $gCommerceSystem, $gBitProduct;
require_once BITCOMMERCE_PKG_PATH . 'includes/bitcommerce_start_inc.php';
$main_category_tree = new category_tree();
$row = 0;
$box_categories_array = array();
// don't build a tree when no categories
if ($gBitDb->getOne("select `categories_id` from " . TABLE_CATEGORIES . " where `categories_status` = 1")) {
    $_template->tpl_vars['box_categories_array'] = new Smarty_variable($main_category_tree->zen_category_tree());
}
if (empty($moduleTitle)) {
    $_template->tpl_vars['moduleTitle'] = new Smarty_variable('Categories');
}
//	require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
示例#5
0
function return_content()
{
    $OSCOM_CategoryTree = new category_tree();
    $OSCOM_StatusTree = new status_tree();
    $return = '<!-- row start -->';
    $return .= '<div class="row">';
    $return .= '<!-- col starts -->';
    $return .= '<div class="col-md-3">';
    $return .= '<!-- panel starts -->';
    $return .= '<div id="storage" class="panel panel-default">';
    $return .= '<div class="panel-heading">';
    $return .= '<h3 class="panel-title">' . TEXT_PLACE_HOLDER . '</h3>';
    $return .= '</div>';
    $return .= '<div class="panel-body">';
    $return .= 'stuff';
    $return .= '</div>';
    $return .= '<ul id="header-storage" class="list-group">';
    $return .= $OSCOM_StatusTree->getStatusTree();
    $return .= '</ul>';
    $return .= '</div>';
    $return .= '<!-- panel ends -->';
    $return .= '</div>';
    $return .= '<!-- col ends -->';
    $return .= '<!-- board starts -->';
    $return .= '<div class="col-md-9">';
    $return .= '  <div id="header-container" class="drop_area">';
    $return .= $OSCOM_CategoryTree->getTree();
    $return .= '  </div>';
    $return .= '</div>';
    $return .= '<!-- board ends -->';
    $return .= '</div>';
    $return .= '<!-- row ends -->';
    header('Content-Type: application/json');
    echo json_encode($return);
}
示例#6
0
<?php

/**
 * categories sidebox - prepares content for the main categories sidebox
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: categories.php 2718 2005-12-28 06:42:39Z drbyte $
 */
$main_category_tree = new category_tree();
$row = 0;
$box_categories_array = array();
// don't build a tree when no categories
$check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1");
if ($check_categories->RecordCount() > 0) {
    $box_categories_array = $main_category_tree->zen_category_tree();
}
require $template->get_template_dir('tpl_categories.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_categories.php';
$title = BOX_HEADING_CATEGORIES;
$title_link = false;
require $template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default;
示例#7
0
<?php

/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/
require 'includes/application_top.php';
require DIR_WS_INCLUDES . 'bootstrap_top.php';
echo '<div id="dndPlaceHolder">';
echo '<div id="return-form-result"></div>';
$OSCOM_CategoryTree = new category_tree();
$OSCOM_StatusTree = new status_tree();
echo '<div id="header-result" class="container">' . '<!-- row start -->' . '<div class="row">' . '<!-- col starts -->' . '<div class="col-md-3">' . '<!-- panel starts -->' . '<div id="storage" class="panel panel-default">' . '<div class="panel-heading">' . '<h3 class="panel-title">' . TEXT_PLACE_HOLDER . '</h3>' . '</div>' . '<div class="panel-body">' . 'stuff' . '</div>' . '<ul id="header-storage" class="list-group">' . $OSCOM_StatusTree->getStatusTree() . '</ul>' . '</div>' . '<!-- panel ends -->' . '</div>' . '<!-- col ends -->' . '<!-- board starts -->' . '<div class="col-md-9">' . '<div id="header-container" class="drop_area">' . $OSCOM_CategoryTree->getTree() . '  </div>' . '</div>' . '</div>' . '<!-- board ends -->' . '</div>' . '<!-- row ends -->' . '</div>';
echo '</div><!-- dndPlaceHolder ends -->';
require DIR_WS_INCLUDES . 'bootstrap_bottom.php';
require DIR_WS_INCLUDES . 'application_bottom.php';
示例#8
0
		<div class="row nav_row">
			<div class="col-xs-12 col-sm-12 col-md-12 hidden-xs">
				<ul class="navbar">
			
					<li class="nav-item demo_nav"><a href="<?php 
echo zhlink();
?>
" title="<?php 
echo STORE_NAME;
?>
"><?php 
echo TEXT_HOME;
?>
</a></li>
					<?php 
$main_category_tree = new category_tree();
$main_category_tree->zen_category_tree();
$nav_count = 0;
foreach ((array) $main_category_tree->tree_parents[0] as $cate) {
    ?>
						<?php 
    if (++$nav_count >= (int) HEADER_NAV_SHOW_TOTAL) {
        break;
    }
    ?>
						<?php 
    if ($cate['is_top']) {
        ?>
						<li class="nav-item demo_nav">
							<div class="">
							<a href="<?php 
示例#9
0
 protected function _buildHeaderBranch($parent_id, $level = 0)
 {
     $result = '';
     $OSCOM_CategoryTree = new category_tree();
     if (isset($this->_data[$parent_id])) {
         foreach ($this->_data[$parent_id] as $category_id => $category) {
             $category_link = $category_id;
             if ($level === 0 && isset($this->_data[$category_id]) && ($this->max_level == '0' || $this->max_level > $level + 1)) {
                 //we need a opener
             }
             $link_title = $category['name'];
             if (!empty($category['headers_class'])) {
                 $headers_class_extra = $category['headers_class'];
                 $headers_class = 'class=" ' . $category['headers_class'] . ' "';
             } else {
                 $headers_class_extra = null;
                 $headers_class = null;
             }
             if (!empty($category['headers_css_id'])) {
                 $headers_css_id_extra = $category['headers_css_id'];
                 $headers_css_id = 'id="' . $category['headers_css_id'] . '"';
             } else {
                 $headers_css_id_extra = null;
                 $headers_css_id = null;
             }
             if (!empty($category['headers_fa_icon'])) {
                 $headers_fa_icon = '<i class="fa ' . $category['headers_fa_icon'] . '"></i>';
             } else {
                 $headers_fa_icon = null;
             }
             if ($category['type'] == 'div') {
                 $result .= '		<!-- div Startsabc -->';
                 $result .= '			<div ' . $headers_css_id . ' ' . $headers_class . '>';
             }
             if ($category['type'] == 'row') {
                 $result .= '		<!-- row Starts -->';
                 $result .= '			<div ' . $headers_css_id . ' class=" row ' . $headers_class_extra . ' ">';
             }
             if ($category['type'] == 'column') {
                 $result .= '		<!-- column Starts -->';
                 $result .= '			<div ' . $headers_css_id . ' class=" ' . $headers_class_extra . ' ">';
             }
             if ($category['type'] == 'container') {
                 $result .= '		<!-- Container Starts -->';
                 $result .= '			<div ' . $headers_css_id . ' class=" container ' . $headers_class_extra . ' ">';
             }
             if ($category['type'] == 'ul') {
                 $result .= '		<!-- Ul Starts -->';
                 $result .= '			<ul ' . $headers_css_id . ' class=" ' . $headers_class_extra . ' ">';
             }
             if ($category['type'] == 'nav') {
                 $result .= '		<!-- nav Starts -->';
                 $result .= '			<nav ' . $headers_css_id . ' class=" ' . $headers_class_extra . ' " role="navigation">';
             }
             if ($category['type'] == 'logo') {
                 $result .= '					<!-- Logo Starts -->';
                 $result .= '							<div ' . $headers_css_id . ' ' . $headers_class . '>';
                 $result .= '								<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME, '', '', 'class="img-responsive"') . '</a>';
                 $result .= '							</div>';
                 $result .= '					<!-- Logo Ends -->';
             }
             if ($category['type'] == 'link') {
                 $result .= '<li ' . $headers_css_id . ' ' . $headers_class . '><a href="' . tep_href_link($category['headers_url'], '', 'SSL') . '">' . $headers_fa_icon . ' ' . $link_title . '</a></li>';
             }
             if ($category['type'] == 'singlecat') {
                 $result .= '<p class="' . $headers_class . ' ">';
                 $result .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $OSCOM_CategoryTree->getData($category['headers_url'], 'id')) . '">';
                 $result .= $OSCOM_CategoryTree->getData($category['headers_url'], 'categories_name');
                 $result .= '</a>';
                 $result .= '</p>';
             }
             if ($category['type'] == 'text') {
                 $result .= '<p class="' . $headers_class . ' ">' . $link_title . '</p>';
             }
             if ($category['type'] == 'button') {
                 $result .= '<button type="button" ' . $headers_css_id . ' class="btn  ' . $headers_class_extra . ' "><a href="' . $category['headers_url'] . '">' . $link_title . '</a></button>';
             }
             if ($category['type'] == 'cart') {
                 // create the shopping cart
                 global $cart, $currencies;
                 $result .= '<div ' . $headers_css_id . ' class="' . $headers_class_extra . '">';
                 $result .= '    <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">';
                 $result .= '	 <img src="images/header_cart.png" alt="" class="img-responsive hidden-xs" style="float:left;" height="50" width="44"></a>';
                 $result .= '        <p class="text-left" style="white-space: nowrap;"><strong>Cart Contents (' . $cart->count_contents() . ') items</strong></p>';
                 $result .= '        <p class="text-left" style="white-space: nowrap;">Total: ' . $currencies->format($cart->show_total()) . '</p>';
                 $result .= '</div>';
             }
             //dropdown language
             if ($category['type'] == 'language') {
                 global $lng, $language, $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency;
                 $result .= '        <li class="dropdown ' . $headers_class_extra . '">';
                 $result .= '          <a href="#" class="dropdown-toggle" data-toggle="dropdown">';
                 $result .= '						<img id="current_lang" src="' . DIR_WS_LANGUAGES . $language . '/images/icon.gif' . '" width="16" height="11" alt="' . $language . '" /> <span class="hidden-xs">';
                 $result .= sprintf(USER_LOCALIZATION, ucwords($language), $currency);
                 $result .= '</span>';
                 $result .= '<span class="caret"></span></a>';
                 $result .= '<ul class="dropdown-menu" role="menu">';
                 if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {
                     if (count($lng->catalog_languages) > 1) {
                         //echo '<li class="divider"></li>';
                         reset($lng->catalog_languages);
                         while (list($key, $value) = each($lng->catalog_languages)) {
                             $result .= '<li><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . tep_image(DIR_WS_LANGUAGES . $value['directory'] . '/images/' . $value['image'], $value['name']) . $value['name'] . '</a></li>';
                         }
                     }
                     // currencies
                     if (isset($currencies) && is_object($currencies) && count($currencies->currencies) > 1) {
                         $result .= '<li class="divider"></li>';
                         reset($currencies->currencies);
                         $currencies_array = array();
                         while (list($key, $value) = each($currencies->currencies)) {
                             $currencies_array[] = array('id' => $key, 'text' => $value['title']);
                             $result .= '<li><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('language', 'currency')) . 'currency=' . $key, $request_type) . '">' . $value['title'] . '</a></li>';
                         }
                     }
                 }
                 $result .= '          </ul>';
                 $result .= '        </li>';
                 $result .= '				<!-- /LANGUAGE -->';
             }
             //formsearch
             if ($category['type'] == 'formsearch') {
                 global $request_type;
                 $result .= '<div ' . $headers_css_id . ' ' . $headers_class . '>';
                 $result .= tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', $request_type, false), 'get');
                 $result .= '            <div class="input-group custom-search-form">';
                 $result .= tep_draw_input_field('keywords', '', 'required placeholder="' . TEXT_SEARCH_PLACEHOLDER . '"');
                 $result .= '              <span class="input-group-btn">';
                 $result .= '              <button class="btn btn-default" type="submit">';
                 $result .= '              <i class="fa fa-search"></i>';
                 $result .= '             </button>';
                 $result .= '             </span>';
                 $result .= '             </div><!-- /input-group -->';
                 $result .= tep_draw_hidden_field('search_in_description', '1') . tep_hide_session_id();
                 $result .= '</form>';
                 $result .= '</div>';
             }
             if ($category['type'] == 'formdefault') {
                 $result .= '<form id="search" class="navbar-form  ' . $headers_class . ' " role="search">';
                 $result .= '  <div class="form-group">';
                 $result .= '<input type="text" class="form-control" placeholder="' . $link_title . '">';
                 $result .= '  </div>';
                 $result .= '</form>';
             }
             if ($category['type'] == 'formsubmit') {
                 $result .= '<form class="navbar-form  ' . $headers_class . ' " role="search">';
                 $result .= '  <div class="form-group">';
                 $result .= '<input type="text" class="form-control" placeholder="' . $link_title . '">';
                 $result .= '  </div>';
                 $result .= '  <button type="submit" class="btn btn-default">Submit</button>';
                 $result .= '</form>';
             }
             //For navbar CONTENT only End
             if ($category['type'] == 'navtoggle') {
                 $result .= '<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".' . $headers_class_extra . '">';
                 $result .= '<span class="sr-only">Toggle Navigation</span>';
                 $result .= '	<i class="fa fa-bars"></i>';
                 $result .= '</button>';
             }
             //We need to check dropdowncat content Start
             if ($category['type'] == 'dropdowncat') {
                 $result .= '<ul ' . $headers_css_id . ' class="nav navbar-nav  ' . $headers_class_extra . ' ">';
                 $result .= '    <li class="dropdown">';
                 $result .= '           <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $OSCOM_CategoryTree->getData($category['headers_url'], 'categories_name') . '<span class="caret"></span></a>';
                 $result .= '        <ul class="dropdown-menu" role="menu">';
                 $result .= $OSCOM_CategoryTree->setRootCategoryID($category['headers_url']);
                 $result .= $OSCOM_CategoryTree->getTree();
                 $result .= '        </ul>';
                 $result .= '    </li>';
                 $result .= '</ul>';
             }
             //We need to check dropdown content Start
             if ($category['type'] == 'dropdown') {
                 $result .= '        <li class="dropdown ' . $headers_class_extra . '">';
                 $result .= '          <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $link_title . '<span class="caret"></span></a>';
                 $result .= '<ul class="dropdown-menu" role="menu">';
             }
             if ($category['type'] == 'nestedlink' && $level > 1) {
                 if ($category['pos'] == 'dropdown-submenu' && $level > 1) {
                     $result .= '<li class=" ' . $headers_class . ' "><a href="#">' . $link_title . '</a><ul class="dropdown-menu">';
                 } else {
                     if ($category['type'] == 'nestedlink' && $level > 1) {
                         $result .= '<li class=" ' . $headers_class . ' "><a href="#">' . $link_title . '</a></li>';
                     }
                 }
             }
             if ($category['type'] == 'nestedtext' && $level > 1) {
                 if ($category['pos'] == 'dropdown-submenu' && $level > 1) {
                     $result .= '<li class=" ' . $headers_class . ' "><a href="#">' . $link_title . '</a><ul class="dropdown-menu">';
                 } else {
                     if ($category['type'] == 'nestedtext' && $level > 1) {
                         $result .= '<li class=" ' . $headers_class . ' "><a href="#">' . $link_title . '</a></li>';
                     }
                 }
             }
             if (isset($this->_data[$category_id]) && ($this->max_level == '0' || $this->max_level > $level + 1)) {
                 $result .= $this->_buildHeaderBranch($category_id, $level + 1);
             }
             if ($category['pos'] == 'dropdown-submenu' && $level > 1) {
                 $result .= '</li></ul>';
             }
             //We need to check dropdown content End
             if ($category['type'] == 'dropdown') {
                 $result .= '          </ul>';
                 $result .= '        </li>';
             }
             //We need to close ul's End
             if ($category['type'] == 'ul') {
                 $result .= '			</ul>';
                 $result .= '		<!-- ' . $category['type'] . ' Ends -->';
             }
             //We need to close navbar's End
             if ($category['type'] == 'nav') {
                 $result .= '			</nav>';
                 $result .= '		<!-- ' . $category['type'] . ' Ends -->';
             }
             //we need a closer
             if ($category['type'] == 'div' || $category['type'] == 'container' || $category['type'] == 'row' || $category['type'] == 'column') {
                 $result .= '			</div>';
                 $result .= '		<!-- ' . $category['type'] . ' Ends -->';
             }
             if ($level === 0 && isset($this->_data[$category_id]) && ($this->max_level == '0' || $this->max_level > $level + 1)) {
             }
         }
     }
     $result .= '';
     return $result;
 }
<?php

$main_category_tree1 = new category_tree();
$box_categories_arr2ay2 = array();
$box_categories_arr2 = array();
$tpl_categories2 = array();
$tpl_categories_top5 = array();
$categoriesortvalue2 = array();
$rand_num = 1;
// don't build a tree when no categories
$check_categories = $db->Execute("select categories_id from " . TABLE_CATEGORIES . " where categories_status=1 limit 1", false, true, CACHE_TIMELIFT);
if ($check_categories->RecordCount() > 0) {
    $box_categories_arr2ay2 = $main_category_tree1->zen_category_tree();
}
$idx = 0;
foreach ($box_categories_arr2ay2 as $category) {
    if ($category['parent_id'] != 0) {
        $box_categories_arr2[$category['parent_id']]['children'][$category['categories_id']] = $category;
        if ($category['has_sub_cat'] == 1) {
            foreach ($category as $key => $cate) {
                $box_categories_arr2[$category['categories_id']][$key] = $cate;
            }
        } else {
        }
    } else {
        foreach ($category as $key => $cate) {
            $box_categories_arr2[$category['categories_id']][$key] = $cate;
        }
    }
}
foreach ($box_categories_arr2 as $category) {
示例#11
0
 protected function _buildHeaderBranch($parent_id, $level = 0)
 {
     $result = '';
     $OSCOM_CategoryTree = new category_tree();
     if (isset($this->_data[$parent_id])) {
         foreach ($this->_data[$parent_id] as $category_id => $category) {
             $category_link = $category_id;
             if ($category['pos'] !== 'null') {
                 $pos = '';
             }
             if ($level === 0 && isset($this->_data[$category_id]) && ($this->max_level == '0' || $this->max_level > $level + 1)) {
                 //we need a opener
             }
             $link_title = $category['name'];
             if ($category['type'] == 'header-top') {
                 $result .= '			<div class="header-top">';
                 $result .= '				<div class="container">';
                 $result .= '					<!-- Header Links Starts -->';
                 $result .= '						<div class="col-xs-12 col-sm-8 col-md-12 col-lg-12">';
                 $result .= '							<div class="header-links">';
             }
             if ($category['type'] == 'row') {
                 $result .= '		<!-- row Starts -->';
                 $result .= '			<div class="row">';
             }
             if ($category['type'] == 'column') {
                 $result .= '		<!-- column Starts -->';
                 $result .= '			<div class="' . $link_title . '">';
             }
             if ($category['type'] == 'container') {
                 $result .= '		<!-- Container Starts -->';
                 $result .= '			<div class="container">';
             }
             if ($category['type'] == 'main-header') {
                 $result .= '			<!-- Main Header Starts -->';
                 $result .= '				<div class="main-header">';
                 $result .= '					<div class="row">';
             }
             if ($category['type'] == 'main-menu') {
                 $result .= '			<!-- Main Menu Starts -->';
                 $result .= '				<nav id="main-menu" class="navbar gradient-yellow" role="navigation">';
                 $result .= '				<!-- Nav Header Starts -->';
                 $result .= '					<div class="navbar-header">';
                 $result .= '						<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-cat-collapse">';
                 $result .= '							<span class="sr-only">Toggle Navigation</span>';
                 $result .= '							<i class="fa fa-bars"></i>';
                 $result .= '						</button>';
                 $result .= '					</div>';
                 $result .= '				<!-- Nav Header Ends -->';
                 $result .= '				<!-- Navbar Cat collapse Starts -->';
                 $result .= '					<div class="collapse navbar-collapse navbar-cat-collapse">';
             }
             if ($category['type'] == 'Logo') {
                 $result .= '					<!-- Logo Starts -->';
                 $result .= '							<div id="logo" class="hidden-xs">';
                 $result .= '								<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME, '', '', 'class="img-responsive"') . '</a>';
                 $result .= '							</div>';
                 $result .= '					<!-- Logo Ends -->';
             }
             /*
                      //For navbar only Start 
             		 if($category['type'] == 'Logo'){
               $result .= '<div class="navbar-header">';
             			
                         $result .= '<a class="navbar-brand" href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME, '', '', 'class="img-responsive"') . '</a>';
               $result .= '</div>';
             }		 
             		 if($category['type'] == 'Brand'){
               $result .= '<div class="navbar-header">';
                         $result .= '<a class="navbar-brand" href="#">' . $link_title . '</a>';
               $result .= '</div>';
             }
             		 if($category['type'] == 'Parent'){
               $result .= '';
             }		  
             //For navbar only End
             */
             //For navbar CONTENT only Start
             if ($category['type'] == 'Link') {
                 $result .= '<p class="' . $pos . ' "><a href="' . $category['headers_url'] . '">' . $link_title . '</a></p>';
             }
             if ($category['type'] == 'SingleCat') {
                 $result .= '<p class="' . $pos . ' ">';
                 $result .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $OSCOM_CategoryTree->getData($category['headers_url'], 'id')) . '">';
                 $result .= $OSCOM_CategoryTree->getData($category['headers_url'], 'categories_name');
                 $result .= '</a>';
                 $result .= '</p>';
             }
             if ($category['type'] == 'Text') {
                 $result .= '<p class="' . $pos . ' ">' . $link_title . '</p>';
             }
             if ($category['type'] == 'Button') {
                 $result .= '<button type="button" class="btn btn-info navbar-btn  ' . $pos . ' ">' . $link_title . '</button>';
             }
             if ($category['type'] == 'Cart') {
                 $result .= '<div class="text-right" style="margin: 0px 20px;">';
                 $result .= '    <a href="shopping_cart.php">';
                 $result .= '	 <img src="images/header_cart.png" alt="" class="img-responsive hidden-xs" style="float:left;" height="50" width="44"></a>';
                 $result .= '        <p class="text-left" style="white-space: nowrap;"><strong>Cart Contents</strong></p>';
                 $result .= '        <p class="text-left" style="white-space: nowrap;">0 item(s) totalling $0.00</p>';
                 $result .= '</div>';
             }
             if ($category['type'] == 'FormSearch') {
                 $result .= '<div id="search" class="pull-left">';
                 $result .= '	<div class="row">';
                 $result .= '		<div class="col-lg-12">';
                 $result .= '            <div class="input-group custom-search-form">';
                 $result .= '              <input type="text" class="form-control" placeholder="Search">';
                 $result .= '              <span class="input-group-btn">';
                 $result .= '              <button class="btn btn-default" type="button">';
                 $result .= '              <i class="fa fa-search"></i>';
                 $result .= '             </button>';
                 $result .= '             </span>';
                 $result .= '             </div><!-- /input-group -->';
                 $result .= '        </div>';
                 $result .= '	</div>';
                 $result .= '</div>';
             }
             if ($category['type'] == 'FormDefault') {
                 $result .= '<form id="search" class="navbar-form  ' . $pos . ' " role="search">';
                 $result .= '  <div class="form-group">';
                 $result .= '<input type="text" class="form-control" placeholder="' . $link_title . '">';
                 $result .= '  </div>';
                 $result .= '</form>';
             }
             if ($category['type'] == 'FormSubmit') {
                 $result .= '<form class="navbar-form  ' . $pos . ' " role="search">';
                 $result .= '  <div class="form-group">';
                 $result .= '<input type="text" class="form-control" placeholder="' . $link_title . '">';
                 $result .= '  </div>';
                 $result .= '  <button type="submit" class="btn btn-default">Submit</button>';
                 $result .= '</form>';
             }
             //For navbar CONTENT only End
             //We need to check dropdown content Start
             if ($category['type'] == 'DropdownCat') {
                 $result .= '<ul class="nav navbar-nav  ' . $pos . ' ">';
                 $result .= '        <li class="dropdown">';
                 $result .= '          <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">' . $OSCOM_CategoryTree->getData($category['headers_url'], 'categories_name') . '</a>';
                 $result .= '<ul class="dropdown-menu" role="menu">';
                 $result .= $OSCOM_CategoryTree->setRootCategoryID($category['headers_url']);
                 $result .= $OSCOM_CategoryTree->getTree();
                 $result .= '          </ul>';
                 $result .= '        </li>';
                 $result .= '     </ul>';
             }
             //We need to check dropdown content Start
             if ($category['type'] == 'Dropdown') {
                 $result .= '<ul class="nav navbar-nav  ' . $pos . ' ">';
                 $result .= '        <li class="dropdown">';
                 $result .= '          <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $link_title . '<span class="caret"></span></a>';
                 $result .= '<ul class="dropdown-menu" role="menu">';
             }
             if ($category['type'] == 'nestedlink' && $level > 1) {
                 if ($category['pos'] == 'dropdown-submenu' && $level > 1) {
                     $result .= '<li class=" ' . $pos . ' "><a href="#">' . $link_title . '</a><ul class="dropdown-menu">';
                 } else {
                     if ($category['type'] == 'nestedlink' && $level > 1) {
                         $result .= '<li class=" ' . $pos . ' "><a href="#">' . $link_title . '</a></li>';
                     }
                 }
             }
             if ($category['type'] == 'nestedtext' && $level > 1) {
                 if ($category['pos'] == 'dropdown-submenu' && $level > 1) {
                     $result .= '<li class=" ' . $pos . ' "><a href="#">' . $link_title . '</a><ul class="dropdown-menu">';
                 } else {
                     if ($category['type'] == 'nestedtext' && $level > 1) {
                         $result .= '<li class=" ' . $pos . ' "><a href="#">' . $link_title . '</a></li>';
                     }
                 }
             }
             if (isset($this->_data[$category_id]) && ($this->max_level == '0' || $this->max_level > $level + 1)) {
                 $result .= $this->_buildHeaderBranch($category_id, $level + 1);
             }
             if ($category['pos'] == 'dropdown-submenu' && $level > 1) {
                 $result .= '</li></ul>';
             }
             if ($category['type'] == 'Dropdown') {
                 $result .= '          </ul>';
                 $result .= '        </li>';
                 $result .= '     </ul>';
             }
             //We need to check dropdown content End
             if ($category['type'] == 'main-menu') {
                 $result .= '					</div>';
                 $result .= '				<!-- Navbar Cat collapse Ends -->';
                 $result .= '				</nav>';
                 $result .= '			<!-- Main Menu Ends -->';
             }
             if ($category['type'] == 'main-header') {
                 $result .= '				</div>';
                 $result .= '					</div>';
                 $result .= '			<!-- Main Header Ends -->';
             }
             if ($category['type'] == 'Container') {
                 $result .= '			</div>';
                 $result .= '		<!-- Container Ends -->';
             }
             if ($category['type'] == 'Col') {
                 $result .= '			</div>';
                 $result .= '		<!-- Column Ends -->';
             }
             if ($category['type'] == 'Row') {
                 $result .= '			</div>';
                 $result .= '		<!-- Row Ends -->';
             }
             if ($category['type'] == 'header-top') {
                 $result .= '							</div>';
                 $result .= '						</div>';
                 $result .= '						<!-- Header Links Ends -->';
                 $result .= '						</div>';
                 $result .= '					</div>';
             }
             if ($level === 0 && isset($this->_data[$category_id]) && ($this->max_level == '0' || $this->max_level > $level + 1)) {
                 //we need a closer
             }
         }
     }
     $result .= '';
     return $result;
 }
// | Copyright (c) 2004 The zen-cart developers                           |
// |                                                                      |
// | http://www.zen-cart.com/index.php                                    |
// |                                                                      |
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id$
//
global $gBitDb, $gCommerceSystem, $gBitProduct;
if (empty($gCommerceSystem)) {
    require_once BITCOMMERCE_PKG_PATH . 'includes/bitcommerce_start_inc.php';
}
$main_category_tree = new category_tree();
$row = 0;
$box_categories_array = array();
// don't build a tree when no categories
$check_categories = $gBitDb->getOne("select `categories_id` from " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCT_TYPES . " pt, " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " ptc where pt.`type_master_type` = '3' and ptc.`product_type_id` = pt.`type_id` and c.`categories_id` = ptc.`category_id` and c.`categories_status`=1");
if ($check_categories) {
    $_template->tpl_vars['sideboxDocumentCategories'] = new Smarty_variable($main_category_tree->zen_category_tree('3'));
    if (empty($moduleTitle)) {
        $_template->tpl_vars['moduleTitle'] = new Smarty_variable('Documents');
    }
}