<?php
/**
 * @version     1.4.6
 * @package     sellacious
 *
 * @copyright   Copyright (C) 2012-2017 Bhartiy Web Technologies. All rights reserved.
 * @license     SPL Sellacious Private License; see http://www.sellacious.com/spl.html
 * @author      Izhar Aazmi <info@bhartiy.com> - http://www.bhartiy.com
 */
// no direct access
defined('_JEXEC') or die;

$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
$ordering 	= ($listOrder == 'a.ordering');
$saveOrder 	= ($listOrder == 'a.ordering' && strtolower($listDirn) == 'asc');

foreach ($this->items as $i => $item) :
	$canEdit	= $this->helper->access->check('shortcode.edit', $item->id);
	$canChange	= $this->helper->access->check('shortcode.edit.state', $item->id);
	?>
	<tr role="row">
		<td class="nowrap center hidden-phone v-bottom">
			<label>
				<input type="checkbox" name="cid[]" id="cb<?php echo $i ?>" class="checkbox style-0" value="<?php echo $item->id ?>" onclick="Joomla.isChecked(this.checked);" <?php echo ($canEdit || $canChange) ? '' : ' disabled="disabled"' ?> />
				<span></span>
			</label>
		</td>
		<td class="nowrap center">
			<input type="hidden" name="jform[id][<?php echo $i ?>]" id="jform_id_<?php echo $i ?>" value="<?php echo $item->id ?>" />
			<div class="btn-group" data-toggle="buttons">
				<label class="hasTooltip btn btn-default <?php if ($item->state == 0) echo ' active' ?>" for="state_<?php echo $i ?>_0" title="<?php echo JText::_('JUNPUBLISHED') ?>" data-placement="left">
					<input type="radio" id="jform_state_<?php echo $i ?>_0" name="jform[state][<?php echo $i ?>]" value="0" <?php if ($item->state == 0) echo ' checked="checked"' ?> /><i class="fa fa-eye-slash text-danger"></i></label>
				<label class="hasTooltip btn btn-default <?php if ($item->state == 1) echo ' active' ?>" for="state_<?php echo $i ?>_1" title="<?php echo JText::_('JPUBLISHED') ?>" data-placement="right">
					<input type="radio" id="jform_state_<?php echo $i ?>_1" name="jform[state][<?php echo $i ?>]" value="1" <?php if ($item->state == 1) echo ' checked="checked"' ?> /><i class="fa fa-eye text-success"></i></label>
			</div>
		</td>
		<td class="nowrap">
			<input id="jform_shortcode_<?php echo $i ?>" name="jform[shortcode][<?php echo $i ?>]" value="<?php echo $this->escape($item->shortcode); ?>" class="inputbox" />
		</td>
		<td class="nowrap">
			<textarea id="jform_description_<?php echo $i ?>" name="jform[description][<?php echo $i ?>]" class="inputbox" rows="1" style="height: 32px"><?php echo $this->escape($item->description); ?></textarea>
		</td>
		<td class="nowrap">
			<textarea id="jform_query_<?php echo $i ?>" name="jform[query][<?php echo $i ?>]" class="inputbox code" rows="1" style="height: 32px" spellcheck="false"><?php echo $this->escape($item->query); ?></textarea>
		</td>
		<td class="nowrap">
			<input id="jform_overridetext_<?php echo $i ?>" name="jform[overridetext][<?php echo $i ?>]" value="<?php echo $this->escape($item->overridetext); ?>" class="inputbox" />
		</td>
		<td class="nowrap center">
			<div class="btn-group" data-toggle="buttons">
				<label class="hasTooltip btn btn-default <?php if ($item->override == 0) echo ' active' ?>" for="override_<?php echo $i ?>_0" title="<?php echo JText::_('JDISABLED') ?>" data-placement="left">
					<input type="radio" id="jform_override_<?php echo $i ?>_0" name="jform[override][<?php echo $i ?>]" value="0" <?php if ($item->override == 0) echo ' checked="checked"' ?> /><i class="fa fa-star-o text-danger"></i></label>
				<label class="hasTooltip btn btn-default <?php if ($item->override == 1) echo ' active' ?>" for="override_<?php echo $i ?>_1" title="<?php echo JText::_('JENABLED')  ?>" data-placement="right">
					<input type="radio" id="jform_override_<?php echo $i ?>_1" name="jform[override][<?php echo $i ?>]" value="1" <?php if ($item->override == 1) echo ' checked="checked"' ?> /><i class="fa fa-star   text-success"></i></label>
			</div>
		</td>
		<td class="center hidden-phone">
			<span><?php echo (int) $item->id; ?></span>
		</td>
	</tr>
	<?php
endforeach;
