aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2010-12-16 15:08:50 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2010-12-16 15:08:50 -0500
commit79ce3d4d72def4127149efe9d164a6ff7eafe0cb (patch)
treec459df4128ccd796c6a8bc2804cb8f56bf380286
parent3fe3f4a5e9598e5391b58b127fd4fa42d90abdf4 (diff)
downloadGradeBook-79ce3d4d72def4127149efe9d164a6ff7eafe0cb.tar.gz
GradeBook-79ce3d4d72def4127149efe9d164a6ff7eafe0cb.zip
added control bar output
darcs-hash:20101216200850-067c0-7445800b9a03362234fe390f67eace4014a8414f.gz
-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 } {