Index: openacs-4/packages/lorsm/www/delivery-scorm/applet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/applet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/applet.adp 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,59 @@ + + + +
+DEBUG MODE ON. THIS IS APPLET.ADP
+@cookie@
+
+ + + + width="150" height="150" id="APIAdapter" + + + width="0" height="0" id="APIAdapter" + + codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"> + + + + + + + + + + + + + + + +this is a comment + + + + debug="true" + height="150" + width="150" + + + debug="false" + height="0" + width="0" + + name="APIAdapter"> + + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/applet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/applet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/applet.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,18 @@ +# packages/lorsm/www/delivery/index.tcl + +ad_page_contract { + + Course Delivery Table of Content + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-04-09 + @arch-tag 553390f0-450e-48db-99f0-c5dcb17978b8 + @cvs-id $Id: applet.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { +} -properties { +} -validate { +} -errors { +} + +set debuglevel [ad_get_client_property lorsm debuglevel] +set cookie [ad_get_cookie ad_session_id] Index: openacs-4/packages/lorsm/www/delivery-scorm/blank.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/blank.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/blank.html 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1 @@ \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery-scorm/body.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/body.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/body.adp 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,42 @@ + +
+ +

Welcome to @course_name@

+

+ + Your Stats: +
+ You have seen this course x number of times and have covered @viewed_percent@ % of the content. +

+ +

+ The last page you viewed was: @last_page_viewed;noquote@ + +

+ Click on menu to the left to view course materials. + + + + + + + + + + + + + + + + + + + + +

  @course_name@.  

+ + + Index: openacs-4/packages/lorsm/www/delivery-scorm/body.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/body.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/body.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,66 @@ +# packages/lorsm/www/delivery/body.tcl + +ad_page_contract { + + Course Delivery Body + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-04-09 + @arch-tag a20dffe3-6d54-4ece-858c-4529e82c163b + @cvs-id $Id: body.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { + man_id:notnull +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] +db_0or1row get_last_viewed { + select ims_item_id as imsitem_id, coalesce(acs_object__name(object_id),'Item '||object_id) as last_page_viewed + from views v, + ims_cp_items i, + ims_cp_organizations o + where v.viewer_id = :user_id + and v.object_id = i.ims_item_id + and i.org_id = o.org_id + and o.man_id = :man_id + order by v.last_viewed desc + limit 1 +} + +set all_items [db_list get_total_items { + select i.ims_item_id + from ims_cp_items i, + ims_cp_organizations o + where o.man_id = :man_id + and i.org_id = o.org_id +}] +set total_item_count [llength $all_items] +set viewed_items [db_list get_viewed_items " + select v.object_id + from views v + where v.viewer_id = :user_id + and v.object_id in ([join $all_items ,]) + "] +set viewed_item_count [llength $viewed_items] +set viewed_percent [lc_numeric [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] "%.2f"] + +# Get the course name +if {[db_0or1row manifest " + select + cp.course_name, + cp.fs_package_id + from + ims_cp_manifests cp + where + cp.man_id = :man_id + and cp.parent_man_id = 0"]} { + + # Course Name + if {[empty_string_p $course_name]} { + set course_name "No Course Name" + } +} else { + set course_name "No Course Name" +} \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery-scorm/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/exit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/exit.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,54 @@ +# packages/lorsm/www/delivery/exit.tcl + +ad_page_contract { + + Student tracking exit + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-25 + @arch-tag 04aa013e-2a53-45eb-825d-d576ea35cd14 + @cvs-id $Id: exit.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { + track_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +#set the following accordingly +set level "Notice" + + set track_id [ad_get_client_property lorsm currenttrackid] + set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] + + + ns_log $level "EXIT track_id $track_id" + ns_log $level "SCORM lorsmstudenttrack $lorsmstudenttrack" + + if { ! [empty_string_p $lorsmstudenttrack] } { + if { $lorsmstudenttrack == 0 } { + lorsm::track::exit -track_id $track_id } else { + #speficic for courses for which istrackable is on + lorsm::track::exit -track_id $lorsmstudenttrack } + ns_log $level "SCORM exiting a scorm course which didnt'actually FINISH" + } else { + ns_log $level "SCORM exiting a scorm course which never INITED" + } + + #unset the CLIENT properties + ad_set_client_property lorsm currenttrackid "" + ad_set_client_property lorsm studenttrack "" + if { $track_id == 0 || $track_id == "" } { + ns_log $level "SCORM leaving non rte-inited (or better a rte-finished) course" + } else { + ns_log $level "SCORM leaving course which had been rte-inited but NOT FINISHED (user forcing exit before time) (lorsm_cmi_core.track_id=$track_id)" + } + if { $lorsmstudenttrack == 0 || $lorsmstudenttrack == "" } { + ns_log $level "SCORM leaving non istrackable course" + } else { + ns_log $level "SCORM leaving course which was either istrackable or rte-inited (lorsm_student_track.track_id=$lorsmstudenttrack" + } + +# redirects +ad_returnredirect $return_url Index: openacs-4/packages/lorsm/www/delivery-scorm/header.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/header.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/header.html 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,55 @@ + + +Navigation Window + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/index.adp 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,274 @@ + + + + + + + + + +@course_name@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/index.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,70 @@ +# packages/lorsm/www/delivery4/index.tcl + +ad_page_contract { + + New index file using new tree menu + + @author Roel Canicula (roelmc@info.com.ph) + @creation-date 2004-08-07 + @arch-tag: 64f3397b-4558-4298-a995-fc63e472f2a1 + @cvs-id $Id: index.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { + menu_off:integer,notnull,optional + man_id:integer,notnull + ims_id:integer,notnull,optional +} -properties { +} -validate { +} -errors { +} + +set debuglevel 0 +ad_set_client_property lorsm debuglevel $debuglevel + +set ses_renew [ad_parameter -package_id [ad_acs_kernel_id] SessionRenew security 300] + +if { ! [info exists menu_off] } { + set menu_off 0 +} + +if { [info exists ims_id] } { + set item_id $ims_id + ad_set_client_property lorsm ims_id $ims_id + set body_url [export_vars -base "record-view" -url {item_id man_id}] +} + +# Get the course name +if {[db_0or1row manifest " + select + cp.course_name, + cp.fs_package_id + from + ims_cp_manifests cp + where + cp.man_id = :man_id + and cp.parent_man_id = 0"]} { + + # Course Name + if {[empty_string_p $course_name]} { + set course_name "No Course Name" + } +} else { + set course_name "No Course Name" +} + +# Student tracking +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] +set user_id [ad_conn user_id] +ad_set_client_property lorsm currentcourse $man_id + + +if {[lorsm::track::istrackable -course_id $man_id -package_id $package_id]} { + set track_id [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $man_id] + ad_set_client_property lorsm studenttrack $track_id +} else { + set track_id 0 + ad_set_client_property lorsm studenttrack 0 +} Index: openacs-4/packages/lorsm/www/delivery-scorm/keepalive.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/keepalive.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/keepalive.adp 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,13 @@ + + +Keepalive window +Shouldn't ever turn to login HREF + + <%= [ns_httptime [ns_time]] %> + +#acs-subsite.Not_logged_in#
+#acs-subsite.Login_or_register# +
+ +@user_name@
+
Index: openacs-4/packages/lorsm/www/delivery-scorm/keepalive.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/keepalive.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/keepalive.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,6 @@ +set user_id [ad_conn user_id] + +if { $user_id != 0 } { + set user_name [person::name -person_id $user_id] +} + Index: openacs-4/packages/lorsm/www/delivery-scorm/menu.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/menu.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/menu.adp 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + Exit Course +  +
+
+ + +
+ + + + + + Menu not available. + + + + +
+ +debug is: ON + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/menu.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/menu.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/menu.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,185 @@ +# packages/lorsm/www/delivery/index.tcl + +ad_page_contract { + + Course Delivery Table of Content + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-04-09 + @arch-tag 553390f0-450e-48db-99f0-c5dcb17978b8 + @cvs-id $Id: menu.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { + menu_off:integer,notnull,optional + man_id:integer,notnull + ims_id:integer,notnull,optional + track_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set debuglevel [ad_get_client_property lorsm debuglevel] +set counter 1 +set user_id [ad_conn user_id] +if { ![info exists menu_off] } { + set menu_off 0 +} + +proc generate_tree_menu { items index rlevel } { + # This function is recursive + + set adp_level [template::adp_level] + upvar TREE_HASH TREE_HASH + upvar index localindex + upvar #$adp_level counter counter + upvar #$adp_level ims_id ims_id + set itemcount [llength $items] + + # Loop through first level items + # Sub-items are recursed + while { $index < $itemcount } { + set one [lindex $items $index] + set level [lindex $one 0] + set item_id [lindex $one 1] + set title [lindex $one 2] + + set title [fs::remove_special_file_system_characters -string $title] + regsub {'} $title {\'} title + set title [string map { \{ \\{ \} \\} } $title ] + + upvar #$adp_level man_id man_id + set url "'[export_vars -base "record-view" \ + -url {item_id man_id}]'" + + if { $index < [expr $itemcount - 1] } { + # Get the tree level of the next item + set nextlevel [lindex [lindex $items [incr index]] 0] + + # Loop through each item until an item with a different + # level is encountered + if { $level == $nextlevel } { + # Another item in the same level, just add to the list + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" + lappend levelitems "\['$title', $url\]" + incr counter + } elseif { $level < $nextlevel } { + # Next item is a sub-item + set ocounter $counter + incr counter + set submenu "[generate_tree_menu $items $index [expr $rlevel + 1]]" + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $ocounter;" + + if { [llength $submenu] } { + # There's a submenu + lappend levelitems \ + "\['$title', $url,\n$submenu\n\]" + } else { + # Child is a lone leaf node, if so, it should have + # replace the url, the item_id and decremented counter + lappend levelitems \ + "\['$title', $url\]" + } + + # The index should have been adjusted by now to point + # to the next item, let's see if the next item has a + # lower level, if so, it's time to return + if { $index < $itemcount } { + set nextlevel [lindex [lindex $items $index] 0] + if { $level > $nextlevel } { + set localindex $index + return [join $levelitems ",\n"] + } + } + + } else { + # Next item has lower level + set localindex $index + + # If i'm alone in this level, there's really no point + # for my existence, i'll just give my URL to my parent + if { ![info exists levelitems] } { + upvar url my_url + upvar item_id my_item_id + set my_url $url + set my_item_id $item_id + + return [list] + } else { + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" + incr counter + return [join \ + [lappend levelitems \ + "\['$title', $url\]" + ] ",\n" + ] + } + } + } else { + # Terminator, end of the list + set localindex [expr $index + 1] + lappend TREE_HASH "TREE_HASH\[\"ims_id.$item_id\"\] = $counter;" + incr counter + return [join \ + [lappend levelitems \ + "\['$title', $url\]" + ] ",\n" + ] + } + } + + set localindex $index + return [join $levelitems ",\n"] +} + +# Counter starts at 1 coz Course Index isn't part of the list +db_foreach organizations { + select + org.org_id, + org.org_title as org_title, + org.hasmetadata, + tree_level(o.tree_sortkey) as indent + from + ims_cp_organizations org, acs_objects o + where + org.org_id = o.object_id + and + man_id = :man_id + order by + org_id +} { + if { $debuglevel == 1 } { ns_log debug "Menu found organization $org_title"} + + set indent [expr $indent +1] + + db_foreach sql { + SELECT + (tree_level(tree_sortkey) - :indent) as indent, + i.ims_item_id, + i.item_title as item_title + FROM + acs_objects o, ims_cp_items i + WHERE + o.object_type = 'ims_item_object' + AND + i.org_id = :org_id + AND + o.object_id = i.ims_item_id + + ORDER BY + o.object_id, tree_sortkey + } { + if { $debuglevel == 1 } {ns_log debug "Menu found item $ims_item_id $item_title"} + lappend js [list $indent $ims_item_id $item_title] + } +} + +if { [info exists js] } { + set index 0 + set TREE_ITEMS [generate_tree_menu $js $index 1] + set TREE_HASH [join $TREE_HASH "\n"] +} else { + if { $debuglevel == 1 } {ns_log warning "delivery-scorm::menu.tcl select is not giving back a MENU !!!!"} +} + +# return_url +set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] Index: openacs-4/packages/lorsm/www/delivery-scorm/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/record-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/record-view.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,128 @@ +# packages/lorsm/www/delivery4/record-view.tcl + +ad_page_contract { + + records a view for this ims_cp_item and redirects to its url + + @author Deds Castillo (deds@i-manila.com.ph) + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-04 + @arch-tag: a7aba567-c4c1-4f1c-b5f3-ebc1ab277515 + @cvs-id $Id: record-view.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { + item_id:notnull + man_id:notnull +} -properties { +} -validate { +} -errors { +} + + +set viewer_id [ad_conn user_id] + +set views [views::record_view -object_id $item_id -viewer_id $viewer_id] + +set ns_item_id $item_id +set revision_id $item_id + +set item_id [lorsm::delivery::get_item_id -revision_id $revision_id] + +set folder_id [lorsm::delivery::get_folder_id_from_man_id -man_id $man_id] +set lors_root [lorsm::get_root_folder_id] +set folder_name [lorsm::delivery::get_folder_name -folder_id $folder_id] +set content_root [lorsm::delivery::get_item_id_from_name_parent -name $folder_name -parent_id $lors_root] + +if {[empty_string_p $content_root]} { + # This was uploaded with lorsm so we use the folder_id from the table + set content_root [lorsm::delivery::get_folder_id_from_man_id -man_id $man_id] +} + + +set url2 $folder_name + +# Get the href of the item +set href [lorsm::delivery::get_href -ims_item_id $revision_id] + +# Get the item title +set item_title [lorsm::delivery::get_ims_item_title -ims_item_id $revision_id] + +set cr_item_id [lors::cr::get_item_id -folder_id $content_root -name $href] + + + +if { [empty_string_p $cr_item_id] } { + set res_id [lorsm::delivery::get_res_id -ims_item_id $revision_id] + if { ![empty_string_p $res_id] } { + set file_id [lorsm::delivery::get_file_id -res_id $res_id] + if { [empty_string_p $file_id]} { + set cr_item_id "" + } else { + set cr_item_id [lorsm::delivery::get_item_id -revision_id $file_id] + } + } else { + set cr_item_id "" + } +} + +# get already imported data (like an assessment) +# it normally points relatively to the correct location in some parent folder +if {[regexp {^\.\.} $href]} { + ad_returnredirect $href +} + +# If no cr_item_id, this item is probably a folder +# Else deliver the page + +if { ![empty_string_p $cr_item_id] } { + + # This is the revision of the file (html, jpg, etc) + set cr_revision_id [item::get_best_revision $cr_item_id] + set cr_item_mime [item::get_mime_info $cr_revision_id mime_info] + + + if { ![string equal -length 4 "text" $mime_info(mime_type)] } { + # It's a file. + ns_log debug "lorsm - (SCORM) record-view - TEXT - it's a file. should we get an error?" + cr_write_content -revision_id $cr_revision_id + ad_script_abort + + } else { + + set href "$url2/$href" + regsub -all {//} $href {/} href + set ims_item_id $cr_revision_id + + # lorsm::set_content_root content_root + lorsm::set_ims_item_id $item_id + + ns_log debug "lorsm - (SCORM) record-view - NOT TEXT - cr_item_id $cr_item_id item_id $item_id ims_item_id $ims_item_id revision_id $revision_id " + ad_set_client_property lorsm ims_id $revision_id + + # we use nsv variables to set the delivery environment this is a + # temporary solution until we find something a bit better + + if {[nsv_exists delivery_vars [ad_conn session_id]]} { + nsv_unset delivery_vars [ad_conn session_id] + } + + + nsv_set delivery_vars [ad_conn session_id] [list] + + nsv_lappend delivery_vars [ad_conn session_id] $content_root + ad_returnredirect [export_vars -base view/$href {ims_item_id} ] + ad_script_abort + } +} else { + lorsm::set_ims_item_id $item_id + + ns_log debug "lorsm - (SCORM) record-view - EMPTY CR_ITEM_ID - cr_item_id $cr_item_id item_id $item_id" + ad_set_client_property lorsm ims_id $item_id + + # We have no content, so wipe item_id from the lorsm namespace + # This fixes a strange bug if you click a 'no content' menu item + # repeatedly and different content appears! + if { [info exists lorsm::item_id] } { + set lorsm::item_id "" + } + rp_internal_redirect -absolute_path [acs_root_dir]/templates/lorsm-default +} Index: openacs-4/packages/lorsm/www/delivery-scorm/servlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/servlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/servlet.tcl 26 May 2005 21:13:32 -0000 1.1 @@ -0,0 +1,396 @@ +ad_page_contract { + + Main tcl procedures to handle colloquia with java rte applet + + @author Michele Slocovich (michele@sii.it) + @creation-date 2004-09-27 + @cvs-id $Id: servlet.tcl,v 1.1 2005/05/26 21:13:32 micheles Exp $ +} { + functionCalled:notnull + data:optional +} -properties { +} -validate { +} -errors { +} + +#set the following accordingly to Debug, Warning or Notice +set level "Debug" + +#try to circumvent browsers caching strategies +set s [ns_set new] +ns_set put $s "Pragma" "No-Cache" +ns_set put $s "Expires" "0" +ns_set move $s [ns_conn outputheaders] +ns_set move [ns_conn outputheaders] $s + +#fetching information +set user_id [ad_conn user_id] +acs_user::get -user_id $user_id -array user +set username $user(username) +set currentcourse [ad_get_client_property lorsm currentcourse] +#this is not used in this proc, so far + +set currentpage [ad_get_client_property lorsm ims_id] +# currentcourse is the package, currentpage is the item +# this is not working consistently set whichpage [lorsm::get_ims_item_id] +ns_log Notice "delivery-scorm::servlet username $username , currentcourse $currentcourse , currentpage $currentpage" + +if { ! ($currentpage>0) } { + ns_log warning "lorsm - ERROR SESSION lorsm ims_id returned is $currentpage" + set currentpage 0 +} +ns_log $level "lorsm - currentpage $currentpage " + +ns_log $level "lorsm - beginning transaction for user: $user_id course: $currentcourse page (ims_item_id): $currentpage" + +if { $user_id == 0 } { + #_return 303 text/plain "101" + ns_return 504 text/plain "Error=101,ErrorDescription=\"Not logged in\"" +} +if { $currentcourse == "" } { + ns_return 504 text/plain "Error=102,ErrorDescription=\"No current course (how did you get here?)\"" +} +if { ! [info exists functionCalled] } { + ns_return 504 text/plain "Error=104,ErrorDescription=\"No function specified\"" +} + +set currenttrackid [ad_get_client_property lorsm currenttrackid] +set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] + +set community_id [dotlrn_community::get_community_id] +set package_id [ad_conn package_id] + +ns_log $level "Applet beginning with parameters current: $currenttrackid lorsm - $lorsmstudenttrack community: $community_id" + +ad_get_user_info +set name $last_name +#seems ADL wants a comma between lastname and christian +append name ", " +append name $first_names + +switch -regexp $functionCalled { + null - + cmigetcat + { + ns_log $level "lorsm - serving LMSInitialize from applet" + if { $lorsmstudenttrack == 0 || $lorsmstudenttrack == "" } { + ns_log $level "lorsm - called with no track id for current session (istrackable is off): try to fetch one" + #here track id was not set (course is not lors-trackable) + #we should first try to see if we find an already open track in lorsm.track + if { ! [ db_0or1row isanysuspendedsession " + select lorsm.track_id as track_id from lorsm_student_track lorsm, lorsm_cmi_core cmi + where + lorsm.user_id = $user_id + and + lorsm.community_id = $community_id + and + lorsm.course_id = $currentcourse + and + lorsm.track_id = cmi.track_id + and + not ( + cmi.lesson_status = 'completed' + or + cmi.lesson_status = 'passed' + ) + and + cmi.man_id = $currentcourse + and + cmi.item_id = $currentpage + order by + lorsm.track_id desc + limit 1 + " ] } { #faccio un nuovo trackid + #we create a new track which is going to be the new 'master track' for this cmi data set + set currenttrackid [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $currentcourse] + ad_set_client_property lorsm studenttrack $currenttrackid + ns_log $level "lorsm - Tracking has generated a lorsm_student_track new track id: $currenttrackid" + } else { + ns_log $level "lorsm - Tracking has not found a lorsm_cmi_core track with a non completed nor passed session." + set currenttrackid $track_id + set lorsmstudenttrack [lorsm::track::new \ + -user_id $user_id \ + -community_id $community_id \ + -course_id $currentcourse] + ns_log $level "lorsm - Tracking has in any case created a lorsm_student_tracking track_id: $lorsmstudenttrack" + ad_set_client_property lorsm studenttrack $lorsmstudenttrack + } + } else { + ns_log $level "lorsm - called with track id for current session (=$lorsmstudenttrack) (istrackable is on): going to check whether to create a lorsm_cmi_core new track" + #now we look for the existance of a lorsm.cmi.core track id for this user / course / class which is still not completed + if { ! [ db_0or1row isanysuspendedsession " + select lorsm.track_id as track_id from lorsm_student_track lorsm, lorsm_cmi_core cmi + where + lorsm.user_id = $user_id + and + lorsm.community_id = $community_id + and + lorsm.course_id = $currentcourse + and + lorsm.track_id = cmi.track_id + and + not ( + cmi.lesson_status = 'completed' + or + cmi.lesson_status = 'passed' + ) + and + cmi.man_id = $currentcourse + and + cmi.item_id = $currentpage + order by + lorsm.track_id desc + limit 1 + " ] } { + set currenttrackid $lorsmstudenttrack + } else { + set currenttrackid $track_id + } + } + #in any case at this stage track_id is currentely set to the value it should have in lorsm_cmi_core (disregarding if we have still to create it) + + if { ! [ db_0or1row istherealready "select * from lorsm_cmi_core where track_id = :currenttrackid "]} { + ns_log $level "lorsm - Inserting track id in lorsm_cmi_core: value will be $currenttrackid" + ns_log $level "lorsm - I now have a track_id=$currenttrackid but i cannot find no corresponding record in lorsm_cmi_core " + #get initialization data from manifest data already imported + if { [ db_0or1row get_adlcp_student_data { select datafromlms,maxtimeallowed,timelimitaction,masteryscore from ims_cp_items where ims_item_id=:currentpage; } ] } { + ns_log $level "lorsm - data for lorsm_cmi_student_data is $datafromlms, $maxtimeallowed, $timelimitaction, $masteryscore" + } else { + ns_log warning "lorsm - COULD NOT RETRIEVE DATA FROM LORSM_CMI_STUDENT_DATA from IMS_CP_ITEMS possibily ims_item_id should be $currentpage" + } + + # + db_dml lmsinitialize { insert into lorsm_cmi_core(track_id,man_id,item_id,student_id,student_name,lesson_location, + lesson_status, + launch_data, + comments,comments_from_lms, session_time, total_time, time_stamp) + values(:currenttrackid,:currentcourse,:currentpage,:username,:name,:currentcourse, + 'not attempted', + :datafromlms, + '','commenti da lors',0,0,CURRENT_TIMESTAMP) } + db_dml lmsinitialize { insert into lorsm_cmi_student_data(track_id,student_id,max_time_allowed,time_limit_action,mastery_score) + values(:currenttrackid,:username,:maxtimeallowed,:timelimitaction,:masteryscore) + } + ad_set_client_property lorsm currenttrackid $currenttrackid + db_1row istherealready "select * from lorsm_cmi_core where track_id = :currenttrackid" + + #AURALOG HACK + #adjust on a per-server basis + if { $currentcourse == 11287 } { + set student_id "testscorm711" + } + set returndata "cmi.core.student_id=$student_id,cmi.core.student_name=$name," + append returndata "cmi.core.lesson_status=$lesson_status,cmi.core.credit=credit,cmi.core.entry=ab-initio," + append returndata "cmi.core.lesson_mode=normal," + append returndata "cmi.student_preference.language=italian,cmi.comments=$comments,cmi.comments_from_lms=$comments_from_lms" + append returndata ",cmi.suspend_data=$suspend_data,cmi.launch_data=$launch_data" + append returndata ",cmi.student_data.max_time_allowed=$maxtimeallowed,cmi.student_data.time_limit_action=$timelimitaction" + append returndata ",cmi.student_data.mastery_score=$masteryscore" + } else { + ad_set_client_property lorsm currenttrackid $currenttrackid + #retrieve data other than core + db_0or1row get_adlcp_student_data { select max_time_allowed,time_limit_action,mastery_score from lorsm_cmi_student_data where track_id=:currenttrackid; } + # + ns_log $level "lorsm - retrieved track id in lorsm_cmi_core: $currenttrackid" + # summing up session time to total_time + set total_time [expr $total_time + $session_time] + set total_time_ms [expr $total_time_ms + $session_time_ms] + set session_time 0 + set session_time_ms 0 + if { $total_time_ms > 100 } { set total_time_ms [expr $total_time_ms - 100] + set total_time [expr $total_time +1 ] + } + # erasing session time from server and updating current total time + set todo "UPDATE lorsm_cmi_core SET total_time = '$total_time" + append todo "', total_time_ms ='$total_time_ms' " + append todo " WHERE track_id=:currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + #ns_log $level "lorsm - time processing UPDATE: '$todo' successfull" + } else { + ns_log Warning "lorsm - time processing UPDATE: '$todo' not successfull -> please check" + } + set todo "UPDATE lorsm_cmi_core SET session_time = '0" + append todo "', session_time_ms ='0' " + append todo " WHERE track_id=:currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + #ns_log $level "lorsm - data processing UPDATE: '$todo' successfull" + } else { + ns_log Warning "lorsm - time processing UPDATE: '$todo' not successfull -> please check" + } + #AURALOG HACK + #adjust on a per-server basis + if { $currentcourse == 11287 } { + set student_id "testscorm711" + } + set returndata "cmi.core.student_id=$student_id,cmi.core.student_name=$name," + append returndata "cmi.core.credit=$credit,cmi.core.lesson_status=$lesson_status,cmi.core.entry=$entry," + append returndata "cmi.core.lesson_mode=normal,cmi.core.lesson_location=$lesson_location," + append returndata "cmi.student_preference.language=italian,cmi.comments=$comments,cmi.comments_from_lms=$comments_from_lms" + append returndata ",cmi.suspend_data=$suspend_data,cmi.launch_data=$launch_data" + append returndata ",cmi.student_data.max_time_allowed=$max_time_allowed,cmi.student_data.time_limit_action=$time_limit_action" + append returndata ",cmi.student_data.mastery_score=$mastery_score" + } + # AURALOG HACK + + + #treating time from table back to system (lorsm.cmi.time fields are showing just seconds) + set prefix "0" + set hours [expr int ($session_time/3600) ] + set minutes [expr int (($session_time - (3600*$hours)) / 60) ] + set seconds [expr int (($session_time - (3600*$hours)-$minutes*60)) ] + if { [ string length $hours ] == 1 } { set hours "$prefix$hours" } + if { [ string length $minutes] == 1 } { set minutes 0$minutes } + if { [ string length $seconds] == 1 } { set seconds 0$seconds} + #set session_time "$hours:$minutes:$seconds.00" + set session_time "$hours:$minutes:$seconds" + if { ! [empty_string_p $session_time_ms] } { append session_time ".$session_time_ms" } + set hours [expr int ($total_time/3600) ] + set minutes [expr int (($total_time - (3600*$hours)) / 60) ] + set seconds [expr int (($total_time - (3600*$hours)-$minutes*60)) ] + if { [ string length $hours ] == 1 } { set hours "$prefix$hours" } + if { [ string length $minutes] == 1 } { set minutes 0$minutes } + if { [ string length $seconds] == 1 } { set seconds 0$seconds} + #set total_time "$hours:$minutes:$seconds.00" + set total_time "$hours:$minutes:$seconds" + if { ! [empty_string_p $total_time_ms] } { append total_time ".$total_time_ms" } + #appending time fields to return string + append returndata ",cmi.core.session_time=$session_time,cmi.core.total_time=$total_time" + ns_log $level "lorsm - passing data back to applet : $returndata" + + ns_return 200 text/plain "$returndata" + } + + cmiputcat* + { + ns_log $level "lorsm - serving LMSCOMMIT or LMSFINISH from applet" + ns_log $level "lorsm - received data $data from applet: processing. Reference cmi track is $currenttrackid, while lorsmstudenttrack is: $lorsmstudenttrack" + set preparselist [lrange [ split $data "," ] 1 end] + set lista [list] + set value "" + #here we build a list of request=value. we must do some pattern matching + foreach couple $preparselist { + if { [ regexp ^cmi\.* $couple ] } { + if { ! [empty_string_p $value] } { + set value [concat [lindex $lista end],$value] + ns_log $level "lorsm - PARSER ending recomposing $value " + set lista [lreplace $lista end end $value] + set value "" + } else { + ns_log $level "lorsm - PARSER full couple $couple " + lappend lista $couple + } + } else { + ns_log $level "lorsm - PARSER partial couple $couple " + set value [concat $value,$couple] + ns_log $level "lorsm - PARSER partial couple $couple " + } + } + if { ! [empty_string_p $value] } { + set value [concat [lindex $lista end],$value] + ns_log $level "lorsm - PARSER ending recomposing $value " + set lista [lreplace $lista end end $value] + set value "" + } + #end splitting + foreach couple $lista { + set all "" + set request "" + set value "" + #create list named item to contain request and value + regexp \(\[^=\]+\)=\(\.*\)$ $couple all request value + #set request "cmi.$request" + ns_log $level "lorsm - request from applet is $all that is $request to $value" + #set request [lindex $item 0] + #set value [lindex $item 1] + if { [ string length $value ] == 0 } { + ns_log Warning "lorsm - EMPTY settings : '$request' received and empty -> treating this applet anyway" + } + #else { + set table [lindex [split $request .] 1] + set column [string trim [lindex [split $request .] 2]] + switch $table { + null - + "" { + ns_log Warning "lorsm - EMPTY TABLENAME : '$table', '$column' not implemented -> not treating this applet request" + } + core { + if { [ string compare "total_time" $column ] } { + # time fields get a separate treatment + if { [ string first "time" $column ] >0 } { + # conversion of HHHH:MM:SS.SS + # removing leading zeros: + # 'regsub {^0*((1-90-9*)|0)$} $x {\1} x' + regsub {^0} [lindex [split $value :] 0] "" hours + regsub {^0} [lindex [split $value :] 1] "" minutes + regsub {^0} [lindex [split $value :] 2] "" seconds + regsub {^0} [lindex [split $value .] 1] "" msecs + if { [empty_string_p $msecs] } { + set msecs 0 + } + set column_ms $column + append column_ms "_ms" + set todo "UPDATE lorsm_cmi_$table SET $column_ms = '" + append todo $msecs + append todo "' WHERE track_id=:currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + ns_log $level "lorsm - data msecs processing UPDATE: '$todo' successfull" + } else { + ns_log Warning "lorsm - data msecs processing UPDATE: '$todo' not successfull -> please check" + } + #set minutes [string trim [lindex [split $value :] 1]] + #set seconds [string trim [lindex [split $value :] 2]] + set value [expr int (( $hours*60 + $minutes ) * 60 + $seconds) ] + } + set todo "UPDATE lorsm_cmi_$table SET $column = '" + append todo $value + append todo "' WHERE track_id=:currenttrackid" + db_dml todo $todo + if { [db_resultrows] == 1 } { + ns_log $level "lorsm - data processing UPDATE: '$todo' successfull" + } else { + ns_log Warning "lorsm - data processing UPDATE: '$todo' not successfull -> please check" + } + } + } + default { + ns_log Warning "lorsm - table: '$table', '$column' not implemented -> not treating this applet request" + } + } + #} this was the if for empty value setting requests + } + switch $functionCalled { + cmiputcat { + #We try setting track exit so that we keep some exit time + #even if user closes the course without passing by FINISH + if { $lorsmstudenttrack == "" || $lorsmstudenttrack == 0 } { + lorsm::track::exit -track_id $currenttrackid } else { + #speficic for courses for which istrackable is on + lorsm::track::exit -track_id $lorsmstudenttrack } + ns_log $level "lorsm - post LMSCommit (trackid=$currenttrackid)" + ns_return 200 text/plain "OK" + } + cmiputcatONFINISH { + set lorsmstudenttrack [ad_get_client_property lorsm studenttrack] + ad_set_client_property lorsm studenttrack "" + ad_set_client_property lorsm currenttrackid "" + if { $lorsmstudenttrack == "" || $lorsmstudenttrack == 0 } { + lorsm::track::exit -track_id $currenttrackid } else { + #speficic for courses for which istrackable is on + lorsm::track::exit -track_id $lorsmstudenttrack } + ns_return 200 text/plain "OK" + ns_log $level "lorsm - post LMSFinish (trackid=$currenttrackid) sent ok to applet" + } + } + } + default + { + ns_return 504 text/plain "Error=103,ErrorDescription=\"No functionCalled meaningful value provided\"" + } +} +ns_log $level "lorsm - RTE process ending" Index: openacs-4/packages/lorsm/www/delivery-scorm/stuff.jar =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/stuff.jar,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/Images/leaf.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/Images/leaf.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/Images/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/Images/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/Images/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/Images/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/index.html 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,275 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + + + + + + + + + + + +
Tigra Tree MenuSoftcomplex logo
+ + | About Us  + | Services  + | Download  + | Order  + | Support  + | + +
+ + + +
+ + + + + + + + + + + + + + +
ProductsTigra Tree Menu v1.1 - Welcome Page
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Client Side Products
+ Tigra Menu
+ Tigra Menu PRO
+ Tigra Menu GOLD
+ Tigra Tree Menu
+ Tigra Tree Menu PRO
+ Tigra Calendar
+ Tigra Calendar PRO
+ Tigra Scroller
+ Tigra Scroller PRO
+ Tigra Color Picker
+ Tigra Hints
+ Tigra Tables
+ Tigra Tables PRO
+ Tigra Calculator
+ Tigra Calculator PRO
+ Tigra Form Validator
+ Tigra Form Validator PRO
+
Server Side Products
+ PHP Image Gallery
+ PHP Event Calendar
+ Apache Easy Debug
+
Online Services
+ Tigra Menu Online Builder
+
Win32 Applications
+ Tigra Menu Builder Win32
+
ActiveX Components
+ ASP Upload Component
+ ASP Mail Component
+ ASP Zip Component
+
+
+ + + + + +
Sample:
+ +
+
+ + + + + + + + + + +
Welcome

Thank You for downloading Tigra Tree Menu, You've made the right decision!

Overview
+

Tigra Tree Menu is a free JavaScript DHTML navigation system for web sites and web applications. Product looks and acts exactly as Microsoft Windows Tree Control. Offering the best performance on the market, script can manage hierarchies containing thousands of items.

+
Features
+
    +
  • unlimited tree menu depth +
  • unlimited number of tree menus on single page all independently configurable +
  • easy items text styles setup +
  • any icons set can be used +
  • low weight (~5KB) +
  • highly optimized code guarantees incredible performance (good results on trees containing 10,000+ items) +
  • can be used either inline or with frames +
  • future browser's versions ready +
  • simple configuration file structure, easy to generate dynamically from database +
  • items configuration file format is compatible with Tigra Menu and can be generated with Tigra Menu Online Builder +
  • object oriented JavaScript implementation for those who want to learn DHTML programming +
  • best choice for site maps, online documentation and intranet applications +
+
+
+ + + + + + + + + + + + + + + +
Compatibility Table
+

Note: As any other javascript component Tigra Tree Menu requires JavaScript and CSS support enabled in the browser.
Here is a table of the script's compatibility:
+
+
+ + + + + + + + + + + + + + + + + + + +
PlatformBrowser
MS IENetscape
Windows 95/98/ME/2000/XP4.0+6.2
Mac OS 8/9/X5.27.0+
+

If you look for wider browsers support then consider upgrading to Tigra Tree Menu PRO

+
Support Materials
+
    +
  • Demos - included in the distribution package to get started instantly +
  • Documentation - available online for quick references +
  • Forum - great place to discuss your challenges with other users +
+
Additional Services
+
    +
  • Need some feature not in the list? +
  • Need the programming task finished yesterday? +
  • Find all this programming stuff too complicated? +
  • Got some improvement idea for your site? +
+ Contact us with customization request. +
Support Tigra Tree Menu
+ Please, support this amazing free JavaScript Navigation system by submitting your vote: +
+ HotScripts.com : +   +
+ +
+ ScriptSearch.com : +   +
+
+
+
+ + + + + + + + +
Copyright ©2004 SoftComplex Inc. All rights reserved. + | company info + | terms of service + | privacy policy + | +
+ + + + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/logo.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,133 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree (a_items, a_template) { + + this.a_tpl = a_template; + this.a_config = a_items; + this.o_root = this; + this.a_index = []; + this.o_selected = null; + this.n_depth = -1; + + var o_icone = new Image(), + o_iconl = new Image(); + o_icone.src = a_template['icon_e']; + o_iconl.src = a_template['icon_l']; + a_template['im_e'] = o_icone; + a_template['im_l'] = o_iconl; + for (var i = 0; i < 64; i++) + if (a_template['icon_' + i]) { + var o_icon = new Image(); + a_template['im_' + i] = o_icon; + o_icon.src = a_template['icon_' + i]; + } + + this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) }; + this.select = function (n_id) { return this.a_index[n_id].select(); }; + this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; + this.mover = function (n_id) { this.a_index[n_id].upstatus() }; + + this.a_children = []; + for (var i = 0; i < a_items.length; i++) + new tree_item(this, i); + + this.n_id = trees.length; + trees[this.n_id] = this; + + for (var i = 0; i < this.a_children.length; i++) { + document.write(this.a_children[i].init()); + this.a_children[i].open(); + } +} + +function tree_item (o_parent, n_order) { + + this.n_depth = o_parent.n_depth + 1; + this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)]; + if (!this.a_config) return; + + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + this.b_opened = !this.n_depth; + + this.n_id = this.o_root.a_index.length; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + this.a_children = []; + for (var i = 0; i < this.a_config.length - 2; i++) + new tree_item(this, i); + + this.get_icon = item_get_icon; + this.open = item_open; + this.select = item_select; + this.init = item_init; + this.upstatus = item_upstatus; + this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; +} + +function item_open (b_close) { + var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); + if (!o_idiv) return; + + if (!o_idiv.innerHTML) { + var a_children = []; + for (var i = 0; i < this.a_children.length; i++) + a_children[i]= this.a_children[i].init(); + o_idiv.innerHTML = a_children.join(''); + } + o_idiv.style.display = (b_close ? 'none' : 'block'); + + this.b_opened = !b_close; + var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], + o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_jicon) o_jicon.src = this.get_icon(true); + if (o_iicon) o_iicon.src = this.get_icon(); + this.upstatus(); +} + +function item_select (b_deselect) { + if (!b_deselect) { + var o_olditem = this.o_root.o_selected; + this.o_root.o_selected = this; + if (o_olditem) o_olditem.select(true); + } + var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_iicon) o_iicon.src = this.get_icon(); + get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.color = b_deselect ? '#FFFFFF' : '#FFFF00'; + + this.upstatus(); + return Boolean(this.a_config[1]); +} + +function item_upstatus (b_clear) { + window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10); +} + +function item_init () { + var a_offset = [], + o_current_item = this.o_parent; + for (var i = this.n_depth; i > 1; i--) { + a_offset[i] = ''; + o_current_item = o_current_item.o_parent; + } + return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + '' + this.a_config[0] + '
' + (this.a_children.length ? '' : ''); +} + +function item_get_icon (b_junction) { + return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))]; +} + +var trees = []; +get_element = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree_items.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree_items.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree_items.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,106 @@ + +var TREE_ITEMS = [ + ['Home', 'http://www.softcomplex.com/', + ['Products', 'http://www.softcomplex.com/download.html', + ['Server Side Components', 'http://www.softcomplex.com/download.html#server_side', + ['PHP Event Calendar', 'http://www.softcomplex.com/products/php_event_calendar/'], + ['Advanced Web Security', null], + ['SC Object Environment', null], + ], + ['Client Side Components', 'http://www.softcomplex.com/download.html#client_side', + ['Tigra Menu', 'http://www.softcomplex.com/products/tigra_menu/', + ['Home Page', 'http://www.softcomplex.com/products/tigra_menu/'], + ['Documentation', 'http://www.softcomplex.com/products/tigra_menu/docs/'], + ['Online Builder', 'http://www.softcomplex.com/products/tigra_menu/builder/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=29'], + ], + ['Tigra Menu PRO', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_menu_pro/'], + ['Documentation', 'http://www.softcomplex.com/products/tigra_menu_pro/documentation/', + ['Documentation', 'http://www.softcomplex.com/products/tigra_menu_pro/documentation/'], + ['Frequently Asked Questions', 'http://www.softcomplex.com/products/tigra_menu_pro/documentation/faq.html'], + ['Terms and Conditions', 'http://www.softcomplex.com/products/tigra_menu_pro/documentation/terms_cond.html'], + ], + ['Online Builder', 'http://www.softcomplex.com/products/tigra_menu/builder/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=29'], + ['Order Form', 'https://secure.element5.com/shareit/checkout.html?productid=153541'], + ['Support Request', 'http://www.softcomplex.com/support.html'], + ], + ['Tigra Menu GOLD', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_menu_pro/'], + ['Documentation', 'http://www.softcomplex.com/products/tigra_menu_gold/docs/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=51'], + ['Order Form', 'https://secure.element5.com/shareit/checkout.html?productid=169414'], + ['Support Request', 'http://www.softcomplex.com/support.html'], + ], + ['Tigra Tree Menu', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_tree_menu/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=31'], + ], + ['Tigra Calendar', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_calendar/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=30'], + ], + ['Tigra Calendar PRO', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_calendar_pro/'], + ['Order Form', 'https://secure.element5.com/shareit/checkout.html?productid=159443'], + ['Support Request', 'http://www.softcomplex.com/support.html'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=30'], + ], + ['Tigra Scroller', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_scroller/'], + ['Documentation', 'http://www.softcomplex.com/products/tigra_scroller/docs/'], + ['Demo #1', 'http://www.softcomplex.com/products/tigra_scroller/demo1.html'], + ['Demo #2', 'http://www.softcomplex.com/products/tigra_scroller/demo2.html'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=49'], + ], + ['Tigra Scroller PRO', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_scroller_pro/'], + ['Documentation', 'http://www.softcomplex.com/products/tigra_scroller_pro/docs/'], + ['Demo #1', 'http://www.softcomplex.com/products/tigra_scroller_pro/demo1.html'], + ['Demo #2', 'http://www.softcomplex.com/products/tigra_scroller_pro/demo2.html'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=50'], + ['Order Form', 'https://secure.element5.com/shareit/checkout.html?productid=167102'], + ['Support Request', 'http://www.softcomplex.com/support.html'], + ], + ['Tigra Tables', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_tables/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=32'], + ], + ['Tigra Tables PRO', null, + ['Home Page', 'http://www.softcomplex.com/products/tigra_tables_pro/'], + ['Documentation', 'http://www.softcomplex.com/products/tigra_tables_pro/docs/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=32'], + ['Order Form', 'https://secure.element5.com/shareit/checkout.html?productid=163419'], + ['Support Request', 'http://www.softcomplex.com/support.html'], + ], + ], + ['Online Services', 'http://www.softcomplex.com/download.html#online_services', + ['Tigra Menu Online Builder', null, + ['Login Page', 'http://www.softcomplex.com/products/tigra_menu/builder/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=33'], + ['Help Pages', null, + ['Horizontal Menu', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_horizontal_menu'], + ['Vertical Menu', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_vertical_menu'], + ['Item Path', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_path'], + ['Caption', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_caption'], + ['Link', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_link'], + ['Item Size', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_size'], + ['Block Offset', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_boffset'], + ['Saving Files', 'http://www.softcomplex.com/cgi-bin/builder/mgr.pl?class=static_page&action=view&tpl=help_save'], + ], + ], + ], + ['ActiveX Components', 'http://www.softcomplex.com/download.html#activex_components', + ['ASP Upload Component', null, + ['Home Page', 'http://www.softcomplex.com/products/asp_upload_component/'], + ['Documentation', 'http://www.softcomplex.com/products/asp_upload_component/docs/'], + ['Forum', 'http://www.softcomplex.com/forum/forumdisplay.php?fid=35'], + ], + ] + ], + ['Services', 'http://www.softcomplex.com/services.html'], + ['Contacts', 'http://www.softcomplex.com/support.html'], + ] +]; + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/tree_tpl.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,36 @@ +/* + Feel free to use your custom icons for the tree. Make sure they are all of the same size. + User icons collections are welcome, we'll publish them giving all regards. +*/ + +var tree_tpl = { + 'target' : '_blank', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : 'demo1/icons/empty.gif', // empty image + 'icon_l' : 'demo1/icons/line.gif', // vertical line + + 'icon_32' : 'demo1/icons/base.gif', // root leaf icon normal + 'icon_36' : 'demo1/icons/base.gif', // root leaf icon selected + + 'icon_48' : 'demo1/icons/base.gif', // root icon normal + 'icon_52' : 'demo1/icons/base.gif', // root icon selected + 'icon_56' : 'demo1/icons/base.gif', // root icon opened + 'icon_60' : 'demo1/icons/base.gif', // root icon selected + + 'icon_16' : 'demo1/icons/folder.gif', // node icon normal + 'icon_20' : 'demo1/icons/folderopen.gif', // node icon selected + 'icon_24' : 'demo1/icons/folderopen.gif', // node icon opened + 'icon_28' : 'demo1/icons/folderopen.gif', // node icon selected opened + + 'icon_0' : 'demo1/icons/page.gif', // leaf icon normal + 'icon_4' : 'demo1/icons/page.gif', // leaf icon selected + + 'icon_2' : 'demo1/icons/joinbottom.gif', // junction for leaf + 'icon_3' : 'demo1/icons/join.gif', // junction for last leaf + 'icon_18' : 'demo1/icons/plusbottom.gif', // junction for closed node + 'icon_19' : 'demo1/icons/plus.gif', // junctioin for last closed node + 'icon_26' : 'demo1/icons/minusbottom.gif',// junction for opened node + 'icon_27' : 'demo1/icons/minus.gif' // junctioin for last opended node +}; + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/ttm.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/ttm.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/compressed/readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/compressed/readme.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/compressed/readme.txt 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,12 @@ +Use tree.js file from this directory instead of +that provided in the demos if you wish to speed +up site download and reduce network traffic +consumption. + +Regular version of tree.js: ~5KB +Compressed version of menu.js: ~3KB + +Don't remove product information block from tree.js +This is not allowed. If you modified the script or +if you wish to add your comments then put them after +product information block. Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/compressed/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/compressed/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/compressed/tree.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,8 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 (size optimized) +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree(tm0,tm1){this.tm2=tm1;this.tm3=tm0;this.tm4=this;this.tm5=[];this.tm6=null;this.tm7=-1;var tm8=new Image(),tm9=new Image();tm8.src=tm1['icon_e'];tm9.src=tm1['icon_l'];tm1['im_e']=tm8;tm1['im_l']=tm9;for(var i=0;i<64;i++)if(tm1['icon_'+i]){var tmA=new Image();tm1['im_'+i]=tmA;tmA.src=tm1['icon_'+i]}this.tmB=function(tmC){var tmD=this.tm5[tmC];tmD.tmE(tmD.tmF)};this.tmG=function(tmC){return this.tm5[tmC].tmG()};this.tmH=function(tmC){this.tm5[tmC].tmI(true)};this.tmJ=function(tmC){this.tm5[tmC].tmI()};this.tmK=[];for(var i=0;i1;i--){tme[i]='';tmf=tmf.tmN}return '
'+(this.tm7?tme.join('')+(this.tmK.length?'':''):'')+''+this.tm3[0]+'
'+(this.tmK.length?'':'')}function tmQ(tmg){return this.tm4.tm2['icon_'+((this.tm7?0:32)+(this.tmK.length?16:0)+(this.tmK.length&&this.tmF?8:0)+(!tmg&&this.tm4.tm6==this?4:0)+(tmg?2:0)+(tmg&&this.tmV()?1:0))]}var trees=[];tmY=document.all?function(tmh){return document.all[tmh]}:function(tmh){return document.getElementById(tmh)}; \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/footer.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/footer.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/footer.html 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,28 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + +
Copyright ©2004 SoftComplex Inc. All rights reserved. + | company info + | terms of service + | privacy policy + | +
+ + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/header.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/header.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/header.html 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,52 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + + + + + + +
Tigra Tree MenuSoftcomplex logo
+ + | About Us  + | Services  + | Download  + | Order  + | Support  + | + +
+ + + + + + + + + + +
Tigra Tree Menu - Demo #1 (Frames Targeting)
+ + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/index.html 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,21 @@ + + + JavaScript Tree Menu - Demo #1 (Frames Targeting) + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/links.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/links.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/links.html 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,57 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + + + + + + + + + + + +
Notes
+ In the center frame you can see Tigra Tree Menu instance. + Click on tree items to see frames targeting in action. +
Advantages
+

Flexibility and usability - You can make navigation tree look exactly as your application requires using configuration settings provided. With minimum programming efforts component can be attached to dynamic data sources such as database or file system.

+

Performance and robustness - Tigra Tree Menu is highly optimized JavaScript component that efficiently utilizes resources of the browser. The product is designed to smoothly operate hierarchies containing thousands of items. Configuration files with low formatting overhead save network traffic and guarantee fast download times. Nevertheless you can reach even more efficiency using size optimized version provided within the download package

+

Saves time and budget - The script saves time, funds and efforts at all stages of the web application development: you get the component that does what you need for free, with tons of illustrated support materials you start using tree menu instantly, you efficiently and comfortably maintain navigation component, you easily adopt script as your requirements grow. +

Links
+ + + +
+ + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/logo.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/pixel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/pixel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree.html 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,34 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + + + + + + +
+ +
+ + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,132 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree (a_items, a_template) { + + this.a_tpl = a_template; + this.a_config = a_items; + this.o_root = this; + this.a_index = []; + this.o_selected = null; + this.n_depth = -1; + + var o_icone = new Image(), + o_iconl = new Image(); + o_icone.src = a_template['icon_e']; + o_iconl.src = a_template['icon_l']; + a_template['im_e'] = o_icone; + a_template['im_l'] = o_iconl; + for (var i = 0; i < 64; i++) + if (a_template['icon_' + i]) { + var o_icon = new Image(); + a_template['im_' + i] = o_icon; + o_icon.src = a_template['icon_' + i]; + } + + this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) }; + this.select = function (n_id) { return this.a_index[n_id].select(); }; + this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; + this.mover = function (n_id) { this.a_index[n_id].upstatus() }; + + this.a_children = []; + for (var i = 0; i < a_items.length; i++) + new tree_item(this, i); + + this.n_id = trees.length; + trees[this.n_id] = this; + + for (var i = 0; i < this.a_children.length; i++) { + document.write(this.a_children[i].init()); + this.a_children[i].open(); + } +} +function tree_item (o_parent, n_order) { + + this.n_depth = o_parent.n_depth + 1; + this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)]; + if (!this.a_config) return; + + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + this.b_opened = !this.n_depth; + + this.n_id = this.o_root.a_index.length; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + this.a_children = []; + for (var i = 0; i < this.a_config.length - 2; i++) + new tree_item(this, i); + + this.get_icon = item_get_icon; + this.open = item_open; + this.select = item_select; + this.init = item_init; + this.upstatus = item_upstatus; + this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; +} + +function item_open (b_close) { + var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); + if (!o_idiv) return; + + if (!o_idiv.innerHTML) { + var a_children = []; + for (var i = 0; i < this.a_children.length; i++) + a_children[i]= this.a_children[i].init(); + o_idiv.innerHTML = a_children.join(''); + } + o_idiv.style.display = (b_close ? 'none' : 'block'); + + this.b_opened = !b_close; + var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], + o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_jicon) o_jicon.src = this.get_icon(true); + if (o_iicon) o_iicon.src = this.get_icon(); + this.upstatus(); +} + +function item_select (b_deselect) { + if (!b_deselect) { + var o_olditem = this.o_root.o_selected; + this.o_root.o_selected = this; + if (o_olditem) o_olditem.select(true); + } + var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_iicon) o_iicon.src = this.get_icon(); + get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold'; + + this.upstatus(); + return Boolean(this.a_config[1]); +} + +function item_upstatus (b_clear) { + window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10); +} + +function item_init () { + var a_offset = [], + o_current_item = this.o_parent; + for (var i = this.n_depth; i > 1; i--) { + a_offset[i] = ''; + o_current_item = o_current_item.o_parent; + } + return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + '' + this.a_config[0] + '
' + (this.a_children.length ? '' : ''); +} + +function item_get_icon (b_junction) { + return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))]; +} + +var trees = []; +get_element = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree_items.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree_items.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree_items.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,17 @@ +var TREE_ITEMS = [ + ['Home', 'http://www.softcomplex.com/index.html', + ['Services', 'http://www.softcomplex.com/services.html'], + ['Download', 'http://www.softcomplex.com/download.html'], + ['Order', 'http://www.softcomplex.com/order.html'], + ['Support', 'http://www.softcomplex.com/support.html'], + ], + ['Level 0 Item 1', null, + ['Level 1 Item 0', 'links.html'], + ['Level 1 Item 1', 0, + ['Level 2 Item 0'], + ['Level 2 Item 1', 0], + ], + ['Level 1 Item 2'], + ['Level 1 Item 3'], + ] +]; \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/tree_tpl.js 26 May 2005 21:13:33 -0000 1.1 @@ -0,0 +1,36 @@ +/* + Feel free to use your custom icons for the tree. Make sure they are all of the same size. + User icons collections are welcome, we'll publish them giving all regards. +*/ + +var TREE_TPL = { + 'target' : 'frameset', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : 'icons/empty.gif', // empty image + 'icon_l' : 'icons/line.gif', // vertical line + + 'icon_32' : 'icons/base.gif', // root leaf icon normal + 'icon_36' : 'icons/base.gif', // root leaf icon selected + + 'icon_48' : 'icons/base.gif', // root icon normal + 'icon_52' : 'icons/base.gif', // root icon selected + 'icon_56' : 'icons/base.gif', // root icon opened + 'icon_60' : 'icons/base.gif', // root icon selected + + 'icon_16' : 'icons/folder.gif', // node icon normal + 'icon_20' : 'icons/folderopen.gif', // node icon selected + 'icon_24' : 'icons/folderopen.gif', // node icon opened + 'icon_28' : 'icons/folderopen.gif', // node icon selected opened + + 'icon_0' : 'icons/page.gif', // leaf icon normal + 'icon_4' : 'icons/page.gif', // leaf icon selected + + 'icon_2' : 'icons/joinbottom.gif', // junction for leaf + 'icon_3' : 'icons/join.gif', // junction for last leaf + 'icon_18' : 'icons/plusbottom.gif', // junction for closed node + 'icon_19' : 'icons/plus.gif', // junctioin for last closed node + 'icon_26' : 'icons/minusbottom.gif',// junction for opened node + 'icon_27' : 'icons/minus.gif' // junctioin for last opended node +}; + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/ttm.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/ttm.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/base.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/base.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/empty.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/empty.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/folder.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/folderopen.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/folderopen.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/join.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/join.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/joinbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/joinbottom.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/line.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/line.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/minusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/minusbottom.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/page.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/page.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/plusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo1/icons/plusbottom.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/index.html 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,121 @@ + + + Tigra Tree Menu - Demo #2 (Win help style) + + + + + + + + + + + + + + + + + + + + + + +
Tigra Tree MenuSoftcomplex logo
+ + | About Us  + | Services  + | Download  + | Order  + | Support  + | + +
+ + + +
+ + + + + + + + +
Tigra Tree Menu - Demo #2 (Win help style)
+ + + + + + + + + + + + + + +
Notes
+ Tree menu outward appearance can be easily configured to match your needs. + On the right hand side you can see win help like tree menu appearance. +
Advantages
+

Flexibility and usability - You can make navigation tree look exactly as your application requires using configuration settings provided. With minimum programming efforts component can be attached to dynamic data sources such as database or file system.

+

Performance and robustness - Tigra Tree Menu is highly optimized JavaScript component that efficiently utilizes resources of the browser. The product is designed to smoothly operate hierarchies containing thousands of items. Configuration files with low formatting overhead save network traffic and guarantee fast download times. Nevertheless you can reach even more efficiency using size optimized version provided within the download package

+

Saves time and budget - The script saves time, funds and efforts at all stages of the web application development: you get the component that does what you need for free, with tons of illustrated support materials you start using tree menu instantly, you efficiently and comfortably maintain navigation component, you easily adopt script as your requirements grow. +

Links
+ + + +
+
+ + + +
+ +
+
+
+ + + + + + + + +
Copyright ©2004 SoftComplex Inc. All rights reserved. + | company info + | terms of service + | privacy policy + | +
+ + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/logo.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/pixel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/pixel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree.js 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,132 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree (a_items, a_template) { + + this.a_tpl = a_template; + this.a_config = a_items; + this.o_root = this; + this.a_index = []; + this.o_selected = null; + this.n_depth = -1; + + var o_icone = new Image(), + o_iconl = new Image(); + o_icone.src = a_template['icon_e']; + o_iconl.src = a_template['icon_l']; + a_template['im_e'] = o_icone; + a_template['im_l'] = o_iconl; + for (var i = 0; i < 64; i++) + if (a_template['icon_' + i]) { + var o_icon = new Image(); + a_template['im_' + i] = o_icon; + o_icon.src = a_template['icon_' + i]; + } + + this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) }; + this.select = function (n_id) { return this.a_index[n_id].select(); }; + this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; + this.mover = function (n_id) { this.a_index[n_id].upstatus() }; + + this.a_children = []; + for (var i = 0; i < a_items.length; i++) + new tree_item(this, i); + + this.n_id = trees.length; + trees[this.n_id] = this; + + for (var i = 0; i < this.a_children.length; i++) { + document.write(this.a_children[i].init()); + this.a_children[i].open(); + } +} +function tree_item (o_parent, n_order) { + + this.n_depth = o_parent.n_depth + 1; + this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)]; + if (!this.a_config) return; + + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + this.b_opened = !this.n_depth; + + this.n_id = this.o_root.a_index.length; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + this.a_children = []; + for (var i = 0; i < this.a_config.length - 2; i++) + new tree_item(this, i); + + this.get_icon = item_get_icon; + this.open = item_open; + this.select = item_select; + this.init = item_init; + this.upstatus = item_upstatus; + this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; +} + +function item_open (b_close) { + var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); + if (!o_idiv) return; + + if (!o_idiv.innerHTML) { + var a_children = []; + for (var i = 0; i < this.a_children.length; i++) + a_children[i]= this.a_children[i].init(); + o_idiv.innerHTML = a_children.join(''); + } + o_idiv.style.display = (b_close ? 'none' : 'block'); + + this.b_opened = !b_close; + var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], + o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_jicon) o_jicon.src = this.get_icon(true); + if (o_iicon) o_iicon.src = this.get_icon(); + this.upstatus(); +} + +function item_select (b_deselect) { + if (!b_deselect) { + var o_olditem = this.o_root.o_selected; + this.o_root.o_selected = this; + if (o_olditem) o_olditem.select(true); + } + var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_iicon) o_iicon.src = this.get_icon(); + get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold'; + + this.upstatus(); + return Boolean(this.a_config[1]); +} + +function item_upstatus (b_clear) { + window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10); +} + +function item_init () { + var a_offset = [], + o_current_item = this.o_parent; + for (var i = this.n_depth; i > 1; i--) { + a_offset[i] = ''; + o_current_item = o_current_item.o_parent; + } + return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + '' + this.a_config[0] + '
' + (this.a_children.length ? '' : ''); +} + +function item_get_icon (b_junction) { + return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && this.o_root.o_selected == this ? 4 : 0) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))]; +} + +var trees = []; +get_element = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree_items.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree_items.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree_items.js 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,115 @@ +/* + the format of the tree definition file is simple, + you can find specification in the Tigra Menu documentation at: + + http://www.softcomplex.com/products/tigra_tree_menu/docs/index.html#hierarchy +*/ + +var TREE_ITEMS = [ + ['Window', 0, + ['Description'], + ['Properties', 0, + ['client'], + ['closed'], + ['defaultStatus'], + ['dialogArguments'], + ['dialogHeight'], + ['dialogWidth'], + ['dialogTop'], + ['dialogLeft'], + ['document', 0, + ['Description'], + ['Properties', 0, + ['activeElement'], + ['aLinkColor'], + ['bgColor'], + ['cookie'], + ['domain'], + ['fgColor'], + ['lastModified'], + ['linkColor'], + ['location'], + ['parentWindow'], + ['referrer'], + ['readyState'], + ['title'], + ['URL'], + ['vlinkColor'] + ], + ['Methods', 0, + ['close'], + ['createElement'], + ['execCommand'], + ['elementFromPoint'], + ['open'], + ['queryCommandEnabled'], + ['queryCommandIndeterm'], + ['queryCommandState'], + ['queryCommandSupported'], + ['queryCommandValue'], + ['write'], + ['writeln'] + ], + ['Collections', 0, + ['all'], + ['anchors'], + ['applets'], + ['forms'], + ['frames'], + ['embeds'], + ['images'], + ['links'], + ['scripts'], + ['styleSheets'] + ], + ['Example'] + ], + ['event'], + ['history', 0, + ['Description'], + ['Properties', 0, + ['length'] + ], + ['Methods', 0, + ['back'], + ['forward'], + ['go'] + ], + ['Example'] + ], + ['length'], + ['location'], + ['name'], + ['navigator'], + ['offscreenBuffering'], + ['opener'], + ['parent'], + ['returnValue'], + ['self'], + ['status'], + ['top'] + ], + ['Methods', 0, + ['alert'], + ['blur'], + ['clearInterval'], + ['clearTimeout'], + ['close'], + ['confirm'], + ['execScript'], + ['focus '], + ['navigate'], + ['open'], + ['prompt'], + ['scroll'], + ['setInterval'], + ['setTimeout'], + ['showHelp'], + ['showModalDialog'] + ], + ['Collections', 0, + ['frames'] + ], + ['Example'] + ] +]; \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/tree_tpl.js 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,36 @@ +/* + Feel free to use your custom icons for the tree. Make sure they are all of the same size. + User icons collections are welcome, we'll publish them giving all regards. +*/ + +var TREE_TPL = { + 'target' : '_blank', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : 'icons/empty.gif', // empty image + 'icon_l' : 'icons/empty.gif', // vertical line + + 'icon_32' : 'icons/base.gif', // root leaf icon normal + 'icon_36' : 'icons/base.gif', // root leaf icon selected + + 'icon_48' : 'icons/folder.gif', // root icon normal + 'icon_52' : 'icons/foldersel.gif', // root icon selected + 'icon_56' : 'icons/folder.gif', // root icon opened + 'icon_60' : 'icons/foldersel.gif', // root icon selected + + 'icon_16' : 'icons/folder.gif', // node icon normal + 'icon_20' : 'icons/foldersel.gif', // node icon selected + 'icon_24' : 'icons/folderopen.gif', // node icon opened + 'icon_28' : 'icons/foldersel.gif', // node icon selected opened + + 'icon_0' : 'icons/page.gif', // leaf icon normal + 'icon_4' : 'icons/pagesel.gif', // leaf icon selected + + 'icon_2' : 'icons/empty.gif', // junction for leaf + 'icon_3' : 'icons/empty.gif', // junction for last leaf + 'icon_18' : 'icons/plus.gif', // junction for closed node + 'icon_19' : 'icons/plus.gif', // junctioin for last closed node + 'icon_26' : 'icons/minus.gif',// junction for opened node + 'icon_27' : 'icons/minus.gif' // junctioin for last opended node +}; + Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/ttm.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/ttm.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/empty.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/empty.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/folder.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/folderopen.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/folderopen.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/foldersel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/foldersel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/page.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/page.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/pagesel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/pagesel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/tigra/demo2/icons/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery-scorm/view/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/view/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/view/index-oracle.xql 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,15 @@ + + + + oracle8.1.6 + + + + + select content_template.get_root_folder from dual + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/view/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/view/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/view/index-postgresql.xql 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + + select content_template__get_root_folder() + + + + + + Index: openacs-4/packages/lorsm/www/delivery-scorm/view/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery-scorm/view/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery-scorm/view/index.vuh 26 May 2005 21:13:34 -0000 1.1 @@ -0,0 +1,86 @@ +ad_page_contract { + @author Unknown + @creation-date Unknown + @cvs-id $Id: index.vuh,v 1.1 2005/05/26 21:13:34 micheles Exp $ +} { + { ims_item_id "" } +} + +# check if the nsv variable exists +if {![nsv_exists delivery_vars [ad_conn session_id]]} { + ad_returnredirect [dotlrn_community::get_community_url [dotlrn_community::get_community_id -package_id [ad_conn package_id]]] +} + +if {[info exists ims_item_id]} { + lorsm::set_ims_item_id $ims_item_id +} + +# Get the paths +set the_root [ns_info pageroot] +set the_url [ad_conn path_info] +set content_type "content_revision" + + +set content_root [lindex [nsv_get delivery_vars [ad_conn session_id]] 0] +set ns_item_id [lindex [nsv_get delivery_vars [ad_conn session_id]] 1] +set ims_item_id [lorsm::get_ims_item_id] + + +#ns_log warning "index.vuh SCORM : IMSITEMID setting: from $old_ims_id to $imsitem_id for $the_url" +#ad_set_client_property lorsm currentcourse $ims_item_id + +set the_url [join [lrange [split $the_url "/"] 1 end] "/"] + +set template_root [db_string template_root ""] + +# Serve the page +# DRB: Note that content::init modifies the local variable the_root, which is treated +# as though it's been passed by reference. This requires that the redirect treat the +# path as an absolute path within the filesystem. + +# MIGUELM: we need a way to use other content root not only the one for the course since we can have +# items from other courses + +set item_id [content::item::get_id -item_path $the_url -root_folder_id $content_root -resolve_index "f"] +if { [empty_string_p $item_id] } { + # This item was probably added. We need to check if the item exist on other folder. + # So we will get the first part of the URL + set item_id [lorsm::delivery::get_item_other_folder -url $the_url] +} + +# To get the revision_id (file_id) we need to show here we have to items here +# one is the item_id that is recived on record-view page from the menu +# and the other one is the one that holds all the revisions for one file +set revision_id [lorsm::delivery::get_file_id_from_ims_item_id -ims_item_id $ns_item_id -item_id $item_id] + +if { [empty_string_p $revision_id] } { + # Is a reference to an image or some other resource inside the page, this items don't + # have an entry in ims_cp_files table + set revision_id [item::get_best_revision $item_id] +} + +if { ![empty_string_p $revision_id] } { + # We catch the revision id using the_url and content root + ns_log debug "index.vuh SCORM : visting revision_id $item_id for $the_url" + cr_write_content -revision_id $revision_id +} else { + # Write the ims_item_id that we recieve on the page since this is the one that holds the content + cr_write_content -revision_id $ims_item_id +} + +ad_script_abort +if { [lorsm::init the_url the_root $content_root $template_root public "" $content_type] } { + # we introduced our own template + rp_internal_redirect -absolute_path [acs_root_dir]/templates/lorsm-default + +} else { + # ns_returnnotfound + set page "[ad_header {Content Item Not Found}]" + append page "

Content Item Not Found

" + append page "The requested item is not available for viewing. " + append page "The item is either not available on this server or it is not in a publishable state " + append page "Unpublished items can be viewed via the CMS interface if the CMS package is installed.
" + append page "[ad_footer]" + doc_return 200 text/html $page +} +