Index: openacs-4/packages/imsld/www/activity-frame-div.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/activity-frame-div.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/activity-frame-div.adp 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,37 @@ + + init_activity() + + + + 1 + + + +
+ +
+
+ + @activities;noquote@ + +

#imsld.navigate#

+
+ + + + + Index: openacs-4/packages/imsld/www/activity-frame-div.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/activity-frame-div.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/activity-frame-div.tcl 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,325 @@ +# packages/imsld/www/activity-frame.tcl + +ad_page_contract { + + This is the frame that contains the associated URLs of an activity + + @author Eduardo Pérez Ureta + @creation-date 2006-03-03 +} -query { + run_id:integer,notnull + activity_id:integer,notnull + {role_id ""} + {supported_user_id ""} + {user_id ""} +} + +set user_id [expr { [string eq $user_id ""] ? [ad_conn user_id] : $user_id }] + +set roles_template_p 0 +db_1row context_info { + select r.imsld_id, + case + when exists (select 1 from imsld_learning_activities where activity_id = :activity_id) + then 'learning' + when exists (select 1 from imsld_support_activities where activity_id = :activity_id) + then 'support' + when exists (select 1 from imsld_activity_structures where structure_id = :activity_id) + then 'structure' + end as activity_type + from imsld_runs r + where run_id = :run_id +} + +# make sure the activity is marked as started for this user +db_dml mark_activity_started { + insert into imsld_status_user (imsld_id, + run_id, + related_id, + user_id, + type, + status_date, + status) + ( + select :imsld_id, + :run_id, + :activity_id, + :user_id, + :activity_type, + now(), + 'started' + where not exists (select 1 from imsld_status_user where run_id = :run_id and user_id = :user_id and related_id = :activity_id and status = 'started') + ) +} + +set activity_item_id [content::revision::item_id -revision_id $activity_id] + +set referencer_structure_item_id "" + +if { [string eq $activity_type "learning"] } { + if { [string eq "" [db_string completion_restriction {select complete_act_id from imsld_learning_activities where activity_id = :activity_id}]] } { + # the learning activity has been visited and doesn't have any completion restriction. + # if it is referenced from an activity structure, verify if every referenced activity have been visted + db_0or1row referenced_from_structure_p { + select ar.object_id_one as referencer_structure_item_id + from acs_rels ar + where ar.object_id_two = :activity_item_id + } + } +} elseif { [string eq $activity_type "support"] } { + if { [string eq "" [db_string completion_restriction {select complete_act_id from imsld_support_activities where activity_id = :activity_id}]] } { + # the learning activity has been visited and doesn't have any completion restriction. + # if it is referenced from an activity structure, verify if every referenced activity have been visted + db_0or1row referenced_from_structure_p { + select ar.object_id_one as referencer_structure_item_id + from acs_rels ar + where ar.object_id_two = :activity_item_id + } + } +} + +if { ![string eq "" $referencer_structure_item_id] } { + db_1row get_structure_info { + select structure_id, + number_to_select + from imsld_activity_structuresi + where item_id = :referencer_structure_item_id + and content_revision__is_live(structure_id) = 't' + } + + # if the structure hasn't been finished + if { ![db_0or1row already_finished { + select 1 + from imsld_status_user + where related_id = :structure_id + and user_id = :user_id + and run_id = :run_id + and status = 'finished' + }] } { + set mark_structure_finished_p 1 + set total_completed 0 + foreach referenced_activity [db_list_of_lists struct_referenced_activities { + select ar.object_id_two, + ar.rel_type + from acs_rels ar + where ar.object_id_one = :referencer_structure_item_id + order by ar.object_id_two + }] { + set object_id_two [lindex $referenced_activity 0] + set rel_type [lindex $referenced_activity 1] + switch $rel_type { + imsld_as_la_rel { + # if the activity doesn't have any completrion restriction + # and it hasn't been started, cancel the completion of the structure + set referenced_activity_id [content::item::get_live_revision -item_id $object_id_two] + set la_completion_restriction [db_string la_completion_restriction { + select complete_act_id + from imsld_learning_activities + where activity_id = :referenced_activity_id + }] + if { ([db_0or1row la_already_started_p { + select 1 + from imsld_status_user + where related_id = :referenced_activity_id + and user_id = :user_id + and run_id = :run_id + and status = 'started' + }] && [string eq "" $la_completion_restriction]) \ + || [db_0or1row la_already_finished { + select 1 + from imsld_status_user + where related_id = :referenced_activity_id + and user_id = :user_id + and run_id = :run_id + and status = 'finished' + }] } { + # the activity has been visited + incr total_completed + } else { + set mark_structure_finished_p 0 + continue + } + } + imsld_as_sa_rel { + # if the activity doesn't have any completrion restriction + # and it hasn't been started, cancel the completion of the structure + set referenced_activity_id [content::item::get_live_revision -item_id $object_id_two] + if { ([db_0or1row la_already_started_p { + select 1 + from imsld_status_user + where related_id = :referenced_activity_id + and user_id = :user_id + and run_id = :run_id + and status = 'started' + }] && [string eq "" $sa_completion_restriction]) \ + || [db_0or1row la_already_finished { + select 1 + from imsld_status_user + where related_id = :referenced_activity_id + and user_id = :user_id + and run_id = :run_id + and status = 'finished' + }] } { + # the activity has been visited + incr total_completed + } else { + set mark_structure_finished_p 0 + continue + } + } imsld_as_as_rel { + # if the referenced activity structure hasn't been finished, don't finish the activity structure + set structure_id [content::item::get_live_revision -item_id $object_id_two] + if { ![db_0or1row sa_already_finished_p { + select 1 + from imsld_status_user + where related_id = :referenced_activity_id + and user_id = :user_id + and run_id = :run_id + and status = 'finished' + }] } { + set mark_structure_finished_p 0 + continue + } else { + incr total_completed + } + } + } + } + if { $mark_structure_finished_p || (![string eq $number_to_select ""] && ($total_completed >= $number_to_select)) } { + # mark the structure as finished + + set role_part_id_list [imsld::get_role_part_from_activity -activity_type structure -leaf_id $referencer_structure_item_id] + foreach role_part_id $role_part_id_list { + db_1row context_info { + select acts.act_id, + plays.play_id + from imsld_actsi acts, imsld_playsi plays, imsld_role_parts rp + where rp.role_part_id = :role_part_id + and rp.act_id = acts.item_id + and acts.play_id = plays.item_id + } + + imsld::finish_component_element -imsld_id $imsld_id \ + -run_id $run_id \ + -play_id $play_id \ + -act_id $act_id \ + -role_part_id $role_part_id \ + -element_id $structure_id \ + -type structure \ + -user_id $user_id \ + -code_call + } + } + } +} + +set supported_roles [db_list supported_roles_list { select iri.role_id + from imsld_rolesi iri, + acs_rels ar, + imsld_support_activitiesi isai + where iri.item_id=ar.object_id_two + and ar.rel_type='imsld_sa_role_rel' + and ar.object_id_one=isai.item_id + and isai.activity_id =:activity_id }] + +if {[llength $supported_roles]} { + set roles_template_p 1 +} + +if { !$roles_template_p } { + + dom createDocument div doc + set dom_root [$doc documentElement] + $dom_root setAttribute class "tabber" + + set activity_item_id [content::revision::item_id -revision_id $activity_id] + imsld::process_activity_as_ul -activity_item_id $activity_item_id -run_id $run_id -dom_doc $doc -dom_node $dom_root + + if { ![string eq $activity_id ""] && [db_0or1row get_table_name { + select + case + when exists (select 1 from imsld_learning_activities where activity_id=:activity_id) + then 'imsld_learning_activities' + when exists (select 1 from imsld_support_activities where activity_id=:activity_id) + then 'imsld_support_activities' + end as table_name + from dual + }] && ![string eq "" $table_name] } { + #grant permissions to resources in activity + set resources_list [db_list get_resources_from_activity " + select ar2.object_id_two + from $table_name ila, + acs_rels ar1, + acs_rels ar2 + where activity_id=:activity_id + and ar1.object_id_one=ila.activity_description_id + and ar1.rel_type='imsld_actdesc_item_rel' + and ar1.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_item_res_rel' + "] + + if {[string eq 'imsld_learning_activities' $table_name]} { + + set prerequisites_list [db_list get_prerequisites_list " + select ar2.object_id_two + from acs_rels ar1, + acs_rels ar2, + $table_name tn + where tn.activity_id=:activity_id + and ar1.object_id_one=tn.prerequisite_id + and ar1.rel_type='imsld_preq_item_rel' + and ar1.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_item_res_rel' + "] + set objectives_list [db_list get_objectives_list " + select ar2.object_id_two + from acs_rels ar1, + acs_rels ar2, + $table_name tn + where tn.activity_id=:activity_id + and ar1.object_id_one=tn.learning_objective_id + and ar1.rel_type='imsld_lo_item_rel' + and ar1.object_id_two=ar2.object_id_one + and ar2.rel_type='imsld_item_res_rel' + "] + } else { + set prerequisites_list [list] + set objectives_list [list] + } + set resources_list [concat $resources_list [concat $prerequisites_list $objectives_list]] + imsld::grant_permissions -resources_activities_list $resources_list -user_id $user_id -run_id $run_id + } + set activities [$dom_root asXML] +} else { + # a user has been selected to be supported + # get the associated resource of the support activity + db_1row activity_info { + select ii.imsld_item_id + from imsld_items ii, imsld_activity_descs sad, imsld_support_activities sa, + cr_items cr1, cr_items cr2, + acs_rels ar + where sa.activity_id = :activity_id + and sa.activity_description_id = cr1.item_id + and cr1.live_revision = sad.description_id + and ar.object_id_one = sa.activity_description_id + and ar.object_id_two = cr2.item_id + and cr2.live_revision = ii.imsld_item_id + } + + db_1row support_activity_associated_item { + select cpr.resource_id, + cpr.item_id as resource_item_id, + cpr.type as resource_type + from imsld_cp_resourcesi cpr, imsld_itemsi ii, + acs_rels ar + where ar.object_id_one = ii.item_id + and ar.object_id_two = cpr.item_id + and content_revision__is_live(cpr.resource_id) = 't' + and ii.imsld_item_id = :imsld_item_id + } + + set activities [export_vars -base "imsld-content-serve" -url { run_id resource_item_id role_id {owner_user_id $supported_user_id} }] +} + +set page_title {} +set context [list] Index: openacs-4/packages/imsld/www/activity-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/activity-frame.adp,v diff -u -r1.16 -r1.17 --- openacs-4/packages/imsld/www/activity-frame.adp 17 Apr 2008 17:17:54 -0000 1.16 +++ openacs-4/packages/imsld/www/activity-frame.adp 5 Jun 2008 17:36:53 -0000 1.17 @@ -27,7 +27,7 @@

#imsld.navigate#

- + + + + Index: openacs-4/packages/imsld/www/environment-frame-div.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/environment-frame-div.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/environment-frame-div.tcl 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,38 @@ +ad_page_contract { + + This is the frame that contains the associated URLs of an environment + + @author Eduardo Pérez Ureta + @creation-date 2006-03-03 +} -query { + activity_id:integer,notnull + run_id:integer,notnull +} + +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] + +# Create the ul element which will hold all the environment info +$dom_root setAttribute class "mktree" +$dom_root setAttribute style "white-space: nowrap;" + +# 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 \ + -run_id $run_id \ + -dom_node $dom_root \ + -dom_doc $doc + +# Set the result only if it is not empty +if { [$dom_root hasChildNodes]} { + # Set the result + set environments [$dom_root asXML] +} + 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.10 -r1.11 --- openacs-4/packages/imsld/www/environment-frame.tcl 17 Apr 2008 17:17:54 -0000 1.10 +++ openacs-4/packages/imsld/www/environment-frame.tcl 5 Jun 2008 17:36:53 -0000 1.11 @@ -28,7 +28,8 @@ -activity_item_id $activity_item_id \ -run_id $run_id \ -dom_node $dom_root \ - -dom_doc $doc + -dom_doc $doc \ + -target "content" # Set the result only if it is not empty if { [$dom_root hasChildNodes]} { Index: openacs-4/packages/imsld/www/imsld-divset.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-divset.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/imsld-divset.adp 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + @course_name@ + + +
+ +
+
+
+
+
+ + Index: openacs-4/packages/imsld/www/imsld-divset.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/imsld-divset.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/imsld-divset.tcl 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,17 @@ +# packages/imsld/www/imsld-frameset.tcl + +ad_page_contract { + + Course Delivery Based on IMS Content Packaging Structure + + @author Eduardo Perez Ureta + @creation-date 2006-03-21 + @cvs-id $Id: imsld-divset.tcl,v 1.1 2008/06/05 17:36:53 derickl Exp $ +} { + run_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set course_name "" Index: openacs-4/packages/imsld/www/imsld-frameset.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/imsld-frameset.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/imsld/www/imsld-frameset.adp 17 Apr 2008 17:17:54 -0000 1.9 +++ openacs-4/packages/imsld/www/imsld-frameset.adp 5 Jun 2008 17:36:53 -0000 1.10 @@ -4,6 +4,9 @@ @course_name@ + Index: openacs-4/packages/imsld/www/imsld-tree-div.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/imsld-tree-div.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/imsld-tree-div.adp 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,57 @@ + + 1 + + + +
+ + + +
+ +
#imsld.Activities#
+ +
+ + @html_tree;noquote@ + + @aux_html_tree;noquote@ + + + @user_message@ + + + + + + + + Index: openacs-4/packages/imsld/www/imsld-tree-div.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/Attic/imsld-tree-div.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/imsld-tree-div.tcl 5 Jun 2008 17:36:53 -0000 1.1 @@ -0,0 +1,160 @@ +ad_page_contract { + @author jopez@inv.it.uc3m.es + @creation-date Mar 2006 +} { + run_id:integer,notnull + {current_role_id ""} +} + +# initialize variables +set page_title "[_ imsld.units-of-learning]" +set context "" +set community_id [dotlrn_community::get_community_id] +set cr_root_folder_id [imsld::cr::get_root_folder -community_id $community_id] +set user_id [ad_conn user_id] +set community_url [dotlrn_community::get_community_url $community_id] + +db_1row imslds_in_class { + select imsld.item_id as imsld_item_id, + imsld.imsld_id, + coalesce(imsld.title, imsld.identifier) as imsld_title + from imsld_imsldsi imsld, imsld_runs run + where imsld.imsld_id = run.imsld_id + and run.run_id = :run_id +} + +# current role information. +# the user must have an active role in the run +set possible_user_roles [imsld::roles::get_user_roles -user_id $user_id \ + -run_id $run_id] +set possible_user_role_names [imsld::roles::get_roles_names \ + -roles_list $possible_user_roles] +# remove   added in the previous proc +regsub -all " " $possible_user_role_names "" $possible_user_role_names + +# if there is only one role, set it +set current_role_id [expr { [llength $possible_user_roles] == 1 ? [lindex $possible_user_roles 0] : "$current_role_id" }] + +if { ![empty_string_p $current_role_id] } { + # a role has been selected, update in db + db_dml update_current_role { + update imsld_run_users_group_rels + set active_role_id = :current_role_id + where rel_id = (select ar.rel_id + from acs_rels ar, imsld_run_users_group_ext iruge + where ar.object_id_one = iruge.group_id + and ar.object_id_two = :user_id + and iruge.run_id = :run_id) + } +} + +if { ![db_0or1row get_current_role { + select map.active_role_id as user_role_id + from imsld_run_users_group_rels map, + acs_rels ar, + imsld_run_users_group_ext iruge + where ar.rel_id = map.rel_id + and ar.object_id_one = iruge.group_id + and ar.object_id_two = :user_id + and iruge.run_id = :run_id + and map.active_role_id is not null +}] } { + # no role have been selected, generate the first option + set possible_user_roles [linsert $possible_user_roles 0 0] + set possible_user_role_names [linsert $possible_user_role_names 0 "[_ imsld.Select_role]"] + set user_role_id -1 +} + +template::multirow create possible_roles item_id item_name + +foreach role $possible_user_roles { + template::multirow append possible_roles \ + $role [lindex $possible_user_role_names \ + [lsearch -exact $possible_user_roles $role]] +} + +set user_message "" +set next_activity_id [imsld::get_next_activity_list -run_id $run_id -user_id $user_id] + +set remaining_activities [llength [join $next_activity_id]] + +if {!$remaining_activities} { + set all_finished [imsld::run_finished_p -run_id $run_id] + if {$all_finished} { + db_dml stop_run { + update imsld_runs + set status='stopped' + where run_id=:run_id + } + } else { + set user_message "[_ imsld.lt_Please_wait_for_other]" + } +} + +set run_status [db_string get_run_status { + select status + from imsld_runs + where run_id=:run_id +}] + +if {[string eq "stopped" $run_status]} { + set user_message "[_ imsld.lt_The_course_has_been_f]" +} + +dom createDocument ul doc +set dom_root [$doc documentElement] +$dom_root setAttribute class "mktree" +set imsld_title_node [$doc createElement li] +$imsld_title_node setAttribute class "liOpen" +set text [$doc createTextNode "$imsld_title"] +$imsld_title_node appendChild $text +$dom_root appendChild $imsld_title_node + +set activities_node [$doc createElement ul] + +if { $user_role_id == -1 } { + set html_tree "" + set aux_html_tree "" +} else { + imsld::generate_activities_tree -div -run_id $run_id \ + -user_id $user_id \ + -next_activity_id_list $next_activity_id \ + -dom_node $activities_node \ + -dom_doc $doc + + $imsld_title_node appendChild $activities_node + + set html_tree [$dom_root asXML] + + # runtime generated activities (notifications, level C) + if { [db_string generated_acitivties_p { + select count(*) + from imsld_runtime_activities_rels + where role_id = :current_role_id + and run_id = :run_id + } -default 0] > 0 } { + dom createDocument ul aux_doc + set aux_dom_root [$aux_doc documentElement] + $aux_dom_root setAttribute class "mktree" + set aux_title_node [$aux_doc createElement li] + $aux_title_node setAttribute class "liOpen" + set text [$doc createTextNode "[_ imsld.Extra_Activities]"] + $aux_title_node appendChild $text + $aux_dom_root appendChild $aux_title_node + + set aux_activities_node [$aux_doc createElement ul] + imsld::generate_runtime_assigned_activities_tree -div -run_id $run_id \ + -user_id $user_id \ + -dom_node $aux_activities_node \ + -dom_doc $aux_doc + + $aux_title_node appendChild $aux_activities_node + + set aux_html_tree [$aux_dom_root asXML] + } else { + set aux_html_tree "" + } + +} + +set select_string "[_ imsld.Select_role]" Index: openacs-4/packages/imsld/www/resources/imsld.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.css,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/www/resources/imsld.css 7 Oct 2007 22:37:02 -0000 1.2 +++ openacs-4/packages/imsld/www/resources/imsld.css 5 Jun 2008 17:36:53 -0000 1.3 @@ -53,8 +53,8 @@ font-variant: normal; text-decoration: none; text-transform: none; - text-indent: -15px; - padding: 0px 0px 5px 0px; + text-indent: 0px; + padding: 0px 0px 5px 5px; margin: 0px; white-space: nowrap; } @@ -91,3 +91,29 @@ .float-left { float: left; } .frame-header { text-align: center; padding: 6px 8px } + +div.frame { + position:absolute; + overflow: auto; +} + +div#tree { + left:0; + padding:0; + width:30%; + height:50%; +} + +div#environment { + left:0; + padding:0; + width:30%; + height:50%; + top:50%; +} + +div#content { + width:70%; + height:99%; + left:30%; +} Index: openacs-4/packages/imsld/www/resources/imsld.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.js,v diff -u -r1.2 -r1.3 --- openacs-4/packages/imsld/www/resources/imsld.js 7 Oct 2007 22:37:02 -0000 1.2 +++ openacs-4/packages/imsld/www/resources/imsld.js 5 Jun 2008 17:36:53 -0000 1.3 @@ -30,6 +30,11 @@ o.height = document.body.clientHeight - o.style.top; }; + if (document.getElementById('content')) { + o.width = '99%'; + o.height = '78%'; + } + } /*==================================================*/ @@ -70,7 +75,9 @@ resizeobject(); window.onresize = resizeobject; - var as = document.getElementsByTagName("a"); + var content = document.getElementById("content"); + if (content == null) content = document; + var as = content.getElementsByTagName("a"); for (var i = 0; i < as.length; i++) { var a = as[i]; a.setAttribute('target', 'object'); @@ -84,3 +91,106 @@ tabberAutomatic(); } + + +function loadContent(url) { + var objXmlHttp=null + try { + objXmlHttp = new XMLHttpRequest(); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch(e) { + alert("error opening XMLHTTP") + } + } + } + + objXmlHttp.onreadystatechange = function() { + if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){ + document.getElementById('content').innerHTML = objXmlHttp.responseText; + init_activity(); + convertTrees(); + } + } + + objXmlHttp.open("GET",url,true); + objXmlHttp.send(null); + return(false); +} + + +/*==================================================*/ + +function loadEnvironment(url) { + var objXmlHttp=null + try { + objXmlHttp = new XMLHttpRequest(); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch(e) { + try { + objXmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch(e) { + alert("error opening XMLHTTP") + } + } + } + + objXmlHttp.onreadystatechange = function() { + if (objXmlHttp.readyState==4 || objXmlHttp.readyState=="complete"){ + document.getElementById('environment').innerHTML = objXmlHttp.responseText; + var as = document.getElementById("environment").getElementsByTagName("a"); + for (var i = 0; i < as.length; i++) { + var a = as[i]; + a.setAttribute('target', 'content'); + var oldEvent = a.onclick; + a.onclick = function() { + if (oldEvent) { oldEvent(); } + loadContent(a.href); + return(false); + } + } + convertTrees(); + } + } + + objXmlHttp.open("GET",url,true); + objXmlHttp.send(null); + return(false); +} + + + +/*==================================================*/ + +function _tp_div(a){ + var ab=document.getElementById("addc"); + var ac=document.getElementById("addc1"); + + if (a) { + ai='show'; + aj='hide'; + document.getElementById("tree").style.width= '30%'; + document.getElementById("environment").style.width= '30%'; + document.getElementById("content").style.width= '70%'; + document.getElementById("content").style.left= '30%'; + } else { + /* collapse the left panels */ + ai='hide'; + aj='show'; + document.getElementById("tree").style.width= '0'; + document.getElementById("environment").style.width= '0'; + document.getElementById("content").style.width= '100%'; + document.getElementById("content").style.left= '0'; + } + + ac.className=ai; + ab.className=aj; + + return false; +}