index.phtml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /**
  3. * @version 7.10 [rev.7.10.01]
  4. */
  5. ?>
  6. <div class="home-page">
  7. <?php
  8. $adverts = $this->advert()->findBySection('slider', true);
  9. $nbAdverts = count($adverts);
  10. $activeClass = 'active';
  11. if ($nbAdverts > 0) {
  12. ?>
  13. <div class="jq-slider jq-loading-slider">
  14. <?php foreach ($adverts as $advert) { ?>
  15. <div class="jq-slide hidden">
  16. <?php echo $this->advert($advert)->display(); ?>
  17. </div>
  18. <?php } ?>
  19. </div>
  20. <?php } ?>
  21. <?php echo $this->renderHtml($this->settings['home_page_html']); ?>
  22. <?php
  23. $tabs = array();
  24. if ($this->settings['hpfeat_nb']) {
  25. $tabs[] = array(
  26. 'type' => 'homepage',
  27. 'show' => 'featured',
  28. 'title' => $this->_('Featured Listings'),
  29. 'limit' => $this->settings['hpfeat_nb'],
  30. 'carousel' => (bool)$this->settings['hpfeat_carousel'],
  31. 'class' => $this->settings['hpfeat_box'],
  32. 'tabbed' => $this->settings['hpfeat_tabbed'],
  33. );
  34. }
  35. if ($this->settings['recent_nb']) {
  36. $tabs[] = array(
  37. 'type' => 'recent',
  38. 'title' => $this->_('Recently Listed'),
  39. 'limit' => $this->settings['recent_nb'],
  40. 'carousel' => (bool)$this->settings['recent_carousel'],
  41. 'class' => $this->settings['recent_box'],
  42. 'tabbed' => $this->settings['recent_tabbed'],
  43. );
  44. }
  45. if ($this->settings['ending_nb']) {
  46. $tabs[] = array(
  47. 'type' => 'ending',
  48. 'title' => $this->_('Ending Soon'),
  49. 'limit' => $this->settings['ending_nb'],
  50. 'carousel' => (bool)$this->settings['ending_carousel'],
  51. 'class' => $this->settings['ending_box'],
  52. 'tabbed' => $this->settings['ending_tabbed'],
  53. );
  54. }
  55. if ($this->settings['popular_nb']) {
  56. $tabs[] = array(
  57. 'type' => 'popular',
  58. 'title' => $this->_('Popular Listings'),
  59. 'limit' => $this->settings['popular_nb'],
  60. 'carousel' => (bool)$this->settings['popular_carousel'],
  61. 'class' => $this->settings['popular_box'],
  62. 'tabbed' => $this->settings['popular_tabbed'],
  63. );
  64. }
  65. if (count($tabs) > 0) {
  66. foreach ($tabs as $tab) {
  67. if (!$tab['tabbed']) {
  68. ?>
  69. <h2 class="headline">
  70. <span><?php echo $tab['title']; ?></span>
  71. </h2>
  72. <div class="featured listings">
  73. <?php echo $this->action('listings', 'browse', 'listings',
  74. array(
  75. 'type' => $tab['type'],
  76. 'carousel' => $tab['carousel'],
  77. 'class' => $tab['class'],
  78. 'limit' => $tab['limit'])); ?>
  79. <div class="text-right">
  80. <a class="btn btn-sm btn-default"
  81. href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'browse', 'action' => 'index', 'show' => (!empty($tab['show'])) ? $tab['show'] : $tab['type'])); ?>">
  82. <?php echo $this->_('View All'); ?>
  83. </a>
  84. </div>
  85. </div>
  86. <?php
  87. }
  88. } ?>
  89. <?php $activeTab = 'class="active"'; ?>
  90. <ul class="nav nav-tabs">
  91. <?php foreach ($tabs as $tab) {
  92. if ($tab['tabbed']) {
  93. ?>
  94. <li <?php echo $activeTab; ?>>
  95. <a href="#<?php echo $tab['type']; ?>" data-toggle="tab"><?php echo $tab['title']; ?></a>
  96. </li>
  97. <?php $activeTab = null; ?>
  98. <?php
  99. }
  100. } ?>
  101. </ul>
  102. <?php $activeTab = 'active'; ?>
  103. <div class="tab-content">
  104. <?php foreach ($tabs as $tab) {
  105. if ($tab['tabbed']) {
  106. ?>
  107. <div class="listings tab-pane <?php echo $activeTab; ?>" id="<?php echo $tab['type']; ?>">
  108. <?php echo $this->action('listings', 'browse', 'listings',
  109. array(
  110. 'type' => $tab['type'],
  111. 'carousel' => $tab['carousel'],
  112. 'class' => $tab['class'],
  113. 'limit' => $tab['limit'])); ?>
  114. <div class="text-right">
  115. <a class="btn btn-sm btn-default"
  116. href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'browse', 'action' => 'index', 'show' => (!empty($tab['show'])) ? $tab['show'] : $tab['type'])); ?>">
  117. <?php echo $this->_('View All'); ?>
  118. </a>
  119. </div>
  120. </div>
  121. <?php $activeTab = null; ?>
  122. <?php
  123. }
  124. } ?>
  125. </div>
  126. <?php } ?>
  127. </div>