PageRenderTime 17ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/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*/
 12defined('_JEXEC') or die('Unauthorized Access');
 13?>
 14<form method="post" name="adminForm" class="esForm" id="adminForm" data-table-grid>
 15
 16    <div class="filter-bar form-inline">
 17        <div class="form-group">
 18            <?php echo $this->html('filter.search', $search); ?>
 19        </div>
 20        <div class="form-group">
 21            <strong><?php echo JText::_('COM_EASYSOCIAL_FILTER_BY'); ?> :</strong>
 22            <div><?php echo $this->html('filter.published', 'state', $state); ?></div>
 23        </div>
 24
 25        <div class="form-group pull-right">
 26            <div><?php echo $this->html('filter.limit', $limit); ?></div>
 27        </div>
 28    </div>
 29
 30    <table class="table table-striped table-es table-hover">
 31        <thead>
 32            <tr>
 33                <?php if (!$simple) { ?>
 34                <th width="1%" class="center">
 35                    <input type="checkbox" name="toggle" data-table-grid-checkall />
 36                </th>
 37                <?php } ?>
 38
 39                <th>
 40                    <?php echo $this->html('grid.sort', 'title', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_TITLE'), $ordering, $direction); ?>
 41                </th>
 42
 43                <?php if (!$simple) { ?>
 44                <th class="center" width="10%">
 45                    <?php echo $this->html('grid.sort', 'state', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_STATUS'), $ordering, $direction); ?>
 46                </th>
 47                <?php } ?>
 48
 49                <?php if (!$simple) { ?>
 50                <th class="center" width="15%">
 51                    <?php echo $this->html('grid.sort', 'ordering', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_ORDERING'), $ordering, $direction); ?>
 52                </th>
 53                <?php } ?>
 54
 55                <th width="15%" class="center">
 56                    <?php echo $this->html('grid.sort', 'created', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_CREATED'), $ordering, $direction); ?>
 57                </th>
 58
 59                <th width="5%" class="center">
 60                    <?php echo $this->html('grid.sort', 'id', JText::_('COM_EASYSOCIAL_TABLE_COLUMN_ID'), $ordering, $direction); ?>
 61                </th>
 62            </tr>
 63        </thead>
 64        <tbody>
 65
 66            <?php if ($categories){ ?>
 67                <?php $i = 0; ?>
 68                <?php foreach ($categories as $category) { ?>
 69                <tr class="row<?php echo $i; ?>" data-grid-row data-id="<?php echo $category->id;?>">
 70                    <?php if (!$simple) { ?>
 71                    <td align="center">
 72                        <?php echo $this->html('grid.id', $i, $category->id); ?>
 73                    </td>
 74                    <?php } ?>
 75
 76                    <?php if ($simple) { ?>
 77                    <td>
 78                        <a href="<?php echo FRoute::_('index.php?option=com_easysocial&view=events&layout=categoryForm&id=' . $category->id);?>"
 79                                data-category-insert
 80                                data-id="<?php echo $category->id;?>"
 81                                data-avatar="<?php echo $category->getAvatar();?>"
 82                                data-alias="<?php echo $category->alias;?>"
 83                                data-title="<?php echo $this->html('string.escape', $category->get('title'));?>"
 84                            ><?php echo $category->get('title'); ?></a>
 85                    </td>
 86                    <?php } else { ?>
 87                    <td>
 88                        <div class="row">
 89                            <img src="<?php echo $category->getAvatar(); ?>" class="es-avatar pull-left mr-10" />
 90                            <a href="<?php echo FRoute::_('index.php?option=com_easysocial&view=events&layout=categoryForm&id=' . $category->id);?>"
 91                                data-category-insert
 92                                data-id="<?php echo $category->id;?>"
 93                                data-avatar="<?php echo $category->getAvatar();?>"
 94                                data-alias="<?php echo $category->alias;?>"
 95                                data-title="<?php echo $this->html('string.escape', $category->get('title'));?>"
 96                            ><?php echo $category->get('title'); ?></a>
 97
 98                            <div class="fd-small mt-5">
 99                                <?php $events = $category->getTotalNodes(); ?>
100                                <i class="ies-users"></i> <?php echo JText::sprintf('COM_EASYSOCIAL_EVENT_CATEGORIES_NUMBER_OF_EVENT' . ($events > 1 ? '_PLURAL' : '_SINGULAR'), $events);?>
101                            </div>
102                        </div>
103                    </td>
104                    <?php } ?>
105
106                    <?php if (!$simple) { ?>
107                    <td class="center">
108                        <?php echo $this->html('grid.published', $category, 'events', '', array('publishCategory', 'unpublishCategory')); ?>
109                    </td>
110                    <?php } ?>
111
112                    <?php if (!$simple) { ?>
113                    <td class="order center">
114                        <?php echo $this->html('grid.ordering', count($categories), ($i + 1), $ordering == 'ordering',  $category->ordering); ?>
115                    </td>
116                    <?php } ?>
117
118                    <td class="center">
119                        <?php echo $category->created; ?>
120                    </td>
121
122                    <td class="center">
123                        <?php echo $category->id;?>
124                    </td>
125                </tr>
126                    <?php $i++; ?>
127                <?php } ?>
128            <?php } else { ?>
129                <tr class="is-empty">
130                    <td colspan="<?php echo $simple ? '3' : '6'; ?>" class="center empty">
131                        <?php echo JText::_('COM_EASYSOCIAL_EVENT_CATEGORIES_NO_CATEGORIES_FOUND');?>
132                    </td>
133                </tr>
134            <?php } ?>
135        </tbody>
136
137        <tfoot>
138            <tr>
139                <td colspan="<?php echo $simple ? '3' : '6'; ?>" class="center">
140                    <div class="footer-pagination"><?php echo $pagination->getListFooter(); ?></div>
141                </td>
142            </tr>
143        </tfoot>
144    </table>
145
146    <?php echo JHTML::_('form.token'); ?>
147    <input type="hidden" name="ordering" value="<?php echo $ordering;?>" data-table-grid-ordering />
148    <input type="hidden" name="direction" value="<?php echo $direction;?>" data-table-grid-direction />
149    <input type="hidden" name="boxchecked" value="0" data-table-grid-box-checked />
150    <input type="hidden" name="task" value="" data-table-grid-task />
151    <input type="hidden" name="option" value="com_easysocial" />
152    <input type="hidden" name="view" value="events" />
153    <input type="hidden" name="layout" value="categories" />
154    <input type="hidden" name="controller" value="events" />
155</form>