PageRenderTime 49ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/templates/jsn_pixel_pro/html/com_contact/featured/default_items.php

https://bitbucket.org/pastor399/newcastleunifc
PHP | 259 lines | 225 code | 25 blank | 9 comment | 46 complexity | 88a7713444e0851b13ae79f2a18c4776 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: default_items.php 19737 2012-12-27 07:53:42Z tuyetvt $
  4. * @package Joomla.Site
  5. * @subpackage com_content
  6. * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. // no direct access
  10. defined('_JEXEC') or die;
  11. JHtml::core();
  12. $app = JFactory::getApplication();
  13. $template = $app->getTemplate();
  14. $jsnUtils = JSNTplUtils::getInstance();
  15. $listOrder = $this->escape($this->state->get('list.ordering'));
  16. $listDirn = $this->escape($this->state->get('list.direction'));
  17. // Create a shortcut for params.
  18. $params = &$this->item->params;
  19. ?>
  20. <?php if (empty($this->items)) : ?>
  21. <p> <?php echo JText::_('COM_CONTACT_NO_CONTACTS'); ?> </p>
  22. <?php else : ?>
  23. <?php if ($jsnUtils->isJoomla3()): ?>
  24. <?php JHtml::_('behavior.framework'); ?>
  25. <form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
  26. <fieldset class="filters">
  27. <legend class="hidelabeltxt"><?php echo JText::_('JGLOBAL_FILTER_LABEL'); ?></legend>
  28. <?php if ($this->params->get('show_pagination_limit')) : ?>
  29. <div class="display-limit">
  30. <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>&#160;
  31. <?php echo $this->pagination->getLimitBox(); ?>
  32. </div>
  33. <?php endif; ?>
  34. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  35. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  36. </fieldset>
  37. <table class="category">
  38. <?php if ($this->params->get('show_headings')) : ?>
  39. <thead><tr>
  40. <th class="item-num">
  41. <?php echo JText::_('JGLOBAL_NUM'); ?>
  42. </th>
  43. <th class="item-title">
  44. <?php echo JHtml::_('grid.sort', 'COM_CONTACT_CONTACT_EMAIL_NAME_LABEL', 'a.name', $listDirn, $listOrder); ?>
  45. </th>
  46. <?php if ($this->params->get('show_position_headings')) : ?>
  47. <th class="item-position">
  48. <?php echo JHtml::_('grid.sort', 'COM_CONTACT_POSITION', 'a.con_position', $listDirn, $listOrder); ?>
  49. </th>
  50. <?php endif; ?>
  51. <?php if ($this->params->get('show_email_headings')) : ?>
  52. <th class="item-email">
  53. <?php echo JText::_('JGLOBAL_EMAIL'); ?>
  54. </th>
  55. <?php endif; ?>
  56. <?php if ($this->params->get('show_telephone_headings')) : ?>
  57. <th class="item-phone">
  58. <?php echo JText::_('COM_CONTACT_TELEPHONE'); ?>
  59. </th>
  60. <?php endif; ?>
  61. <?php if ($this->params->get('show_mobile_headings')) : ?>
  62. <th class="item-phone">
  63. <?php echo JText::_('COM_CONTACT_MOBILE'); ?>
  64. </th>
  65. <?php endif; ?>
  66. <?php if ($this->params->get('show_fax_headings')) : ?>
  67. <th class="item-phone">
  68. <?php echo JText::_('COM_CONTACT_FAX'); ?>
  69. </th>
  70. <?php endif; ?>
  71. <?php if ($this->params->get('show_suburb_headings')) : ?>
  72. <th class="item-suburb">
  73. <?php echo JHtml::_('grid.sort', 'COM_CONTACT_SUBURB', 'a.suburb', $listDirn, $listOrder); ?>
  74. </th>
  75. <?php endif; ?>
  76. <?php if ($this->params->get('show_state_headings')) : ?>
  77. <th class="item-state">
  78. <?php echo JHtml::_('grid.sort', 'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder); ?>
  79. </th>
  80. <?php endif; ?>
  81. <?php if ($this->params->get('show_country_headings')) : ?>
  82. <th class="item-state">
  83. <?php echo JHtml::_('grid.sort', 'COM_CONTACT_COUNTRY', 'a.country', $listDirn, $listOrder); ?>
  84. </th>
  85. <?php endif; ?>
  86. </tr>
  87. </thead>
  88. <?php endif; ?>
  89. <tbody>
  90. <?php foreach($this->items as $i => $item) : ?>
  91. <tr class="<?php echo ($i % 2) ? "odd" : "even"; ?>">
  92. <td class="item-num">
  93. <?php echo $i; ?>
  94. </td>
  95. <td class="item-title">
  96. <?php if ($this->items[$i]->published == 0): ?>
  97. <span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
  98. <?php endif; ?>
  99. <a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
  100. <?php echo $item->name; ?></a>
  101. </td>
  102. <?php if ($this->params->get('show_position_headings')) : ?>
  103. <td class="item-position">
  104. <?php echo $item->con_position; ?>
  105. </td>
  106. <?php endif; ?>
  107. <?php if ($this->params->get('show_email_headings')) : ?>
  108. <td class="item-email">
  109. <?php echo $item->email_to; ?>
  110. </td>
  111. <?php endif; ?>
  112. <?php if ($this->params->get('show_telephone_headings')) : ?>
  113. <td class="item-phone">
  114. <?php echo $item->telephone; ?>
  115. </td>
  116. <?php endif; ?>
  117. <?php if ($this->params->get('show_mobile_headings')) : ?>
  118. <td class="item-phone">
  119. <?php echo $item->mobile; ?>
  120. </td>
  121. <?php endif; ?>
  122. <?php if ($this->params->get('show_fax_headings')) : ?>
  123. <td class="item-phone">
  124. <?php echo $item->fax; ?>
  125. </td>
  126. <?php endif; ?>
  127. <?php if ($this->params->get('show_suburb_headings')) : ?>
  128. <td class="item-suburb">
  129. <?php echo $item->suburb; ?>
  130. </td>
  131. <?php endif; ?>
  132. <?php if ($this->params->get('show_state_headings')) : ?>
  133. <td class="item-state">
  134. <?php echo $item->state; ?>
  135. </td>
  136. <?php endif; ?>
  137. <?php if ($this->params->get('show_country_headings')) : ?>
  138. <td class="item-state">
  139. <?php echo $item->country; ?>
  140. </td>
  141. <?php endif; ?>
  142. </tr>
  143. <?php endforeach; ?>
  144. </tbody>
  145. </table>
  146. </form>
  147. <?php else : ?>
  148. <form action="<?php echo JFilterOutput::ampReplace(JFactory::getURI()->toString()); ?>" method="post" name="adminForm" id="adminForm">
  149. <div class="jsn-infofilter">
  150. <?php if ($this->params->get('show_pagination_limit')) : ?>
  151. <?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>&#160; <?php echo $this->pagination->getLimitBox(); ?>
  152. <?php endif; ?>
  153. </div>
  154. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="jsn-infotable">
  155. <?php if ($this->params->get('show_headings')) : ?>
  156. <tr class="jsn-tableheader">
  157. <td class="sectiontableheader jsn-table-column-order" width="10" align="center"><?php echo JText::_('JGLOBAL_NUM'); ?></td>
  158. <td class="sectiontableheader jsn-table-column-name"><?php echo JHtml::_('grid.sort', 'COM_CONTACT_CONTACT_EMAIL_NAME_LABEL', 'a.name', $listDirn, $listOrder); ?></td>
  159. <?php if ($this->params->get('show_country_headings')) : ?>
  160. <td class="sectiontableheader jsn-table-column-country"><?php echo JHtml::_('grid.sort', 'COM_CONTACT_COUNTRY', 'a.country', $listDirn, $listOrder); ?></td>
  161. <?php endif; ?>
  162. <?php if ($this->params->get('show_state_headings')) : ?>
  163. <td class="sectiontableheader jsn-table-column-state"><?php echo JHtml::_('grid.sort', 'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder); ?></td>
  164. <?php endif; ?>
  165. <?php if ($this->params->get('show_suburb_headings')) : ?>
  166. <td class="sectiontableheader jsn-table-column-suburb"><?php echo JHtml::_('grid.sort', 'COM_CONTACT_SUBURB', 'a.suburb', $listDirn, $listOrder); ?></td>
  167. <?php endif; ?>
  168. <?php if ($this->params->get('show_email_headings')) : ?>
  169. <td class="sectiontableheader jsn-table-column-email"><?php echo JText::_('JGLOBAL_EMAIL'); ?></td>
  170. <?php endif; ?>
  171. <?php if ($this->params->get('show_mobile_headings')) : ?>
  172. <td class="sectiontableheader jsn-table-column-mobile"><?php echo JText::_('COM_CONTACT_MOBILE'); ?></td>
  173. <?php endif; ?>
  174. <?php if ($this->params->get('show_telephone_headings')) : ?>
  175. <td class="sectiontableheader jsn-table-column-telephone"><?php echo JText::_('COM_CONTACT_TELEPHONE'); ?></td>
  176. <?php endif; ?>
  177. <?php if ($this->params->get('show_fax_headings')) : ?>
  178. <td class="sectiontableheader jsn-table-column-fax"><?php echo JText::_('COM_CONTACT_FAX'); ?></td>
  179. <?php endif; ?>
  180. <?php if ($this->params->get('show_position_headings')) : ?>
  181. <td class="sectiontableheader jsn-table-column-position"><?php echo JHtml::_('grid.sort', 'COM_CONTACT_POSITION', 'a.con_position', $listDirn, $listOrder); ?></td>
  182. <?php endif; ?>
  183. </tr>
  184. <?php endif; ?>
  185. <?php foreach($this->items as $i => $item) : ?>
  186. <?php if ($this->items[$i]->published == 0) : ?>
  187. <tr class="system-unpublished sectiontableentry<?php echo $i % 2 +1; ?>">
  188. <?php else: ?>
  189. <tr class="sectiontableentry<?php echo $i % 2 +1; ?>">
  190. <?php endif; ?>
  191. <td class="jsn-table-column-order" width="10" align="center"><?php echo $i+1; ?></td>
  192. <td class="jsn-table-column-name"><a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>"> <?php echo $item->name; ?></a></td>
  193. <?php if ($this->params->get('show_country_headings')) : ?>
  194. <td class="jsn-table-column-country"><?php echo $item->country; ?></td>
  195. <?php endif; ?>
  196. <?php if ($this->params->get('show_state_headings')) : ?>
  197. <td class="jsn-table-column-state"><?php echo $item->state; ?></td>
  198. <?php endif; ?>
  199. <?php if ($this->params->get('show_suburb_headings')) : ?>
  200. <td class="jsn-table-column-suburb"><?php echo $item->suburb; ?></td>
  201. <?php endif; ?>
  202. <?php if ($this->params->get('show_email_headings')) : ?>
  203. <td class="jsn-table-column-email"><?php echo $item->email_to; ?></td>
  204. <?php endif; ?>
  205. <?php if ($this->params->get('show_telephone_headings')) : ?>
  206. <td class="jsn-table-column-telephone"><?php echo $item->telephone; ?></td>
  207. <?php endif; ?>
  208. <?php if ($this->params->get('show_mobile_headings')) : ?>
  209. <td class="jsn-table-column-mobile"><?php echo $item->mobile; ?></td>
  210. <?php endif; ?>
  211. <?php if ($this->params->get('show_fax_headings')) : ?>
  212. <td class="jsn-table-column-fax"><?php echo $item->fax; ?></td>
  213. <?php endif; ?>
  214. <?php if ($this->params->get('show_position_headings')) : ?>
  215. <td class="jsn-table-column-position"><?php echo $item->con_position; ?></td>
  216. <?php endif; ?>
  217. </tr>
  218. <?php endforeach; ?>
  219. </table>
  220. <?php if ($this->params->get('show_pagination')) : ?>
  221. <div class="jsn-pagination-container"> <?php echo $this->pagination->getPagesLinks(); ?>
  222. <?php if ($this->params->def('show_pagination_results', 1)) : ?>
  223. <p class="jsn-pageinfo"> <?php echo $this->pagination->getPagesCounter(); ?> </p>
  224. <?php endif; ?>
  225. </div>
  226. <?php endif; ?>
  227. <div>
  228. <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
  229. <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
  230. </div>
  231. </form>
  232. <?php endif; ?>
  233. <?php endif; ?>
  234. <div class="item-separator"></div>