/administrator/components/com_easysocial/themes/default/events/categories.php

https://gitlab.com/vnsoftdev/swc · PHP · 155 lines · 128 code · 17 blank · 10 comment · 11 complexity · 31e09e62810ae882f04a200deef90c39 MD5 · raw file

  1. <?php
  2. /**
  3. * @package EasySocial
  4. * @copyright Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved.
  5. * @license GNU/GPL, see LICENSE.php
  6. * EasySocial is free software. This version may have been modified pursuant
  7. * to the GNU General Public License, and as distributed it includes or
  8. * is derivative of works licensed under the GNU General Public License or
  9. * other free or open source software licenses.
  10. * See COPYRIGHT.php for copyright notices and details.
  11. */
  12. defined('_JEXEC') or die('Unauthorized Access');
  13. ?>
  14. <form method="post" name="adminForm" class="esForm" id="adminForm" data-table-grid>
  15. <div class="filter-bar form-inline">
  16. <div class="form-group">
  17. <?php echo $this->html('filter.search', $search); ?>
  18. </div>
  19. <div class="form-group">
  20. <strong><?php echo JText::_('COM_EASYSOCIAL_FILTER_BY'); ?> :</strong>
  21. <div><?php echo $this->html('filter.published', 'state', $state); ?></div>
  22. </div>
  23. <div class="form-group pull-right">
  24. <div><?php echo $this->html('filter.limit', $limit); ?></div>
  25. </div>
  26. </div>
  27. <table class="table table-striped table-es table-hover">
  28. <thead>
  29. <tr>
  30. <?php if (!$simple) { ?>
  31. <th width="1%" class="center">
  32. <input type="checkbox" name="toggle" data-table-grid-checkall />
  33. </th>
  34. <?php } ?>
  35. <th>
  36. <?php echo $this->html('grid.sort', 'title', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_TITLE'), $ordering, $direction); ?>
  37. </th>
  38. <?php if (!$simple) { ?>
  39. <th class="center" width="10%">
  40. <?php echo $this->html('grid.sort', 'state', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_STATUS'), $ordering, $direction); ?>
  41. </th>
  42. <?php } ?>
  43. <?php if (!$simple) { ?>
  44. <th class="center" width="15%">
  45. <?php echo $this->html('grid.sort', 'ordering', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_ORDERING'), $ordering, $direction); ?>
  46. </th>
  47. <?php } ?>
  48. <th width="15%" class="center">
  49. <?php echo $this->html('grid.sort', 'created', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_CREATED'), $ordering, $direction); ?>
  50. </th>
  51. <th width="5%" class="center">
  52. <?php echo $this->html('grid.sort', 'id', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_ID'), $ordering, $direction); ?>
  53. </th>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. <?php if ($categories){ ?>
  58. <?php $i = 0; ?>
  59. <?php foreach ($categories as $category) { ?>
  60. <tr class="row<?php echo $i; ?>" data-grid-row data-id="<?php echo $category->id;?>">
  61. <?php if (!$simple) { ?>
  62. <td align="center">
  63. <?php echo $this->html('grid.id', $i, $category->id); ?>
  64. </td>
  65. <?php } ?>
  66. <?php if ($simple) { ?>
  67. <td>
  68. <a href="<?php echo FRoute::_('index.php?option=com_easysocial&view=events&layout=categoryForm&id=' . $category->id);?>"
  69. data-category-insert
  70. data-id="<?php echo $category->id;?>"
  71. data-avatar="<?php echo $category->getAvatar();?>"
  72. data-alias="<?php echo $category->alias;?>"
  73. data-title="<?php echo $this->html('string.escape', $category->get('title'));?>"
  74. ><?php echo $category->get('title'); ?></a>
  75. </td>
  76. <?php } else { ?>
  77. <td>
  78. <div class="row">
  79. <img src="<?php echo $category->getAvatar(); ?>" class="es-avatar pull-left mr-10" />
  80. <a href="<?php echo FRoute::_('index.php?option=com_easysocial&view=events&layout=categoryForm&id=' . $category->id);?>"
  81. data-category-insert
  82. data-id="<?php echo $category->id;?>"
  83. data-avatar="<?php echo $category->getAvatar();?>"
  84. data-alias="<?php echo $category->alias;?>"
  85. data-title="<?php echo $this->html('string.escape', $category->get('title'));?>"
  86. ><?php echo $category->get('title'); ?></a>
  87. <div class="fd-small mt-5">
  88. <?php $events = $category->getTotalNodes(); ?>
  89. <i class="ies-users"></i> <?php echo JText::sprintf('COM_EASYSOCIAL_EVENT_CATEGORIES_NUMBER_OF_EVENT' . ($events > 1 ? '_PLURAL' : '_SINGULAR'), $events);?>
  90. </div>
  91. </div>
  92. </td>
  93. <?php } ?>
  94. <?php if (!$simple) { ?>
  95. <td class="center">
  96. <?php echo $this->html('grid.published', $category, 'events', '', array('publishCategory', 'unpublishCategory')); ?>
  97. </td>
  98. <?php } ?>
  99. <?php if (!$simple) { ?>
  100. <td class="order center">
  101. <?php echo $this->html('grid.ordering', count($categories), ($i + 1), $ordering == 'ordering', $category->ordering); ?>
  102. </td>
  103. <?php } ?>
  104. <td class="center">
  105. <?php echo $category->created; ?>
  106. </td>
  107. <td class="center">
  108. <?php echo $category->id;?>
  109. </td>
  110. </tr>
  111. <?php $i++; ?>
  112. <?php } ?>
  113. <?php } else { ?>
  114. <tr class="is-empty">
  115. <td colspan="<?php echo $simple ? '3' : '6'; ?>" class="center empty">
  116. <?php echo JText::_('COM_EASYSOCIAL_EVENT_CATEGORIES_NO_CATEGORIES_FOUND');?>
  117. </td>
  118. </tr>
  119. <?php } ?>
  120. </tbody>
  121. <tfoot>
  122. <tr>
  123. <td colspan="<?php echo $simple ? '3' : '6'; ?>" class="center">
  124. <div class="footer-pagination"><?php echo $pagination->getListFooter(); ?></div>
  125. </td>
  126. </tr>
  127. </tfoot>
  128. </table>
  129. <?php echo JHTML::_('form.token'); ?>
  130. <input type="hidden" name="ordering" value="<?php echo $ordering;?>" data-table-grid-ordering />
  131. <input type="hidden" name="direction" value="<?php echo $direction;?>" data-table-grid-direction />
  132. <input type="hidden" name="boxchecked" value="0" data-table-grid-box-checked />
  133. <input type="hidden" name="task" value="" data-table-grid-task />
  134. <input type="hidden" name="option" value="com_easysocial" />
  135. <input type="hidden" name="view" value="events" />
  136. <input type="hidden" name="layout" value="categories" />
  137. <input type="hidden" name="controller" value="events" />
  138. </form>