From 4d75b9eb0d7cd5090ddd80f25662baeb305ee8dd Mon Sep 17 00:00:00 2001 From: moodler Date: Sat, 25 Mar 2006 14:56:27 +0000 Subject: [PATCH] Smarter links for the templates tab --- mod/data/tabs.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mod/data/tabs.php b/mod/data/tabs.php index b97edb7c49..32f570aa31 100755 --- a/mod/data/tabs.php +++ b/mod/data/tabs.php @@ -37,7 +37,19 @@ $row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/add.php?d='.$data->id, get_string('add','data'), '', true); } if (isteacher($course->id)) { - $row[] = new tabobject('templates', $CFG->wwwroot.'/mod/data/templates.php?d='.$data->id.'&mode=singletemplate', get_string('templates','data')); + if ($currenttab == 'browse') { + if (get_user_preferences('data_perpage') == 1) { + $defaultemplate = 'singletemplate'; + } else { + $defaultemplate = 'listtemplate'; + } + } else if ($currenttab == 'add') { + $defaultemplate = 'addtemplate'; + } else { + $defaultemplate = 'singletemplate'; + } + + $row[] = new tabobject('templates', $CFG->wwwroot.'/mod/data/templates.php?d='.$data->id.'&mode='.$defaultemplate, get_string('templates','data')); $row[] = new tabobject('fields', $CFG->wwwroot.'/mod/data/field.php?d='.$data->id, get_string('fields','data'), '', true); } -- 2.39.5