From: skodak Date: Sun, 1 Jun 2008 16:10:20 +0000 (+0000) Subject: MDL-14679 removed all instances of recordset_to_menu() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=76ed05e523edd6cd2290ec4389c3ee1012d4c992;p=moodle.git MDL-14679 removed all instances of recordset_to_menu() --- diff --git a/lib/dmllib.php b/lib/dmllib.php index 71e7b34cdc..d6e19e62bd 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -443,3 +443,8 @@ function get_records_sql_menu($sql, $limitfrom='', $limitnum='') { function column_type($table, $column) { error('column_type() removed'); } + +function recordset_to_menu($rs) { + error('recordset_to_menu() removed'); +} + diff --git a/lib/dmllib_todo.php b/lib/dmllib_todo.php index 352094918e..03808932b0 100644 --- a/lib/dmllib_todo.php +++ b/lib/dmllib_todo.php @@ -611,35 +611,6 @@ function get_records_sql($sql, $limitfrom='', $limitnum='') { return recordset_to_array($rs); } -/** - * Utility function used by the following 3 methods. - * - * @param object an ADODB RecordSet object with two columns. - * @return mixed an associative array, or false if an error occured or the RecordSet was empty. - */ -function recordset_to_menu($rs) { - global $CFG; - $menu = array(); - if ($rs && !rs_EOF($rs)) { - $keys = array_keys($rs->fields); - $key0=$keys[0]; - $key1=$keys[1]; - while (!$rs->EOF) { - $menu[$rs->fields[$key0]] = $rs->fields[$key1]; - $rs->MoveNext(); - } - /// Really DIRTY HACK for Oracle, but it's the only way to make it work - /// until we got all those NOT NULL DEFAULT '' out from Moodle - if ($CFG->dbfamily == 'oracle') { - array_walk($menu, 'onespace2empty'); - } - /// End of DIRTY HACK - return $menu; - } else { - return false; - } -} - /** * Utility function * Similar to recordset_to_menu