wwwroot.'/mod/data/view.php?d='.$data->id, get_string('browse','data'), '', true); if (isteacher($course->id) or ($data->participants == PARTICIPANTS_S) or ($data->participants == PARTICIPANTS_TS)){ $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')); $row[] = new tabobject('fields', $CFG->wwwroot.'/mod/data/fields.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=$d&mode=$template", get_string("$template", "data")); if ($template == $mode) { $currenttab = $template; } } $tabs[] = $row; } /* if ($currenttab == 'browse' and isset($mode)) { $inactive[] = 'browse'; $viewlist = array ('singletemplate', 'listtemplate'); // Standard reports we want to show first $row = array(); $currenttab =''; foreach ($viewlist as $view) { $row[] = new tabobject($view, "view.php?d=$d&mode=$view", get_string("$view", "data")); if ($view == $mode) { $currenttab = $view; } } $tabs[] = $row; }*/ /// Print out the tabs and continue! print_tabs($tabs, $currenttab, $inactive); ?>