diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-04-21 22:47:08 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-04-21 22:47:08 -0400 |
commit | dfee2b7a20b8c46e4c78e3361502b13743bdfa2c (patch) | |
tree | 7cf3e44f26de80bcbf523d9032e6a83fa161f670 /GradeBook_lib.tcl | |
parent | 23a959a2b262749f64d957ea424612b736dc18b1 (diff) | |
download | GradeBook-dfee2b7a20b8c46e4c78e3361502b13743bdfa2c.tar.gz GradeBook-dfee2b7a20b8c46e4c78e3361502b13743bdfa2c.zip |
added server config array to be read from config file
Ignore-this: df341593d989e3c94bd89dc4a9e0d69a
darcs-hash:20110422024708-067c0-1fc77ce6cc269543b51fee628bfaf9cc835a6a7b.gz
Diffstat (limited to 'GradeBook_lib.tcl')
-rwxr-xr-x | GradeBook_lib.tcl | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index c4e0128..9577855 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -21,7 +21,10 @@ set grades_category [list \ FinalExam\ ] -set icon_dir "/~evmik/icons" +array set GradebookServerConfig [list \ + icon_dir "/~evmik/icons" \ + use_icons true \ + ] # ########################## procs begin ################################# proc default_grades_category {} { @@ -603,7 +606,8 @@ proc htmlReplaceEmptyString { string } { proc action2atributes { action_name } { # return list of action_name, text description, and icon name # for each action - global icon_dir + global GradebookServerConfig + set icon_dir $GradebookServerConfig(icon_dir) case $action_name { userhidecolumn { set attrib [list $action_name "hide" $icon_dir/hide.png ]} changefirstname { set attrib [list $action_name "change first name" $icon_dir/edit.png ]} @@ -621,6 +625,7 @@ proc action2atributes { action_name } { proc htmlDBout {db permission_list user {sort_col {}}} { array set permission $permission_list + global GradebookServerConfig global script_name global grades_category set defSortCol LastName @@ -758,9 +763,15 @@ proc htmlDBout {db permission_list user {sort_col {}}} { set act_label [lindex $attributes 1] set act_icon [lindex $attributes 2] if { [isActionGranted $act $permission_list $user] } { - puts -nonewline "$separator<span class=\"column_control_$act\"><a href=\"$script_name?action=$act&columnname=[::ncgi::encode $col]\">" - puts -nonewline "<img src=\"$act_icon\" alt=\"$act_label\" title=\"$act_label\">" - puts -nonewline "</a></span>" + if { $GradebookServerConfig(use_icons) } { + puts -nonewline "$separator<a href=\"$script_name?action=$act&columnname=[::ncgi::encode $col]\">" + puts -nonewline "<img src=\"$act_icon\" alt=\"$act_label\" title=\"$act_label\">" + puts -nonewline "</a>" + } else { + puts -nonewline "$separator<span class=\"column_control_$act\"><a href=\"$script_name?action=$act&columnname=[::ncgi::encode $col]\">" + puts -nonewline "$act_label" + puts -nonewline "</a></span>" + } } } puts -nonewline "</th>" |