diff options
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>" |