Replace PWC with jQuery
This commit is contained in:
parent
263b945526
commit
a17ed39bc1
@ -1770,9 +1770,40 @@ class Form
|
||||
{
|
||||
$pageyes=$page.'&action='.$action.'&confirm=yes';
|
||||
$pageno=($useajax == 2?$page.'&confirm=no':'');
|
||||
// Note: Title is not used by dialogConfirm function
|
||||
print '<script type="text/javascript">window.onload = function(){ dialogConfirm(\''.$title.'\',\''.$pageyes.'\',\''.$pageno.'\',\''.dol_escape_js('<b>'.$title.'</b><br>'.$more.$question).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\'); }</script>';
|
||||
// print '<script id="eee" type="text/javascript">dialogConfirm(\'aaa\',\'bbb\',\'ccc\',\'eee\',\'yyy\',\'zzz\',\'validate\')</script>';
|
||||
|
||||
// Old code using PWC + Prototype
|
||||
//print '<script type="text/javascript">window.onload = function(){ dialogConfirm(\''.$title.'\',\''.$pageyes.'\',\''.$pageno.'\',\''.dol_escape_js('<b>'.$title.'</b><br>'.$more.$question).'\',\''.$langs->trans("Yes").'\',\''.$langs->trans("No").'\',\'validate\'); }</script>';
|
||||
//print '<script id="eee" type="text/javascript">dialogConfirm(\'aaa\',\'bbb\',\'ccc\',\'eee\',\'yyy\',\'zzz\',\'validate\')</script>';
|
||||
|
||||
// New code using jQuery only
|
||||
print '<div id="dialog-confirm" title="'.dol_escape_htmltag($title).'">';
|
||||
print img_help('','').' '.$more.$question;
|
||||
print '</div>'."\n";
|
||||
print '<script type="text/javascript">
|
||||
var choice=\'ko\';
|
||||
jQuery("#dialog-confirm").dialog({
|
||||
autoOpen: true,
|
||||
resizable: false,
|
||||
height:160,
|
||||
width:580,
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
close: function(event, ui) {
|
||||
if (choice == \'ok\') location.href=\''.$pageyes.'\';
|
||||
'.($pageno?'if (choice == \'ko\') location.href=\''.$pageno.'\';':'').'
|
||||
},
|
||||
buttons: {
|
||||
\''.dol_escape_js($langs->trans("Yes")).'\': function() {
|
||||
choice=\'ok\';
|
||||
jQuery(this).dialog(\'close\');
|
||||
},
|
||||
\''.dol_escape_js($langs->trans("No")).'\': function() {
|
||||
choice=\'ko\';
|
||||
jQuery(this).dialog(\'close\');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
|
||||
print "\n";
|
||||
$ret='ajax';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user