Added the trash helper option to JCB as a pro feature.
This commit is contained in:
65
admin/layouts/trashhelper.php
Normal file
65
admin/layouts/trashhelper.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2021 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_BASE') or die('Restricted access');
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<?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
|
||||
if(confirm('<?= JText::_("COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
|
||||
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
|
||||
if (confirm('<?= JText::_("COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
|
||||
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">
|
||||
<h4 class="alert-heading">
|
||||
<span class="icon-trash"></span>
|
||||
<?= JText::_("COM_COMPONENTBUILDER_TRASHED_ITEMS") ?>
|
||||
</h4>
|
||||
<p><?= JText::_("COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS") ?></p>
|
||||
<button onclick="emptyTrash();" class="btn btn-small btn-danger">
|
||||
<span class="icon-delete" aria-hidden="true"></span>
|
||||
<?= JText::_("COM_COMPONENTBUILDER_EMPTY_TRASH") ?>
|
||||
</button>
|
||||
<button onclick="exitTrash();" class="btn btn-small">
|
||||
<span class="icon-back" aria-hidden="true"></span>
|
||||
<?= JText::_("COM_COMPONENTBUILDER_EXIT_TRASH") ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
Reference in New Issue
Block a user