From fa3ef8a59cfd0a4e72f6364f37ccc5ba8f9180ee Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 29 Sep 2020 18:04:56 +0200 Subject: [PATCH] ManageTable : you can set the style of the dialog box --- html/js/managetable.js | 7 +++++-- include/lib/manage_table_sql.class.php | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/html/js/managetable.js b/html/js/managetable.js index 916ba0e98..b6f2795de 100644 --- a/html/js/managetable.js +++ b/html/js/managetable.js @@ -74,9 +74,12 @@ var ManageTable = function (p_table_name) { this.callback = "ajax.php"; //!< File to call this.control = "dtr"; //sort_column=""; $this->dialog_box="dtr"; + $this->dialogbox_style=array("position"=> "fixed", "top"=> '15%',"width"=> "auto", "margin-left"=> "20%"); } /** * send the XML headers for the ajax call @@ -132,6 +133,26 @@ class Manage_Table_SQL header('Content-type:text/xml;charset="UTF-8"'); } + /** + * return the db_style + * @return array + */ + public function get_dialogbox_style() + { + return $this->dialogbox_style; + } + + /** + * Dialog box style , by default {position: "fixed", top: '15%', width: "auto", "margin-left": "20%"} + * + * @param array $db_style , will be transformed into a json object + */ + public function set_dialogbox_style($db_style) + { + $this->dialogbox_style = $db_style; + return $this; + } + /** * @return mixed */ @@ -378,6 +399,7 @@ function check() */ function create_js_script() { + $style=json_encode($this->dialogbox_style); echo " ";