From: skodak Date: Sun, 1 Jun 2008 16:11:09 +0000 (+0000) Subject: MDL-14679 removed all instances of records_to_menu() X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=058c5543b90f7ed65afc4510e621b8cc59b87bfd;p=moodle.git MDL-14679 removed all instances of records_to_menu() --- diff --git a/lib/dmllib.php b/lib/dmllib.php index d6e19e62bd..f25711b7fd 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -448,3 +448,7 @@ function recordset_to_menu($rs) { error('recordset_to_menu() removed'); } +function records_to_menu($records, $field1, $field2) { + error('records_to_menu() removed'); +} + diff --git a/lib/dmllib_todo.php b/lib/dmllib_todo.php index 03808932b0..f652e1fb72 100644 --- a/lib/dmllib_todo.php +++ b/lib/dmllib_todo.php @@ -611,30 +611,6 @@ function get_records_sql($sql, $limitfrom='', $limitnum='') { return recordset_to_array($rs); } -/** - * Utility function - * Similar to recordset_to_menu - * - * field1, field2 is needed because the order from get_records_sql is not reliable - * @param records - records from get_records_sql() or get_records() - * @param field1 - field to be used as menu index - * @param field2 - feild to be used as coresponding menu value - * @return mixed an associative array, or false if an error occured or the RecordSet was empty. - */ -function records_to_menu($records, $field1, $field2) { - - $menu = array(); - foreach ($records as $record) { - $menu[$record->$field1] = $record->$field2; - } - - if (!empty($menu)) { - return $menu; - } else { - return false; - } -} - /** * Get a single value from a table row where a particular select clause is true. *