| Current Path : /home/megadansyp/www/plugins/fwgallerytype/video/layouts/frontend/video/ |
| Current File : /home/megadansyp/www/plugins/fwgallerytype/video/layouts/frontend/video/list.php |
<?php
/**
* FW Super Gallery 2.4.0
* @copyright (C) 2020 Fastw3b
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.fastw3b.net/ Official website
**/
defined( '_JEXEC' ) or die( 'Restricted access' );
fwgButtonsHelper::addNew();
fwgButtonsHelper::editList();
fwgButtonsHelper::deleteList(JText::_('FWMG_ARE_YOU_SURE'));
fwgButtonsHelper::publish();
fwgButtonsHelper::unpublish();
JHTML::_('formbehavior.chosen', 'select.select-choices');
$view = $displayData['view'];
?>
<div class="fwmg-management-header">
<div class="fwmg-management-header-text">
<?php echo JText::_('FWMG_HEADER_VIDEOS'); ?>
</div>
</div>
<div class="mb-4">
<a class="btn btn-success mr-2" href="javascript:Joomla.submitbutton('add');">
<i title="<?php echo JText::_('FWMG_New'); ?>" class="fal fa-plus mr-1"></i>
<?php echo JText::_('FWMG_New'); ?>
</a>
<a class="btn mr-2" href="javascript:if(document.adminForm.boxchecked.value==0){alert('<?php echo JText::_('FWMG_make_selection_edit', true); ?>');}else{Joomla.submitbutton('edit')}">
<i title="<?php echo JText::_('FWMG_Edit'); ?>" class="fal fa-edit"></i>
<?php echo JText::_('FWMG_Edit'); ?>
</a>
<a class="btn mr-2" href="javascript:if(document.adminForm.boxchecked.value==0){alert('<?php echo JText::_('FWMG_MAKE_SELECTION_PUBLISH', true); ?>');}else{Joomla.submitbutton('publish'); }">
<i title="<?php echo JText::_('FWMG_Publish'); ?>" class="fal fa-eye"></i>
<?php echo JText::_('FWMG_Publish'); ?>
</a>
<a class="btn mr-2" href="javascript:if(document.adminForm.boxchecked.value==0){alert('<?php echo JText::_('FWMG_MAKE_SELECTION_UNPUBLISH', true); ?>');}else{Joomla.submitbutton('unpublish'); }">
<i title="<?php echo JText::_('FWMG_Unpublish'); ?>" class="fal fa-eye-slash"></i>
<?php echo JText::_('FWMG_Unpublish'); ?>
</a>
<a class="btn btn-danger" href="javascript:if(document.adminForm.boxchecked.value==0){alert('<?php echo JText::_('FWMG_make_selection_delete', true); ?>');}else if (confirm('<?php echo JText::_('FWMG_ARE_YOU_SURE', true); ?>')) {Joomla.submitbutton('remove')}">
<i title="<?php echo JText::_('FWMG_Delete'); ?>" class="fal fa-times"></i>
<?php echo JText::_('FWMG_Delete'); ?>
</a>
</div>
<form action="<?php echo fwgHelper::checkLink(fwgHelper::route('index.php?option=com_fwgallery&view=usersection&layout=video')); ?>" id="adminForm" name="adminForm" method="post">
<div class="row mb-4 fwa-filter-bar">
<div class="col-md-6">
<div class="input-group">
<input class="form-control" name="search" placeholder="<?php echo JText::_('FWMG_SEARCH_NAME_OR_ID'); ?>" type="text" value="<?php echo $view->escape($view->search); ?>" />
<span class="input-group-btn">
<button class="btn" type="button" onclick="with(this.form){search.value='';submit();}"><i class="fa fa-times"></i></button>
</span>
<span class="input-group-btn">
<button class="btn btn-primary" type="submit" onclick="this.form.limitstart.value=0;"><i class="fa fa-search"></i></button>
</span>
</div>
</div>
<div class="col-md-6">
<div class="input-group">
<?php echo JHTML::_('select.genericlist', array_merge(array(
JHTML::_('select.option', '', JText::_('FWMG_Select_gallery'), 'id', 'treename')
), $view->categories), 'category', 'onchange="this.form.limitstart.value=0;this.form.submit();" class="form-control select-choices"', 'id', 'treename', $view->category); ?>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-striped fwmg-admin-images">
<thead>
<tr>
<th><input name="toggle" value="" onclick="Joomla.checkAll(this);" type="checkbox"></th>
<th style="width:120px;"><?php echo JText::_('FWMG_PREVIEW'); ?></th>
<th><?php echo JText::_('FWMG_ID'); ?> - <?php echo JText::_('FWMG_NAME'); ?></th>
<th><?php echo JText::_('FWMG_DESCRIPTION'); ?></th>
<th><?php echo JText::_('FWMG_ORDER'); ?> <a href="javascript:" class="btn btn-sm" onclick="javascript:saveorder(<?php echo (int)count($view->list)-1; ?>, 'saveorder')"><i class="fa fa-save"></i></a></th>
<th class="text-center"><?php echo JText::_('FWMG_HITS'); ?></th>
<th class="text-center"><?php echo JText::_('FWMG_PUBLISHED'); ?></th>
</tr>
</thead>
<tbody>
<?php
if ($view->list) {
$num = 0;
$app = JFactory::getApplication();
foreach ($view->list as $row) {
?>
<tr>
<td><div class="form-check"><?php echo preg_replace('#<label.*</label>#msi', '', JHTML::_('grid.id', $num, $row->id )); ?></div></td>
<td>
<img class="img-thumbnail" src="<?php echo fwgHelper::checkLink(fwgHelper::route('index.php?option=com_fwgallery&view=item&layout=img&format=raw&id='.$row->id.'&w=80&h=60')); ?>">
</td>
<td>
<a href="<?php echo fwgHelper::checkLink(fwgHelper::route('index.php?option=com_fwgallery&view=usersection&layout=video_edit&cid[]='.$row->id.$view->extra_link)); ?>">
<?php echo $row->id; ?> - <?php echo $row->name; ?>
</a>
<div class="small"><?php if ($row->_video_media) { echo $row->_video_media; ?>: <?php } echo ($row->_video_media == 'mp4')?$row->_video_filename:$row->_video_code; ?></div>
<div class="small"><?php echo JText::_('FWMG_OWNER'); ?>: <?php echo $row->_user_name ?></div>
<div class="small"><?php echo JText::_('FWMG_UPLOADED'); ?>: <?php echo JHTML::date($row->created, 'd M Y H:i'); ?></div>
<div class="small"><?php echo JText::_('FWMG_ACCESS'); ?>: <?php echo $row->access?$row->_group_name:JText::_('FWMG_PUBLIC'); ?></div>
<div class="small"><?php echo JText::_('FWMG_GALLERY'); ?>: <?php echo $row->_category_name ?></div>
<?php
$app->triggerEvent('onshowFileListExtraFields', array('com_fwgallery', $row));
?>
</td>
<td class="small"><?php echo fwgHelper::stripTags($row->descr, 100, true); ?></td>
<td class="order">
<?php echo JHTML::_('fwView.orderingListLinks', array(
'num' => $num,
'value' => $row->ordering,
'display_up' => ($num > 0),
'display_down' => (($num + 1) < count($view->list))
)); ?>
</td>
<td class="text-center"><?php echo $row->hits; ?></td>
<td class="text-center">
<a title="<?php echo $view->escape(JText::_($row->published?'FWMG_PUBLISHED':'FWMG_UNPUBLISHED')); ?>"
href="<?php echo fwgHelper::checkLink(fwgHelper::route('&task='.($row->published?'un':'').'publish&cid[]='.$row->id.$view->extra_link)); ?>"
class="btn btn-sm text-<?php if ($row->published) { ?>success<?php } else { ?>danger<?php } ?>"><i class="fal fa-<?php if ($row->published) { ?>check<?php } else { ?>times<?php } ?>"></i></a>
</td>
</tr>
<?php
$num++;
}
} else {
?>
<tr>
<td colspan="8">
<?php
echo JText::_($view->search?'FWMG_NO_VIDEOS_FOUND':'FWMG_NO_VIDEOS');
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="pagination fwmg-pagination">
<?php echo $view->pagination->getListFooter(); ?>
</div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="" />
</form>
<script>
document.addEventListener('DOMContentLoaded', function() {
(function($) {
Joomla.submitbutton = function(task) {
console.log(task);
var form = document.adminForm;
if (task == 'add') {
location = '<?php echo fwgHelper::route('&layout=video_edit&cid[]=0'.$view->extra_link, false); ?>';
} else if (task == 'edit') {
var cid = 0;
if (task == 'edit') {
$('input[name="cid[]"]').each(function() {
if (this.checked) {
cid = this.value;
return;
}
});
}
location = '<?php echo fwgHelper::route($view->extra_link.'&layout=video_edit&cid[]=', false); ?>'+cid;
} else {
form.task.value = task;
form.submit();
}
}
})(jQuery);
});
</script>