From 10aba627401873c4a986196bd4573b287e6dcbaa Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 26 Mar 2006 06:00:28 +0000 Subject: [PATCH] Tidy messages and display --- mod/data/field.php | 18 +++++++++--------- mod/data/templates.php | 20 +++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/mod/data/field.php b/mod/data/field.php index c949e4ecb0..0303204f31 100755 --- a/mod/data/field.php +++ b/mod/data/field.php @@ -225,22 +225,16 @@ } 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( - ''. - ''.get_string('edit').''. - ' '. - ''. - ''.get_string('delete').'', 'field->id.'&sesskey='.sesskey().'">'. + ''.get_string('edit').''. + ' '. + ''. + ''.get_string('delete').'' ); } diff --git a/mod/data/templates.php b/mod/data/templates.php index 5589e8aaf2..34dc1d68ac 100755 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -83,8 +83,12 @@ '', '', 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. @@ -105,10 +109,14 @@ // 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&d=$data->id", $data->id, $cm->id); } + } else { + echo '
'.get_string('header'.$mode,'data').'
'; } /// If everything is empty then generate some defaults @@ -120,14 +128,8 @@ data_generate_default_template($data, 'rsstemplate'); } -/// Print the tabs. - $currenttab = 'templates'; - include('tabs.php'); - /// Print the browsing interface. - echo '
'.get_string('header'.$mode,'data').'

'; - echo '
'; echo ''; // Print button to autogen all forms, if all templates are empty -- 2.39.5