Index: openacs-4/packages/imsld/www/environment-frame.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/environment-frame.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/imsld/www/environment-frame.tcl 30 May 2007 08:36:22 -0000 1.9 +++ openacs-4/packages/imsld/www/environment-frame.tcl 17 Apr 2008 17:17:54 -0000 1.10 @@ -11,36 +11,28 @@ set user_id [ad_conn user_id] +set frame_header "[_ imsld.Context_info]" +set page_title $frame_header +set context [list] + dom createDocument ul doc set dom_root [$doc documentElement] -#set environments_node_ul [$doc createElement ul] -set environments_node_li [$doc createElement li] -set text [$doc createTextNode "[_ imsld.Context_info]"] -$environments_node_li appendChild $text -set environments_node [$doc createElement ul] -$environments_node setAttribute class "mktree" -$environments_node setAttribute style "white-space: nowrap;" +# Create the ul element which will hold all the environment info +$dom_root setAttribute class "mktree" +$dom_root setAttribute style "white-space: nowrap;" -# FIX-ME: if the ul is empty, the browser shows the ul incorrectly -set text [$doc createTextNode ""] -$environments_node appendChild $text - +# Create the li nodes for each environment set activity_item_id [content::revision::item_id -revision_id $activity_id] - -imsld::process_activity_environments_as_ul -activity_item_id $activity_item_id \ +imsld::process_activity_environments_as_ul \ + -activity_item_id $activity_item_id \ -run_id $run_id \ - -dom_node $environments_node \ + -dom_node $dom_root \ -dom_doc $doc -$dom_root appendChild $environments_node_li -set environments_node_li [$doc createElement li] -$environments_node_li setAttribute class "liOpen" +# Set the result only if it is not empty +if { [$dom_root hasChildNodes]} { + # Set the result + set environments [$dom_root asXML] +} -$environments_node_li appendChild $environments_node -$dom_root appendChild $environments_node_li - -set environments [$dom_root asXML] - -set page_title {} -set context [list]