]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for Bug #4969. Renamed variable $mode to $template.
authorvyshane <vyshane>
Fri, 24 Mar 2006 02:09:15 +0000 (02:09 +0000)
committervyshane <vyshane>
Fri, 24 Mar 2006 02:09:15 +0000 (02:09 +0000)
mod/data/lib.php

index 8c3e39c04b613d09c453e5dfe5b0831a58faa875..3ceda955ac16727f70d014a750f2c6e2d150344a 100755 (executable)
@@ -318,12 +318,12 @@ function data_generate_default_template($data, $template, $recordid=0, $form=fal
     }
     
     //get all the fields for that database
-    if ($fields = get_records('data_fields', 'dataid', $data->id)){
+    if ($fields = get_records('data_fields', 'dataid', $data->id)) {
    
         $str = '<div align="center">';
         $str .= '<table>';
 
-        foreach ($fields as $field){
+        foreach ($fields as $field) {
 
             $str .= '<tr><td valign="top" align="right">';
             $str .= $field->name.':';
@@ -353,7 +353,7 @@ function data_generate_default_template($data, $template, $recordid=0, $form=fal
 
         if ($update) {
             $newdata->id = $data->id;
-            $newdata->{$mode} = $str;
+            $newdata->{$template} = $str;
             if (!update_record('data', $newdata)) {
                 notify('Error updating template');
             }