123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <?php
- /**
- * @version 7.10 [rev.7.10.02]
- */
- $categories = $this->categories()->getData();
- /** @var \Ppb\Service\Table\Relational\Categories $categoriesService */
- $categoriesService = $this->categories()->getCategories();
- if (!count($categories)) {
- $categories = $this->categories(
- $categoriesService->getTable()
- ->select()
- ->where('parent_id IS NULL')
- ->where('enable_auctions = ?', 1)
- ->where('user_id IS NULL')
- ->order(array('order_id ASC', 'name ASC'))
- );
- }
- /** @var \Cube\Controller\Request $request */
- $request = $this->request()->getRequest();
- $categoryId = $request->getParam('category_id');
- $parentId = $request->getParam('parent_id');
- ?>
- <div id="desktop-navigation" class="hidden-xs">
- <div class="branding-header">
- <!-- logo left -->
- <div class="logo">
- <a href="<?php echo $this->url(null, 'app-home'); ?>" title="<?php echo $this->settings['sitename']; ?>">
- <img src="<?php echo $this->thumbnail()->generateImagePath($this->settings['site_logo_path']); ?>"
- alt="<?php echo $this->settings['sitename']; ?>">
- </a>
- </div>
- <!-- end logo left -->
- <!-- header content -->
- <div class="header-content">
- <!-- horizontal menu -->
- <div class="left-navbar">
- <div>
- <small>
- <?php echo $this->_('Welcome'); ?>,
- <strong>
- <?php echo (isset($this->loggedInUser['username'])) ?
- $this->loggedInUser['username'] : $this->_('Guest'); ?>
- </strong>
- </small>
- </div>
- <ul class="nav navbar-nav">
- <?php if (!empty($this->loggedInUser['id'])) { ?>
- <li>
- <a href="<?php echo $this->url(null,
- 'members-index'); ?>"><?php echo $this->_('Members Area'); ?></a>
- </li>
- <li>
- <a href="<?php echo $this->url(null, 'members-logout'); ?>"
- title="<?php echo $this->_('Logout'); ?>"><i class="fa fa-sign-out"></i></a>
- </li>
- <?php
- }
- else {
- $registerModal = ($this->settings['registration_type'] == 'quick' && !\Ppb\Form\Element\ReCaptcha::$loaded) ? true : false;
- ?>
- <li>
- <a <?php echo ($registerModal) ? 'class="dialog-box"' : ''; ?>
- href="<?php echo $this->url(array('module' => 'members', 'controller' => 'user', 'action' => ($registerModal) ? 'register-modal' : 'register')); ?>"
- title="<?php echo $this->_('Register'); ?>"><i class="fa fa-user-plus"></i> </a>
- </li>
- <li>
- <a class="dialog-box"
- href="<?php echo $this->url(array('module' => 'members', 'controller' => 'user', 'action' => 'login-modal')); ?>"
- title="<?php echo $this->_('Login'); ?>"><i class="fa fa-sign-in"></i></a>
- </li>
- <?php } ?>
- <li>
- <a href="<?php echo $this->url(array('module' => 'members', 'controller' => 'tools', 'action' => 'watched-items')); ?>"
- title="<?php echo $this->_('Wishlist'); ?>"><i class="fa fa-heart-o"></i></a>
- </li>
- </ul>
- </div>
- <ul class="nav navbar-nav navbar-right">
- <?php foreach ($this->menu->pages as $page) { ?>
- <?php if ((!$page->settings || (intval($this->settings[(string)$page->settings['name']]) == $page->settings['value'])) &&
- ($this->navigation()->accept($page)) && $page->hidden != 'true'
- ) {
- ?>
- <li <?php echo ($page->isActive(true)) ? 'class="active"' : ''; ?>>
- <a href="<?php echo $this->url($page->params); ?>">
- <?php echo $page->label; ?>
- </a>
- </li>
- <?php } ?>
- <?php } ?>
- <?php if ($this->settings['enable_shopping_cart']) { ?>
- <li>
- <?php echo $this->cartDropdown(); ?>
- </li>
- <?php } ?>
- </ul>
- <!-- end horizontal menu -->
- </div>
- <!-- end header content -->
- </div>
- <!-- end branding header -->
- <div class="clearfix"></div>
- <!-- header advert -->
- <?php
- $advert = $this->advert()->findBySection('header', false, array($parentId));
- if ($advert !== null) {
- ?>
- <p class="text-center">
- <?php echo $this->advert($advert)->display(); ?>
- </p>
- <?php } ?>
- <!-- search bar -->
- <div class="search-bar">
- <!-- browse menu -->
- <div class="browse-menu col-sm-2">
- <a id="browse-btn" href="#"><?php echo $this->_('Browse'); ?> <i class="fa fa-angle-down"></i></a>
- </div>
- <ul id="browse-content">
- <?php
- /** @var \Ppb\Db\Table\Row\Category $category */
- foreach ($categories as $category) {
- $counter = $category->getCounter();
- if ($counter > 0 || !$this->settings['hide_empty_categories']) {
- ?>
- <li>
- <a href="<?php echo $this->url($category->link()); ?>">
- <?php echo $this->_($category['name']); ?>
- </a>
- <?php
- if ($this->settings['category_counters']) {
- echo '<small>(' . $counter . ')</small>';
- }
- ?>
- </li>
- <?php } ?>
- <?php } ?>
- </ul>
- <!-- end browse menu -->
- <!-- search and categories -->
- <div class="col-sm-8 col-xs-12">
- <form id="form-header-search" class="form-inline form-header"
- action="<?php echo $this->url(null, 'listings-search'); ?>"
- method="get">
- <div class="form-group hidden-sm">
- <input type="hidden" name="parent_id"
- value="<?php echo $request->getParam('parent_id'); ?>">
- <ul id="category-select-content">
- <li>
- <a href="#"
- data-id=""
- data-category-name="<?php echo $this->_('All Categories'); ?>">
- <?php echo $this->_('All Categories'); ?>
- </a>
- </li>
- <?php
- $selectedCategory = $this->_('Choose Category');
- $maxChars = 20;
- /** @var \Ppb\Db\Table\Row\Category $category */
- foreach ($categories as $category) {
- $shortCategoryName = $this->_($category['name']);
- $length = strlen($shortCategoryName);
- $shortCategoryName = substr($shortCategoryName, 0, $maxChars) . (($length > $maxChars) ? '...' : '');
- if ($category['id'] == $request->getParam('parent_id')) {
- $selectedCategory = $shortCategoryName;
- }
- ?>
- <li>
- <a href="<?php echo $this->url($category->link()); ?>"
- data-id="<?php echo $category['id']; ?>"
- data-category-name="<?php echo $shortCategoryName; ?>">
- <?php echo $this->_($category['name']); ?>
- </a>
- </li>
- <?php } ?>
- </ul>
- <a id="category-select-btn" class="form-control input-medium" href="#">
- <span><?php echo $selectedCategory; ?></span> <i class="fa fa-angle-down"></i>
- </a>
- </div>
- <div class="form-group">
- <input id="basic-search" type="text" name="keywords" class="form-control input-search"
- value="<?php echo $this->request()->getRequest()->getParam('keywords'); ?>"
- placeholder="<?php echo $this->_('Search...'); ?>">
- </div>
- <button type="submit" class="btn btn-primary"><?php echo $this->_('Search'); ?></button>
- </form>
- </div>
- <!-- end search and categories -->
- <!-- advanced search -->
- <div class="col-md-1 hidden-sm advanced-search-box">
- <a href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'search', 'action' => 'advanced')); ?>"><?php echo $this->_('Advanced'); ?></a>
- </div>
- <div class="col-md-1 col-sm-2">
- <?php if ($this->settings['user_languages']) { ?>
- <?php echo $this->language(); ?>
- <?php } ?>
- </div>
- <!-- end advanced search -->
- </div>
- <!-- end search bar -->
- </div>
|