wwwroot.'/mod/data/view.php?d='.$data->id, get_string('browse','data'), '', true); if (isset($record)) { $row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id, get_string('detail','data'), '', true); } else { $row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&mode=single', get_string('detail','data'), '', true); } if (isteacher($course->id) or ($data->participants == DATA_STUDENTS_ONLY) or ($data->participants == DATA_TEACHERS_AND_STUDENTS)){ $addstring = ($rid) ? get_string('editentry', 'data') : get_string('add', 'data'); $row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/add.php?d='.$data->id, $addstring, '', true); } if (isteacher($course->id)) { if ($currenttab == 'list') { 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); } $tabs[] = $row; /***************************** * stolen code from quiz report *****************************/ if ($currenttab == 'templates' and isset($mode)) { $inactive[] = 'templates'; $templatelist = array ('singletemplate', 'listtemplate', 'addtemplate', 'rsstemplate'); // Standard reports we want to show first $row = array(); $currenttab =''; foreach ($templatelist as $template) { $row[] = new tabobject($template, "templates.php?d=$data->id&mode=$template", get_string("$template", "data")); if ($template == $mode) { $currenttab = $template; } } $tabs[] = $row; } /// Print out the tabs and continue! print_tabs($tabs, $currenttab, $inactive); ?>