]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 removed all instances of get_records_menu()
authorskodak <skodak>
Sun, 1 Jun 2008 15:44:59 +0000 (15:44 +0000)
committerskodak <skodak>
Sun, 1 Jun 2008 15:44:59 +0000 (15:44 +0000)
course/edit_form.php
lib/dmllib.php
lib/dmllib_todo.php

index 934f16bd9135c73183cc546af65fb4963a974986..706e20ac2baf624addc3d6dc944811842c7ef4e2 100644 (file)
@@ -359,7 +359,7 @@ class course_edit_form extends moodleform {
             $options['1'] = get_string('yes');
             $mform->addElement('select', 'restrictmodules', get_string('restrictmodules'), $options);
             $mods = array(0=>get_string('allownone'));
-            $mods += get_records_menu('modules', array() ,'name','id, name');
+            $mods += $DB->get_records_menu('modules', array(), 'name', 'id, name');
 
 
             $mform->addElement('select', 'allowedmods', get_string('to'), $mods,
index c7af985d26bc65c77e39765f461bb3b355fa5fca..85f684315adfb39954725ff686422e066ee55c33 100644 (file)
@@ -382,11 +382,7 @@ function get_field($table, $return, $field1, $value1, $field2='', $value2='', $f
 
 
 
-
-
-
-
-///// DELETED - must not be used anymore
+///// DELETED - must not be used anymore!
 
 function configure_dbconnection() {
     error('configure_dbconnection() removed');
@@ -423,3 +419,15 @@ function where_clause($field1='', $value1='', $field2='', $value2='', $field3=''
 function execute_sql_arr($sqlarr, $continue=true, $feedback=true) {
     error('execute_sql_arr() removed');
 }
+
+function get_records_list($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
+    error('get_records_list() removed');
+}
+
+function get_recordset_list($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
+    error('get_recordset_list() removed');
+}
+
+function get_records_menu($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
+    error('get_records_menu() removed');
+}
index 3b0476997da29c446b9b15e6118f7781338ec511..65866c2be0907f1e55c7cba61e13eb55877cb9e1 100644 (file)
@@ -341,35 +341,6 @@ function get_recordset_select($table, $select='', $sort='', $fields='*', $limitf
     return get_recordset_sql('SELECT '. $fields .' FROM '. $CFG->prefix . $table . $select . $sort, $limitfrom, $limitnum);
 }
 
-/**
- * Get a number of records as an ADODB RecordSet.
- *
- * Only records where $field takes one of the values $values are returned.
- * $values should be a comma-separated list of values, for example "4,5,6,10"
- * or "'foo','bar','baz'".
- *
- * Other arguments and the return type as for @see function get_recordset.
- *
- * @param string $table the table to query.
- * @param string $field a field to check (optional).
- * @param string $values comma separated list of values the field must have (requred if field is given, else optional).
- * @param string $sort an order to sort the results in (optional, a valid SQL ORDER BY parameter).
- * @param string $fields a comma separated list of fields to return (optional, by default all fields are returned).
- * @param int $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set).
- * @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
- * @return mixed an ADODB RecordSet object, or false if an error occured.
- */
-function get_recordset_list($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
-
-    if ($field) {
-        $select = "$field IN ($values)";
-    } else {
-        $select = '';
-    }
-
-    return get_recordset_select($table, $select, $sort, $fields, $limitfrom, $limitnum);
-}
-
 /**
  * Get a number of records as an ADODB RecordSet.  $sql must be a complete SQL query.
  * Since this method is a little less readable, use of it should be restricted to
@@ -623,25 +594,6 @@ function get_records_select($table, $select='', $sort='', $fields='*', $limitfro
     return recordset_to_array($rs);
 }
 
-/**
- * Get a number of records as an array of objects.
- *
- * Return value as for @see function get_records.
- *
- * @param string $table The database table to be checked against.
- * @param string $field The field to search
- * @param string $values Comma separated list of possible value
- * @param string $sort Sort order (as valid SQL sort parameter)
- * @param string $fields A comma separated list of fields to be returned from the chosen table. If specified,
- *   the first field should be a unique one such as 'id' since it will be used as a key in the associative
- *   array.
- * @return mixed an array of objects, or false if no records were found or an error occured.
- */
-function get_records_list($table, $field='', $values='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
-    $rs = get_recordset_list($table, $field, $values, $sort, $fields, $limitfrom, $limitnum);
-    return recordset_to_array($rs);
-}
-
 /**
  * Get a number of records as an array of objects.
  *
@@ -712,30 +664,6 @@ function records_to_menu($records, $field1, $field2) {
     }
 }
 
-/**
- * Get the first two columns from a number of records as an associative array.
- *
- * Arguments as for @see function get_recordset.
- *
- * If no errors occur, and at least one records is found, the return value
- * is an associative whose keys come from the first field of each record,
- * and whose values are the corresponding second fields. If no records are found,
- * or an error occurs, false is returned.
- *
- * @param string $table the table to query.
- * @param string $field a field to check (optional).
- * @param string $value the value the field must have (requred if field1 is given, else optional).
- * @param string $sort an order to sort the results in (optional, a valid SQL ORDER BY parameter).
- * @param string $fields a comma separated list of fields to return (optional, by default all fields are returned).
- * @param int $limitfrom return a subset of records, starting at this point (optional, required if $limitnum is set).
- * @param int $limitnum return a subset comprising this many records (optional, required if $limitfrom is set).
- * @return mixed an associative array, or false if no records were found or an error occured.
- */
-function get_records_menu($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='') {
-    $rs = get_recordset($table, $field, $value, $sort, $fields, $limitfrom, $limitnum);
-    return recordset_to_menu($rs);
-}
-
 /**
  * Get the first two columns from a number of records as an associative array.
  *