mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-15 22:11:36 +01:00
Clean code
This commit is contained in:
@@ -1473,21 +1473,23 @@ function dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $di
|
||||
|
||||
//print '<input type="submit" class="button bordertransp"'.$disabled.' value="'.dol_escape_htmltag($langs->trans("MediaFiles")).'" name="file_manager">';
|
||||
$out = '<a class="button bordertransp button_'.$name.'"'.$disabled.' title="'.dol_escape_htmltag($label).'">'.$buttonstring.'</a>';
|
||||
$out .= '<!-- Add js code to open dialog popup on dialog -->';
|
||||
$out .= '<script language="javascript">
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".button_'.$name.'").click(function () {
|
||||
var $dialog = $(\'<div></div>\').html(\'<iframe class="iframedialog" style="border: 0px;" src="'.DOL_URL_ROOT.$url.'" width="100%" height="98%"></iframe>\')
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
height: (window.innerHeight - 150),
|
||||
width: \'80%\',
|
||||
title: "'.dol_escape_js($label).'"
|
||||
});
|
||||
$dialog.dialog(\'open\');
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
jQuery(document).ready(function () {
|
||||
jQuery(".button_'.$name.'").click(function () {
|
||||
console.log("Open popup with jQuery(...).dialog() on URL '.dol_escape_js(DOL_URL_ROOT.$url).'")
|
||||
var $dialog = $(\'<div></div>\').html(\'<iframe class="iframedialog" style="border: 0px;" src="'.DOL_URL_ROOT.$url.'" width="100%" height="98%"></iframe>\')
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
height: (window.innerHeight - 150),
|
||||
width: \'80%\',
|
||||
title: "'.dol_escape_js($label).'"
|
||||
});
|
||||
$dialog.dialog(\'open\');
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user