item->module) || isset($this->item->xml->customContent); $hasContentFieldName = "content"; // For a later improvement if ($hasContent) { $hasContentFieldName = "content"; } // Get Params Fieldsets $this->fieldsets = $this->form->getFieldsets('params'); $script = " Joomla.submitbutton = function(task) { if (task == 'module.cancel' || document.formvalidator.isValid(document.getElementById('module-form'))) { "; if ($hasContent) { $script .= $this->form->getField($hasContentFieldName)->save(); } $script .= " Joomla.submitform(task, document.getElementById('module-form')); if (self != top) { if (parent.viewLevels) { var updPosition = jQuery('#jform_position').chosen().val(), updTitle = jQuery('#jform_title').val(), updMenus = jQuery('#jform_assignment').chosen().val(), updAccess = jQuery('#jform_access').chosen().val(), tmpMenu = jQuery('#menus-" . $this->item->id . "', parent.document), tmpRow = jQuery('#tr-" . $this->item->id . "', parent.document); window.parent.inMenus = new Array(); window.parent.numMenus = jQuery(':input[name=\"jform[assigned][]\"]').length; jQuery('input[name=\"jform[assigned][]\"]').each(function(){ if (updMenus > 0 ) { if (jQuery(this).is(':checked')) { window.parent.inMenus.push(parseInt(jQuery(this).val())); } } if (updMenus < 0 ) { if (!jQuery(this).is(':checked')) { window.parent.inMenus.push(parseInt(jQuery(this).val())); } } }); if (updMenus == 0) { tmpMenu.html('" . JText::_("JALL") . "'); if (tmpRow.hasClass('no')) { tmpRow.removeClass('no '); } } if (updMenus == '-') { tmpMenu.html('" . JText::_("JNO") . "'); if (!tmpRow.hasClass('no')) { tmpRow.addClass('no '); } } if (updMenus > 0) { if (window.parent.inMenus.indexOf(parent.menuId) >= 0) { if (window.parent.numMenus == window.parent.inMenus.length) { tmpMenu.html('" . JText::_("JALL") . "'); if (tmpRow.hasClass('no')) { tmpRow.removeClass('no '); } } else { tmpMenu.html('" . JText::_("JYES") . "'); if (tmpRow.hasClass('no')) { tmpRow.removeClass('no '); } } } if (window.parent.inMenus.indexOf(parent.menuId) < 0) { tmpMenu.html('" . JText::_("JNO") . "'); if (!tmpRow.hasClass('no')) { tmpRow.addClass('no '); } } } if (updMenus < 0) { if (window.parent.inMenus.indexOf(parent.menuId) >= 0) { if (window.parent.numMenus == window.parent.inMenus.length) { tmpMenu.html('" . JText::_("JALL") . "'); if (tmpRow.hasClass('no')) { tmpRow.removeClass('no '); } } else { tmpMenu.html('" . JText::_("JYES") . "'); if (tmpRow.hasClass('no')) { tmpRow.removeClass('no '); } } } if (window.parent.inMenus.indexOf(parent.menuId) < 0) { tmpMenu.html('" . JText::_("JNO") . "'); if (!tmpRow.hasClass('no')) { tmpRow.addClass('no '); } } } jQuery('#title-" . $this->item->id . "', parent.document).text(updTitle); jQuery('#position-" . $this->item->id . "', parent.document).text(updPosition); jQuery('#access-" . $this->item->id . "', parent.document).html(parent.viewLevels[updAccess]); } window.top.setTimeout('window.parent.jModalClose()', 1000); } } };"; JFactory::getDocument()->addScriptDeclaration($script); ?>