]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes for fields display
authormoodler <moodler>
Sat, 25 Mar 2006 14:00:54 +0000 (14:00 +0000)
committermoodler <moodler>
Sat, 25 Mar 2006 14:00:54 +0000 (14:00 +0000)
mod/data/field.php
mod/data/lib.php

index fa65352cd5b156944f39cd2e98a200892950d8c8..c949e4ecb0b5720920bb4933a705f185db748050 100755 (executable)
     $fid     = optional_param('fid', 0 , PARAM_INT);          // update field id
     $newtype = optional_param('newtype','',PARAM_ALPHA);    // type of the new field
     $mode    = optional_param('mode','',PARAM_ALPHA);
+    $cancel  = optional_param('cancel', '');
+
+    if ($cancel) {
+        $mode = 'list';
+    }
+    
     
     if ($id) {
         if (! $cm = get_record('course_modules', 'id', $id)) {
 
         } else {    //else print quiz style list of fields
 
-            $table->head = array(get_string('action','data'), get_string('fieldname','data'), get_string('type','data'));
-            $table->align = array('center','left','right');
+            $table->head = array(get_string('action','data'), get_string('fieldname','data'), get_string('type','data'), get_string('fielddescription', 'data'));
+            $table->align = array('center','left','left','left');
+            $table->wrap = array(false,false,false,false);
 
             if ($fff = get_records('data_fields','dataid',$data->id,'id')){
                 foreach ($fff as $ff) {
                     '</td>',
 
 
-                    get_string($field->type, 'data').
-                    '&nbsp;'.
-                    $field->image());
+                    $field->image().'&nbsp;'.get_string($field->type, 'data'),
+
+                    shorten_text($field->field->description, 30) 
+                    
+                    );
                 }
             }
             print_table($table);
index c1405a223ff68cfaf7a79eb136dda565a294b5f4..6c0f9f1d011a32990878db9b914579c6494643ee 100755 (executable)
@@ -200,8 +200,7 @@ class data_field_base {     /// Base class for Database Field Types (see field/*
 
         echo '<div align="center">';
         echo '<input type="submit" value="'.$savebutton.'" />'."\n";
-        echo '<input type="submit" value="'.get_string('cancel').'" '.
-             'onclick="document.editfield.mode.value=\'void\';" />'."\n";
+        echo '<input type="submit" name="cancel" value="'.get_string('cancel').'" />'."\n";
         echo '</div">';
 
         echo '</form>';