desktop.phtml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <?php
  2. /**
  3. * @version 7.10 [rev.7.10.02]
  4. */
  5. $categories = $this->categories()->getData();
  6. /** @var \Ppb\Service\Table\Relational\Categories $categoriesService */
  7. $categoriesService = $this->categories()->getCategories();
  8. if (!count($categories)) {
  9. $categories = $this->categories(
  10. $categoriesService->getTable()
  11. ->select()
  12. ->where('parent_id IS NULL')
  13. ->where('enable_auctions = ?', 1)
  14. ->where('user_id IS NULL')
  15. ->order(array('order_id ASC', 'name ASC'))
  16. );
  17. }
  18. /** @var \Cube\Controller\Request $request */
  19. $request = $this->request()->getRequest();
  20. $categoryId = $request->getParam('category_id');
  21. $parentId = $request->getParam('parent_id');
  22. ?>
  23. <div id="desktop-navigation" class="hidden-xs">
  24. <div class="branding-header">
  25. <!-- logo left -->
  26. <div class="logo">
  27. <a href="<?php echo $this->url(null, 'app-home'); ?>" title="<?php echo $this->settings['sitename']; ?>">
  28. <img src="<?php echo $this->thumbnail()->generateImagePath($this->settings['site_logo_path']); ?>"
  29. alt="<?php echo $this->settings['sitename']; ?>">
  30. </a>
  31. </div>
  32. <!-- end logo left -->
  33. <!-- header content -->
  34. <div class="header-content">
  35. <!-- horizontal menu -->
  36. <div class="left-navbar">
  37. <div>
  38. <small>
  39. <?php echo $this->_('Welcome'); ?>,
  40. <strong>
  41. <?php echo (isset($this->loggedInUser['username'])) ?
  42. $this->loggedInUser['username'] : $this->_('Guest'); ?>
  43. </strong>
  44. </small>
  45. </div>
  46. <ul class="nav navbar-nav">
  47. <?php if (!empty($this->loggedInUser['id'])) { ?>
  48. <li>
  49. <a href="<?php echo $this->url(null,
  50. 'members-index'); ?>"><?php echo $this->_('Members Area'); ?></a>
  51. </li>
  52. <li>
  53. <a href="<?php echo $this->url(null, 'members-logout'); ?>"
  54. title="<?php echo $this->_('Logout'); ?>"><i class="fa fa-sign-out"></i></a>
  55. </li>
  56. <?php
  57. }
  58. else {
  59. $registerModal = ($this->settings['registration_type'] == 'quick' && !\Ppb\Form\Element\ReCaptcha::$loaded) ? true : false;
  60. ?>
  61. <li>
  62. <a <?php echo ($registerModal) ? 'class="dialog-box"' : ''; ?>
  63. href="<?php echo $this->url(array('module' => 'members', 'controller' => 'user', 'action' => ($registerModal) ? 'register-modal' : 'register')); ?>"
  64. title="<?php echo $this->_('Register'); ?>"><i class="fa fa-user-plus"></i> </a>
  65. </li>
  66. <li>
  67. <a class="dialog-box"
  68. href="<?php echo $this->url(array('module' => 'members', 'controller' => 'user', 'action' => 'login-modal')); ?>"
  69. title="<?php echo $this->_('Login'); ?>"><i class="fa fa-sign-in"></i></a>
  70. </li>
  71. <?php } ?>
  72. <li>
  73. <a href="<?php echo $this->url(array('module' => 'members', 'controller' => 'tools', 'action' => 'watched-items')); ?>"
  74. title="<?php echo $this->_('Wishlist'); ?>"><i class="fa fa-heart-o"></i></a>
  75. </li>
  76. </ul>
  77. </div>
  78. <ul class="nav navbar-nav navbar-right">
  79. <?php foreach ($this->menu->pages as $page) { ?>
  80. <?php if ((!$page->settings || (intval($this->settings[(string)$page->settings['name']]) == $page->settings['value'])) &&
  81. ($this->navigation()->accept($page)) && $page->hidden != 'true'
  82. ) {
  83. ?>
  84. <li <?php echo ($page->isActive(true)) ? 'class="active"' : ''; ?>>
  85. <a href="<?php echo $this->url($page->params); ?>">
  86. <?php echo $page->label; ?>
  87. </a>
  88. </li>
  89. <?php } ?>
  90. <?php } ?>
  91. <?php if ($this->settings['enable_shopping_cart']) { ?>
  92. <li>
  93. <?php echo $this->cartDropdown(); ?>
  94. </li>
  95. <?php } ?>
  96. </ul>
  97. <!-- end horizontal menu -->
  98. </div>
  99. <!-- end header content -->
  100. </div>
  101. <!-- end branding header -->
  102. <div class="clearfix"></div>
  103. <!-- header advert -->
  104. <?php
  105. $advert = $this->advert()->findBySection('header', false, array($parentId));
  106. if ($advert !== null) {
  107. ?>
  108. <p class="text-center">
  109. <?php echo $this->advert($advert)->display(); ?>
  110. </p>
  111. <?php } ?>
  112. <!-- search bar -->
  113. <div class="search-bar">
  114. <!-- browse menu -->
  115. <div class="browse-menu col-sm-2">
  116. <a id="browse-btn" href="#"><?php echo $this->_('Browse'); ?> <i class="fa fa-angle-down"></i></a>
  117. </div>
  118. <ul id="browse-content">
  119. <?php
  120. /** @var \Ppb\Db\Table\Row\Category $category */
  121. foreach ($categories as $category) {
  122. $counter = $category->getCounter();
  123. if ($counter > 0 || !$this->settings['hide_empty_categories']) {
  124. ?>
  125. <li>
  126. <a href="<?php echo $this->url($category->link()); ?>">
  127. <?php echo $this->_($category['name']); ?>
  128. </a>
  129. <?php
  130. if ($this->settings['category_counters']) {
  131. echo '<small>(' . $counter . ')</small>';
  132. }
  133. ?>
  134. </li>
  135. <?php } ?>
  136. <?php } ?>
  137. </ul>
  138. <!-- end browse menu -->
  139. <!-- search and categories -->
  140. <div class="col-sm-8 col-xs-12">
  141. <form id="form-header-search" class="form-inline form-header"
  142. action="<?php echo $this->url(null, 'listings-search'); ?>"
  143. method="get">
  144. <div class="form-group hidden-sm">
  145. <input type="hidden" name="parent_id"
  146. value="<?php echo $request->getParam('parent_id'); ?>">
  147. <ul id="category-select-content">
  148. <li>
  149. <a href="#"
  150. data-id=""
  151. data-category-name="<?php echo $this->_('All Categories'); ?>">
  152. <?php echo $this->_('All Categories'); ?>
  153. </a>
  154. </li>
  155. <?php
  156. $selectedCategory = $this->_('Choose Category');
  157. $maxChars = 20;
  158. /** @var \Ppb\Db\Table\Row\Category $category */
  159. foreach ($categories as $category) {
  160. $shortCategoryName = $this->_($category['name']);
  161. $length = strlen($shortCategoryName);
  162. $shortCategoryName = substr($shortCategoryName, 0, $maxChars) . (($length > $maxChars) ? '...' : '');
  163. if ($category['id'] == $request->getParam('parent_id')) {
  164. $selectedCategory = $shortCategoryName;
  165. }
  166. ?>
  167. <li>
  168. <a href="<?php echo $this->url($category->link()); ?>"
  169. data-id="<?php echo $category['id']; ?>"
  170. data-category-name="<?php echo $shortCategoryName; ?>">
  171. <?php echo $this->_($category['name']); ?>
  172. </a>
  173. </li>
  174. <?php } ?>
  175. </ul>
  176. <a id="category-select-btn" class="form-control input-medium" href="#">
  177. <span><?php echo $selectedCategory; ?></span> <i class="fa fa-angle-down"></i>
  178. </a>
  179. </div>
  180. <div class="form-group">
  181. <input id="basic-search" type="text" name="keywords" class="form-control input-search"
  182. value="<?php echo $this->request()->getRequest()->getParam('keywords'); ?>"
  183. placeholder="<?php echo $this->_('Search...'); ?>">
  184. </div>
  185. <button type="submit" class="btn btn-primary"><?php echo $this->_('Search'); ?></button>
  186. </form>
  187. </div>
  188. <!-- end search and categories -->
  189. <!-- advanced search -->
  190. <div class="col-md-1 hidden-sm advanced-search-box">
  191. <a href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'search', 'action' => 'advanced')); ?>"><?php echo $this->_('Advanced'); ?></a>
  192. </div>
  193. <div class="col-md-1 col-sm-2">
  194. <?php if ($this->settings['user_languages']) { ?>
  195. <?php echo $this->language(); ?>
  196. <?php } ?>
  197. </div>
  198. <!-- end advanced search -->
  199. </div>
  200. <!-- end search bar -->
  201. </div>