]> git.mjollnir.org Git - moodle.git/commitdiff
Tidy messages and display
authormoodler <moodler>
Sun, 26 Mar 2006 06:00:28 +0000 (06:00 +0000)
committermoodler <moodler>
Sun, 26 Mar 2006 06:00:28 +0000 (06:00 +0000)
mod/data/field.php
mod/data/templates.php

index c949e4ecb0b5720920bb4933a705f185db748050..0303204f31da9e4e74c033c6bed5e75231acb5fe 100755 (executable)
 
         } else {    //else print quiz style list of fields
 
-            $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->head = array(get_string('fieldname','data'), get_string('type','data'), get_string('fielddescription', 'data'), get_string('action','data'));
+            $table->align = array('left','left','left', 'center');
             $table->wrap = array(false,false,false,false);
 
             if ($fff = get_records('data_fields','dataid',$data->id,'id')){
                 foreach ($fff as $ff) {
                     $field = data_get_field($ff, $data);
 
-                    /// Print Action Column
                     $table->data[] = array(
 
-                    '<a href="field.php?d='.$data->id.'&amp;mode=display&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
-                    '<img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" /></a>'.
-                    '&nbsp;'.
-                    '<a href="field.php?d='.$data->id.'&amp;mode=delete&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
-                    '<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" /></a>',
 
 
                     '<a href="field.php?mode=display&amp;d='.$data->id.
 
                     $field->image().'&nbsp;'.get_string($field->type, 'data'),
 
-                    shorten_text($field->field->description, 30) 
+                    shorten_text($field->field->description, 30),
+
+                    '<a href="field.php?d='.$data->id.'&amp;mode=display&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
+                    '<img src="'.$CFG->pixpath.'/t/edit.gif" height="11" width="11" border="0" alt="'.get_string('edit').'" /></a>'.
+                    '&nbsp;'.
+                    '<a href="field.php?d='.$data->id.'&amp;mode=delete&amp;fid='.$field->field->id.'&amp;sesskey='.sesskey().'">'.
+                    '<img src="'.$CFG->pixpath.'/t/delete.gif" height="11" width="11" border="0" alt="'.get_string('delete').'" /></a>'
                     
                     );
                 }
index 5589e8aaf2036b9a49297cb2ca7955398ad82054..34dc1d68ac29438f7f9cfc6907b8e833ec4b3f76 100755 (executable)
                         '', '', true, '', navmenu($course, $cm), '', $bodytag);
     
     print_heading(format_string($data->name));
-    
-     /// Processing submitted data, i.e updating form.
+
+/// Print the tabs.
+    $currenttab = 'templates';
+    include('tabs.php'); 
+
+/// Processing submitted data, i.e updating form.
     if (($mytemplate = data_submitted($CFG->wwwroot.'/mod/data/templates.php')) && confirm_sesskey()){
 
         // Generate default template.
 
             // Check for multiple tags, only need to check for add template.
             if ($mode != 'addtemplate' or data_tags_check($data->id, $newtemplate->{$mode})){
-                update_record('data',$newtemplate);
+                if (update_record('data',$newtemplate)) {
+                    notify(get_string('templatesaved','data'), 'notifysuccess');
+                }
             }
             add_to_log($course->id, 'data', 'templates saved', "templates.php?id=$cm->id&amp;d=$data->id", $data->id, $cm->id);
         }
+    } else {
+        echo '<div class="littleintro" align="center">'.get_string('header'.$mode,'data').'</div>';
     }
 
 /// If everything is empty then generate some defaults
         data_generate_default_template($data, 'rsstemplate');
     }
 
-/// Print the tabs.
-    $currenttab = 'templates';
-    include('tabs.php'); 
-
 /// Print the browsing interface.
 
-    echo '<div align="center">'.get_string('header'.$mode,'data').'</div><br />';
-
     echo '<form name="tempform" action="templates.php?d='.$data->id.'&amp;mode='.$mode.'" method="post">';
     echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />';
     // Print button to autogen all forms, if all templates are empty