mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2025-01-28 23:08:27 +00:00
Merge pull request #18 from dgt41/jquery_1
Introduce jquery formvalidator for com_weblinks
This commit is contained in:
commit
67d0850975
@ -11,19 +11,19 @@ defined('_JEXEC') or die;
|
|||||||
|
|
||||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
|
|
||||||
JHtml::_('behavior.formvalidation');
|
JHtml::_('behavior.formvalidator');
|
||||||
JHtml::_('formbehavior.chosen', 'select');
|
JHtml::_('formbehavior.chosen', 'select');
|
||||||
|
|
||||||
?>
|
JFactory::getDocument()->addScriptDeclaration("
|
||||||
<script type="text/javascript">
|
|
||||||
Joomla.submitbutton = function(task)
|
Joomla.submitbutton = function(task)
|
||||||
{
|
{
|
||||||
if (task == 'weblink.cancel' || document.formvalidator.isValid(document.id('weblink-form'))) {
|
if (task == 'weblink.cancel' || document.formvalidator.isValid(document.getElementById('weblink-form'))) {
|
||||||
<?php echo $this->form->getField('description')->save(); ?>
|
" . $this->form->getField('description')->save() . "
|
||||||
Joomla.submitform(task, document.getElementById('weblink-form'));
|
Joomla.submitform(task, document.getElementById('weblink-form'));
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
");
|
||||||
|
?>
|
||||||
|
|
||||||
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="weblink-form" class="form-validate">
|
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="weblink-form" class="form-validate">
|
||||||
|
|
||||||
|
@ -27,24 +27,25 @@ if ($saveOrder)
|
|||||||
JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
|
JHtml::_('sortablelist.sortable', 'weblinkList', 'adminForm', strtolower($listDirn), $saveOrderingUrl);
|
||||||
}
|
}
|
||||||
$sortFields = $this->getSortFields();
|
$sortFields = $this->getSortFields();
|
||||||
?>
|
|
||||||
<script type="text/javascript">
|
JFactory::getDocument()->addScriptDeclaration('
|
||||||
Joomla.orderTable = function()
|
Joomla.orderTable = function()
|
||||||
{
|
{
|
||||||
table = document.getElementById("sortTable");
|
table = document.getElementById("sortTable");
|
||||||
direction = document.getElementById("directionTable");
|
direction = document.getElementById("directionTable");
|
||||||
order = table.options[table.selectedIndex].value;
|
order = table.options[table.selectedIndex].value;
|
||||||
if (order != '<?php echo $listOrder; ?>')
|
if (order != "' . $listOrder . '")
|
||||||
{
|
{
|
||||||
dirn = 'asc';
|
dirn = "asc";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dirn = direction.options[direction.selectedIndex].value;
|
dirn = direction.options[direction.selectedIndex].value;
|
||||||
}
|
}
|
||||||
Joomla.tableOrdering(order, dirn, '');
|
Joomla.tableOrdering(order, dirn, "");
|
||||||
}
|
};
|
||||||
</script>
|
');
|
||||||
|
?>
|
||||||
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks'); ?>" method="post" name="adminForm" id="adminForm">
|
<form action="<?php echo JRoute::_('index.php?option=com_weblinks&view=weblinks'); ?>" method="post" name="adminForm" id="adminForm">
|
||||||
<?php if (!empty( $this->sidebar)) : ?>
|
<?php if (!empty( $this->sidebar)) : ?>
|
||||||
<div id="j-sidebar-container" class="span2">
|
<div id="j-sidebar-container" class="span2">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user