MDL-10729 Active tabs are now marked inactive; backported from HEAD (and fixed commit message :-( )

This commit is contained in:
skodak 2007-09-24 17:15:31 +00:00
parent 61bb817fd2
commit 419b95d2ad

View file

@ -32,20 +32,22 @@
$context = get_context_instance(CONTEXT_MODULE, $cm->id); $context = get_context_instance(CONTEXT_MODULE, $cm->id);
$inactive = NULL; $inactive = NULL;
$activetwo = NULL;
$tabs = array();
$row = array(); $row = array();
$row[] = new tabobject('list', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id, get_string('list','data'), '', true); $row[] = new tabobject('list', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id, get_string('list','data'));
if (isset($record)) { if (isset($record)) {
$row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id, get_string('single','data'), '', true); $row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&rid='.$record->id, get_string('single','data'));
} else { } else {
$row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&mode=single', get_string('single','data'), '', true); $row[] = new tabobject('single', $CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&mode=single', get_string('single','data'));
} }
if (isloggedin()) { if (isloggedin()) {
if (data_user_can_add_entry($data, $currentgroup, $groupmode)) { // took out participation list here! if (data_user_can_add_entry($data, $currentgroup, $groupmode)) { // took out participation list here!
$addstring = empty($editentry) ? get_string('add', 'data') : get_string('editentry', 'data'); $addstring = empty($editentry) ? get_string('add', 'data') : get_string('editentry', 'data');
$row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id, $addstring, '', true); $row[] = new tabobject('add', $CFG->wwwroot.'/mod/data/edit.php?d='.$data->id, $addstring);
} }
if (has_capability('mod/data:managetemplates', $context)) { if (has_capability('mod/data:managetemplates', $context)) {
if ($currenttab == 'list') { if ($currenttab == 'list') {
@ -59,9 +61,9 @@
$row[] = new tabobject('templates', $CFG->wwwroot.'/mod/data/templates.php?d='.$data->id.'&mode='.$defaultemplate, $row[] = new tabobject('templates', $CFG->wwwroot.'/mod/data/templates.php?d='.$data->id.'&mode='.$defaultemplate,
get_string('templates','data')); get_string('templates','data'));
$row[] = new tabobject('fields', $CFG->wwwroot.'/mod/data/field.php?d='.$data->id, $row[] = new tabobject('fields', $CFG->wwwroot.'/mod/data/field.php?d='.$data->id,
get_string('fields','data'), '', true); get_string('fields','data'));
$row[] = new tabobject('presets', $CFG->wwwroot.'/mod/data/preset.php?d='.$data->id, $row[] = new tabobject('presets', $CFG->wwwroot.'/mod/data/preset.php?d='.$data->id,
get_string('presets', 'data'), '', true); get_string('presets', 'data'));
} }
} }
@ -85,12 +87,9 @@
} }
$tabs[] = $row; $tabs[] = $row;
$activetwo = array('templates'); $activetwo = array('templates');
} else {
$activetwo = array();
} }
/// Print out the tabs and continue! /// Print out the tabs and continue!
print_tabs($tabs, $currenttab, $inactive, $activetwo); print_tabs($tabs, $currenttab, $inactive, $activetwo);
?> ?>