From 578fec47ec0973794ed77bedbe81a5ef4f949c8c Mon Sep 17 00:00:00 2001 From: Peter Velosy Date: Wed, 25 Sep 2024 18:42:38 +0200 Subject: [PATCH] Refactor --- classes/filter_form.php | 11 ----------- datalynx.js | 1 - field/field_class.php | 17 ----------------- field/select/field_class.php | 8 -------- index.php | 2 +- 5 files changed, 1 insertion(+), 38 deletions(-) diff --git a/classes/filter_form.php b/classes/filter_form.php index 26881b8f..e455f03c 100644 --- a/classes/filter_form.php +++ b/classes/filter_form.php @@ -52,9 +52,6 @@ public function check_access_for_dynamic_submission(): void { } public function set_data_for_dynamic_submission(): void { - // Since this runs after definition(), we are not using it, as the form's composition already depends on the data loaded. - global $DB; - $datalynx_id = $this->_ajaxformdata["d"]; $filter_id = $this->_ajaxformdata["fid"]; @@ -74,14 +71,6 @@ public function set_data_for_dynamic_submission(): void { } public function process_dynamic_submission() { - - $datalynx_id = $this->_ajaxformdata["d"]; - $filter_id = $this->_ajaxformdata["fid"]; - - if ($datalynx_id == null || $filter_id == null) { - return; - } - $this->_df = \mod_datalynx\datalynx::get_datalynx_by_instance($datalynx_id); $fm = $this->_df->get_filter_manager(); $this->_filter = $fm->get_filter_from_id($filter_id); diff --git a/datalynx.js b/datalynx.js index b9497e56..1bb82245 100644 --- a/datalynx.js +++ b/datalynx.js @@ -13,7 +13,6 @@ // You should have received a copy of the GNU General Public License // Along with Moodle. If not, see . - /** * @package mod_datalynx * @copyright 2013 onwards David Bogner, Michael Pollak, Ivan Sakic and others. diff --git a/field/field_class.php b/field/field_class.php index 7f8c88dd..02a14215 100644 --- a/field/field_class.php +++ b/field/field_class.php @@ -847,15 +847,6 @@ public function is_datalynx_content() { protected function filearea($suffix = null) { return false; } - - // TODO: Git PR to move this to the base class. - public function get_argument_count(string $operator) { - if ($operator === "") { // "Empty" operator - return 0; - } else { - return 1; - } - } } /** @@ -1036,14 +1027,6 @@ public function parse_search($formdata, $i) { public static function is_customfilterfield() { return true; } - - public function get_argument_count(string $operator) { - if ($operator === "") { // "Empty" operator - return 0; - } else { - return 1; - } - } } /** diff --git a/field/select/field_class.php b/field/select/field_class.php index 2c617917..5c7a3b3a 100644 --- a/field/select/field_class.php +++ b/field/select/field_class.php @@ -59,12 +59,4 @@ public function get_search_value($value) { return ''; } } - - public function get_argument_count(string $operator) { - if ($operator === "") { // "Empty" operator - return 0; - } else { - return 1; - } - } } diff --git a/index.php b/index.php index 35cbe43b..832d723f 100644 --- a/index.php +++ b/index.php @@ -168,4 +168,4 @@ echo html_writer::empty_tag('br'); echo html_writer::tag('div', html_writer::table($table), array('class' => 'no-overflow')); -echo $OUTPUT->footer(); \ No newline at end of file +echo $OUTPUT->footer();