2020-12-27 11:54:51 +00:00
|
|
|
<?php
|
2021-03-05 03:08:47 +00:00
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
2022-07-09 15:45:08 +00:00
|
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
|
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
2021-03-05 03:08:47 +00:00
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
2024-03-09 19:47:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
use Joomla\CMS\Factory;
|
|
|
|
use Joomla\CMS\Language\Text;
|
|
|
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
|
|
|
use Joomla\CMS\Layout\LayoutHelper;
|
|
|
|
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
|
|
|
|
|
2021-03-05 03:08:47 +00:00
|
|
|
// No direct access to this file
|
2024-03-09 19:47:28 +00:00
|
|
|
defined('JPATH_BASE') or die;
|
2020-12-27 11:54:51 +00:00
|
|
|
|
2021-03-05 03:08:47 +00:00
|
|
|
|
|
|
|
|
2020-12-27 11:54:51 +00:00
|
|
|
?>
|
|
|
|
<?php if ($displayData->state->get('filter.published') == -2 && ($displayData->canState && $displayData->canDelete)) : ?>
|
|
|
|
<script>
|
|
|
|
// change the class of the delete button
|
|
|
|
jQuery("#toolbar-delete button").toggleClass("btn-danger");
|
|
|
|
// function to empty the trash
|
|
|
|
function emptyTrash() {
|
|
|
|
if (document.adminForm.boxchecked.value == 0) {
|
|
|
|
// select all the items visable
|
|
|
|
document.adminForm.elements['checkall-toggle'].checked=1;
|
|
|
|
Joomla.checkAll(document.adminForm.elements['checkall-toggle']);
|
|
|
|
// check to confirm the deletion
|
2024-03-09 19:47:28 +00:00
|
|
|
if(confirm('<?= Text::_("COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
|
2020-12-27 11:54:51 +00:00
|
|
|
Joomla.submitbutton('<?= $displayData->get("name") ?>.delete');
|
|
|
|
} else {
|
|
|
|
document.adminForm.elements['checkall-toggle'].checked=0;
|
|
|
|
Joomla.checkAll(document.adminForm.elements['checkall-toggle']);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// confirm deletion of those selected
|
2024-03-09 19:47:28 +00:00
|
|
|
if (confirm('<?= Text::_("COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
|
2020-12-27 11:54:51 +00:00
|
|
|
Joomla.submitbutton('<?= $displayData->get("name") ?>.delete');
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// function to exit the tash state
|
|
|
|
function exitTrash() {
|
|
|
|
document.adminForm.filter_published.selectedIndex = 0;
|
|
|
|
document.adminForm.submit();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<div class="alert alert-error">
|
2021-01-03 16:49:35 +00:00
|
|
|
<?php if (empty($displayData->items)): ?>
|
|
|
|
<h4 class="alert-heading">
|
|
|
|
<span class="icon-trash"></span>
|
2024-03-09 19:47:28 +00:00
|
|
|
<?= Text::_("COM_COMPONENTBUILDER_TRASH_AREA") ?>
|
2021-01-03 16:49:35 +00:00
|
|
|
</h4>
|
2024-03-09 19:47:28 +00:00
|
|
|
<p><?= Text::_("COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ANY_ITEMS_IN_TRASH_AT_THE_MOMENT") ?></p>
|
2021-01-03 16:49:35 +00:00
|
|
|
<?php else: ?>
|
|
|
|
<h4 class="alert-heading">
|
|
|
|
<span class="icon-trash"></span>
|
2024-03-09 19:47:28 +00:00
|
|
|
<?= Text::_("COM_COMPONENTBUILDER_TRASHED_ITEMS") ?>
|
2021-01-03 16:49:35 +00:00
|
|
|
</h4>
|
2024-03-09 19:47:28 +00:00
|
|
|
<p><?= Text::_("COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS") ?></p>
|
2021-01-03 16:49:35 +00:00
|
|
|
<button onclick="emptyTrash();" class="btn btn-small btn-danger">
|
|
|
|
<span class="icon-delete" aria-hidden="true"></span>
|
2024-03-09 19:47:28 +00:00
|
|
|
<?= Text::_("COM_COMPONENTBUILDER_EMPTY_TRASH") ?>
|
2021-01-03 16:49:35 +00:00
|
|
|
</button>
|
|
|
|
<?php endif; ?>
|
2020-12-27 11:54:51 +00:00
|
|
|
<button onclick="exitTrash();" class="btn btn-small">
|
|
|
|
<span class="icon-back" aria-hidden="true"></span>
|
2024-03-09 19:47:28 +00:00
|
|
|
<?= Text::_("COM_COMPONENTBUILDER_EXIT_TRASH") ?>
|
2020-12-27 11:54:51 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
2021-03-05 03:08:47 +00:00
|
|
|
<?php endif; ?>
|