MDL-14679 removed all instances of recordset_to_menu()

This commit is contained in:
skodak
2008-06-01 16:10:20 +00:00
parent e9b13bdddc
commit 76ed05e523
2 changed files with 5 additions and 29 deletions
+5
View File
@@ -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');
}
-29
View File
@@ -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