aboutsummaryrefslogtreecommitdiff
path: root/GradeBook.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'GradeBook.tcl')
-rwxr-xr-xGradeBook.tcl21
1 files changed, 19 insertions, 2 deletions
diff --git a/GradeBook.tcl b/GradeBook.tcl
index 29f6861..f3f252e 100755
--- a/GradeBook.tcl
+++ b/GradeBook.tcl
@@ -246,7 +246,7 @@ proc ChoseAction {action permission_list user} {
addcolumn { AddColumn }
deletecolumn { }
renamecolumn { }
- showcontrols { }
+ showcontrols { ShowControls $permission_list $user }
showgrades { htmlGradesTable db $permission_list $user }
defaultview { htmlDefaultView $permission_list $user }
default { }
@@ -254,7 +254,24 @@ proc ChoseAction {action permission_list user} {
}
}
-proc AddColumn {} {
+proc AddColumn { permission_list user } {
+}
+
+proc ShowControls { permission_list user } {
+ array set permission $permission_list
+ global script_name
+ dbg "outputing contol list"
+ puts "<div>"
+ set action_list [ list addcolumn "Add Column" ]
+ set separator {"_z_"}
+ foreach {act act_label} $action_list {
+ if { [info exist permission($act) ] } {
+ if { $permission($act) } {
+ puts -nonewline "$separator<a href=$script_name?action=$act>$act_label</a>"
+ }
+ }
+ }
+ puts "</div>"
}
proc AccessGroupRights {db user password } {