Robot
4ccc3523d7
Remove all backward compatibility issues, so JCB will not need the [Backward Compatibility] plugin to run. Added new import powers for custom import of spreadsheets. Move the setDocument and _prepareDocument above the display in the site view and custom admin view. Update the trashhelper layout to work in Joomla 5. Add AllowDynamicProperties (Joomla 4+5) to view class to allow Custom Dynamic Get methods to work without issues.
77 lines
2.6 KiB
PHP
77 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* @package Joomla.Component.Builder
|
|
*
|
|
* @created 30th April, 2015
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
*/
|
|
|
|
use Joomla\CMS\Factory;
|
|
use Joomla\CMS\Language\Text;
|
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
|
use Joomla\CMS\Layout\LayoutHelper;
|
|
use Joomla\CMS\Router\Route;
|
|
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
|
|
|
|
// No direct access to this file
|
|
defined('_JEXEC') or die;
|
|
|
|
if ($this->saveOrder)
|
|
{
|
|
$saveOrderingUrl = 'index.php?option=com_componentbuilder&task=layouts.saveOrderAjax&tmpl=component';
|
|
Html::_('sortablelist.sortable', 'layoutList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
|
}
|
|
?>
|
|
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=layouts'); ?>" method="post" name="adminForm" id="adminForm">
|
|
<div id="j-main-container">
|
|
<?php
|
|
// Add the trash helper layout
|
|
echo LayoutHelper::render('trashhelper', $this);
|
|
// Add the searchtools
|
|
echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this));
|
|
?>
|
|
<?php if (empty($this->items)): ?>
|
|
<div class="alert alert-no-items">
|
|
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
|
|
</div>
|
|
<?php else : ?>
|
|
<table class="table table-striped" id="layoutList">
|
|
<thead><?php echo $this->loadTemplate('head');?></thead>
|
|
<tfoot><?php echo $this->loadTemplate('foot');?></tfoot>
|
|
<tbody><?php echo $this->loadTemplate('body');?></tbody>
|
|
</table>
|
|
<input type="hidden" name="boxchecked" value="0" />
|
|
</div>
|
|
<?php endif; ?>
|
|
<input type="hidden" name="task" value="" />
|
|
<?php echo Html::_('form.token'); ?>
|
|
</form>
|
|
<script type="text/javascript">
|
|
// layouts footer script
|
|
|
|
HTMLElement.prototype.selText = function() {
|
|
var obj = this;
|
|
|
|
// For modern browsers, handle the selection
|
|
var selection = window.getSelection();
|
|
var range = document.createRange();
|
|
|
|
// Select the content of the element
|
|
range.selectNodeContents(obj);
|
|
selection.removeAllRanges(); // Clear any previous selections
|
|
selection.addRange(range); // Add the new selection range
|
|
|
|
return this;
|
|
};
|
|
// make sure the code bocks are active
|
|
document.querySelectorAll("code").forEach(function(codeBlock) {
|
|
codeBlock.addEventListener("click", function() {
|
|
codeBlock.selText(); // Call the custom selText function
|
|
codeBlock.classList.add("selected"); // Add the "selected" class
|
|
});
|
|
});
|
|
</script>
|