]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 removed all instances of records_to_menu()
authorskodak <skodak>
Sun, 1 Jun 2008 16:11:09 +0000 (16:11 +0000)
committerskodak <skodak>
Sun, 1 Jun 2008 16:11:09 +0000 (16:11 +0000)
lib/dmllib.php
lib/dmllib_todo.php

index d6e19e62bd41f24ec7e1372a220e7d141ff96f47..f25711b7fdd55982c419329dbb59884353b998d2 100644 (file)
@@ -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');
+}
+
index 03808932b09987c384c5da77c54e4abe55f12ec5..f652e1fb72c7ebc24cc361ece1eec2617408c209 100644 (file)
@@ -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.
  *