Server : LiteSpeed System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : alsaif ( 1057) PHP Version : 7.4.33 Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/alsaif/domains/alsaif.group/private_html/layouts/joomla/html/ |
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* ---------------------
*
* @var string $tableId The id of the table
* @var string $formId The id of the form
* @var string $saveOrderingUrl Save the ordering URL?
* @var string $sortDir The direction of the order (asc/desc)
* @var string $nestedList Is it nested list?
* @var string $proceedSaveOrderButton Is there a button to initiate the ordering?
*/
extract($displayData);
// Depends on jQuery UI
JHtml::_('jquery.ui', array('core', 'sortable'));
JHtml::_('script', 'jui/sortablelist.js', array('version' => 'auto', 'relative' => true));
JHtml::_('stylesheet', 'jui/sortablelist.css', array('version' => 'auto', 'relative' => true));
// Attach sortable to document
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function ($){
var sortableList = new $.JSortableList('#"
. $tableId . " tbody','" . $formId . "','" . $sortDir . "' , '" . $saveOrderingUrl . "','','" . $nestedList . "');
});
"
);
if ($proceedSaveOrderButton)
{
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function ($){
var saveOrderButton = $('.saveorder');
saveOrderButton.css({'opacity':'0.2', 'cursor':'default'}).attr('onclick','return false;');
var oldOrderingValue = '';
$('.text-area-order').focus(function ()
{
oldOrderingValue = $(this).attr('value');
})
.keyup(function (){
var newOrderingValue = $(this).attr('value');
if (oldOrderingValue != newOrderingValue)
{
saveOrderButton.css({'opacity':'1', 'cursor':'pointer'}).removeAttr('onclick')
}
});
});
"
);
}