Index: openacs-4/packages/lorsm/lorsm.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lorsm.info,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/lorsm.info 22 Apr 2004 03:58:08 -0000 1.1 +++ openacs-4/packages/lorsm/lorsm.info 4 Sep 2004 14:51:18 -0000 1.2 @@ -8,21 +8,18 @@ f lorsm - - - 0 - - - - - Ernie Ghiglione + + Ernie Ghiglione Application to manage the services from the Learning Object Repository. + 2004-06-19 This application manages the services from the Learning Object Repository: upload courses, manage and create metadata, delete resources and courses. - - + + + + Index: openacs-4/packages/lorsm/lib/user-lorsm.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/user-lorsm.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/lib/user-lorsm.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/lib/user-lorsm.adp 4 Sep 2004 14:51:19 -0000 1.2 @@ -1 +1,4 @@ + + + Index: openacs-4/packages/lorsm/lib/user-lorsm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/lib/user-lorsm.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/lib/user-lorsm.tcl 23 Apr 2004 01:26:41 -0000 1.2 +++ openacs-4/packages/lorsm/lib/user-lorsm.tcl 4 Sep 2004 14:51:19 -0000 1.3 @@ -1,18 +1,23 @@ -# packages/lorsm/lib/user-lorsm.tcl -# -# User portlet view -# -# @author Ernie Ghiglione (ErnieG@mm.st) -# @creation-date 2004-04-10 -# @arch-tag c4c3448b-3f12-43cc-9f96-19b4c4a72a58 -# @cvs-id $Id$ +# packages/lorsm/www/test.tcl -foreach required_param {package_id} { - if {![info exists $required_param]} { - return -code error "$required_param is a required parameter." - } +ad_page_contract { + + testing background + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-06-15 + @arch-tag: 9d893919-9a02-45cd-b6ad-19e3a34ba747 + @cvs-id $Id$ +} { + +} -properties { +} -validate { +} -errors { } +#set package_id $list_of_packages_ids + + template::list::create \ -name d_courses \ -multirow d_courses \ @@ -23,38 +28,89 @@ course_name { label "Course Name" display_col course_name - link_url_eval {[site_node::get_url_from_object_id -object_id $context_id]delivery/?[export_vars man_id]} + html { width 70% } + link_url_eval {[site_node::get_url_from_object_id -object_id $lorsm_instance_id]delivery/?[export_vars man_id]} link_html {title "Access Course"} } - creation_user { - label "Owner" - display_eval {[person::name -person_id $creation_user]} - link_url_eval {[acs_community_member_url -user_id $creation_user]} + subject { + label "Subject" + display_eval {[dotlrn_community::get_community_name $community_id]} + html { align center width 20% } + link_url_eval {[dotlrn_community::get_community_url $community_id]} + link_html {title "Access Course"} } - creation_date { - label "Creation Date" - display_eval {[lc_time_fmt $creation_date "%x %X"]} + last_viewed { + label "Last Viewed On" + html { align center width 10% } + display_eval {[lc_time_fmt $last_viewed "%x"]} } + viewed_percent { + label "% Viewed" + html { align right } + display_eval {[lc_numeric $viewed_percent "%.2f"]} + } } -db_multirow -extend { ims_md_id } d_courses select_d_courses { - select - cp.man_id, +set user_id [ad_conn user_id] + +foreach package $package_id { + + db_multirow -extend { ims_md_id last_viewed total_item_count viewed_item_count viewed_percent} -append d_courses select_d_courses { + select + cp.man_id, cp.course_name, cp.identifier, cp.version, cp.fs_package_id, cp.folder_id, acs.creation_user, acs.creation_date, - acs.context_id - from - ims_cp_manifests cp, acs_objects acs - where + acs.context_id, + cpmc.community_id, + cpmc.lorsm_instance_id + from + ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc + where cp.man_id = acs.object_id - and - acs.context_id = :package_id -} { - set ims_md_id $man_id + and + cp.man_id = cpmc.man_id + and +-- acs.context_id = :package + cpmc.lorsm_instance_id = :package + and + cpmc.isenabled = 't' + order by acs.creation_date desc + } { + set ims_md_id $man_id + # DEDS: these are expensive + # and for demo purposes only + db_0or1row get_last_viewed { + select v.last_viewed + from views v, + ims_cp_items i, + ims_cp_organizations o + where v.viewer_id = :user_id + and v.object_id = i.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.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 [expr [expr $viewed_item_count * 1.00] / $total_item_count * 100] + } } - Index: openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/sql/postgresql/lorsm-create.sql 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,92 @@ +-- +-- packages/lorsm/sql/postgresql/lorsm-create.sql +-- +-- @author Ernie Ghiglione (ErnieG@mm.st) +-- @creation-date 2004-05-24 +-- @arch-tag 168b43b5-5693-4d4a-a5e7-d629f8fb206b +-- @cvs-id $Id: lorsm-create.sql,v 1.1 2004/09/04 14:51:20 ernieg Exp $ +-- + +-- +-- Copyright (C) 2004 Ernie Ghiglione +-- +-- This package is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- It is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + + + + +-- Creates tables to track student's progress + +create table lorsm_student_track ( + track_id int + constraint lorsm_st_track_id_pk + primary key, + user_id int + constraint lorsm_st_track_user_id_fk + references users (user_id), + community_id int + constraint lorsm_st_track_comm_id_fk + references dotlrn_communities_all (community_id), + course_id int + constraint lorsm_st_track_course_id_fk + references ims_cp_manifests (man_id), + start_time timestamptz not null default current_timestamp, + end_time timestamptz +); + +-- create track_id sequence +create sequence lorsm_st_track_track_id_seq start 1; + +-- create index for lorsm_student_track_indexes + -- student_id + create index lorsm_st_track__user_id_idx on lorsm_student_track (user_id); + -- community_id + create index lorsm_st_track__comm_id_idx on lorsm_student_track (community_id); + -- course_id + create index lorsm_st_track__course_id_idx on lorsm_student_track (course_id); + +comment on table lorsm_student_track is ' +This table stores students tracking information. +Multiplicity: each student can have many records of the same course/class. Remember, +a course can be given in two different communities/classes +'; + +create table lorsm_student_bookmark ( + user_id int + constraint lorsm_st_track_user_id_fk + references users (user_id), + community_id int + constraint lorsm_st_track_comm_id_fk + references dotlrn_communities_all (community_id), + course_id int + constraint lorsm_st_track_course_id_fk + references ims_cp_manifests (man_id), + date timestamptz, + constraint lorsm_st_book_id_pk + primary key (user_id, community_id, course_id) +); + +-- create index for lorsm_student_book_indexes + -- student_id + create index lorsm_st_book__user_id_idx on lorsm_student_bookmark (user_id); + -- community_id + create index lorsm_st_book__comm_id_idx on lorsm_student_bookmark (community_id); + -- course_id + create index lorsm_st_book__course_id_idx on lorsm_student_bookmark (course_id); + +comment on table lorsm_student_track is ' +This table stores students bookmark information. We bookmarked the last page the page/link that the +student visited last. +Multiplicity: One bookmark per course/class/student +'; + +\i lorsm-packages.sql Index: openacs-4/packages/lorsm/sql/postgresql/lorsm-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/sql/postgresql/lorsm-packages.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/sql/postgresql/lorsm-packages.sql 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,69 @@ +-- +-- packages/lorsm/sql/postgresql/lorsm-package.sql +-- +-- @author Ernie Ghiglione (ErnieG@mm.st) +-- @creation-date 2004-05-24 +-- @arch-tag b0b73549-814c-4718-9537-f856b972d10f +-- @cvs-id $Id: lorsm-packages.sql,v 1.1 2004/09/04 14:51:20 ernieg Exp $ +-- + +-- +-- Copyright (C) 2004 Ernie Ghiglione +-- +-- This package is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- It is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- student track package + +create or replace function lorsm_student_track__new (integer,integer,integer) +returns integer as ' +declare + p_user_id alias for $1; + p_community_id alias for $2; + p_course_id alias for $3; + v_track_id lorsm_student_track.track_id%TYPE; + v_start_time timestamptz; +begin + select nextval(''lorsm_st_track_track_id_seq'') + into v_track_id + from dual; + + v_start_time := now(); + + -- inserts into + insert into lorsm_student_track + (track_id, user_id, community_id, course_id, start_time) + values + (v_track_id, p_user_id, p_community_id, p_course_id, v_start_time); + + return v_track_id; + +end;' language 'plpgsql'; + + +create or replace function lorsm_student_track__exit (integer) +returns integer as ' +declare + p_track_id alias for $1; + v_end_time timestamptz; +begin + + v_end_time := now(); + + -- student leaves + -- so we save the exit time + update lorsm_student_track + set end_time = v_end_time + where track_id = p_track_id; + + return p_track_id; + +end;' language 'plpgsql'; Index: openacs-4/packages/lorsm/sql/postgresql/lorsm-template.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/sql/postgresql/lorsm-template.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/sql/postgresql/lorsm-template.sql 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,29 @@ + +create or replace function inline_0 () +returns integer as' +declare + template_id integer; +begin + + -- Create the (default) file_storage_object content type template + + template_id := content_template__new( + ''lorms-default'', -- name + '''', -- text + true -- is_live + ); + + -- Register the template for the file_storage_object content type + + perform content_type__register_template( + ''file_storage_object'', -- content_type + template_id, -- template_id + ''lorsm'', -- use_context + ''t'' -- is_default + ); + + return null; +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); Index: openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/tcl/lorsm-install-procs.tcl 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,56 @@ +# packages/lorsm/tcl/lorsm-install-procs.tcl + +ad_library { + + LORSM Installation procedures + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-08-19 + @arch-tag: 535eebaf-8414-4703-8a39-e115a34b68f1 + @cvs-id $Id: lorsm-install-procs.tcl,v 1.1 2004/09/04 14:51:20 ernieg Exp $ +} + +# +# Copyright (C) 2004 Ernie Ghiglione +# +# This package is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# It is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + + +namespace eval lorsm::install {} + +ad_proc -private lorsm::install::package_install {} { + + Install the lorsm-templates + +} { + # location where the templates file are + set temp_location "[acs_root_dir]/packages/lorsm/templates" + + # location where we are going to copy the files to + set temp_dir "[acs_root_dir]/templates" + + # check if the template directory exists + # Otherwise create it. + if {![file exists $temp_dir]} { + + file mkdir $temp_dir + + } + + foreach file [glob -nocomplain [file join $temp_location *]] { + + file copy -force $file $temp_dir + + } + + +} Index: openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/tcl/lorsm-procs-postgresql.xql 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,94 @@ + + + postgresql7.1 + + + + + select 0 as tree_level, '' as name , 'Home' as title + UNION + select t.tree_level, i.name, content_item.get_title(t.context_id) as title + from (select o2.context_id, tree_level(o2.tree_sortkey) as tree_level + from (select * from acs_objects where object_id = :item_id) o1, acs_objects o2 + where context_id <> content_item__get_root_folder() + and o1.tree_sortkey between o2.tree_sortkey and tree_right(o2.tree_sortkey)) t, + cr_items i + where i.item_id = t.context_id + order by tree_level + + + + + + + + select 1 + + + + + + + + select + content + from + cr_revisions + where + revision_id = :revision_id + + + + + + + + select content_item__get_id(:url, :content_root, 'f') as item_id + + + + + + select content_type from cr_items where item_id=:item_id + + + + + + + select + item_id, content_type + from + cr_items + where + item_id = :item_id + + + + + + + + select + content_item__get_live_revision(content_item__get_template(:item_id, :context)) as template_id, + content_template__get_path(content_item__get_template(:item_id, :context),:template_root) as template_url + from + dual + + + + + + + + + select + content_template__get_path( + content_item__get_template(:item_id, :context),:template_root) as template_url + from + dual + + + + + Index: openacs-4/packages/lorsm/tcl/lorsm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 4 May 2004 05:38:45 -0000 1.2 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.tcl 4 Sep 2004 14:51:20 -0000 1.3 @@ -26,6 +26,16 @@ namespace eval lorsm { +variable item_id +variable item_url +variable template_url +variable revision_id + +variable content_root +variable ims_item_id +variable ims_item_title +variable ims_man_id + ad_proc -public fix_url { -url:required } { @@ -53,7 +63,10 @@ -item_title:required -identifierref:required -fs_package_id:required + -fs_local_package_id:required -folder_id:required + -type:required + -track_id:required } { Function use to fix the HREF of resources. It could be that the reference to a resource is outside the @@ -69,7 +82,10 @@ @param item_title The title of the item in question @param identifierref The resource's identifierref @param fs_package_id the file-storage package id + @param fs_local_package_id the local file-storage package id @param folder_id file-storage folder id + @param type type of resource + @param track_id whether the ims_cp_item should be tracked or not. @author Ernie Ghiglione (ErnieG@mm.st) } { @@ -82,12 +98,22 @@ } else { - set url1 "[apm_package_url_from_id $fs_package_id]view/" - set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" - set url3 [lorsm::fix_url -url $identifierref] + switch $type { + "ims-qti-package" { + set url "$item_title" - set url "$item_title" + } + default { + set url1 "[apm_package_url_from_id $fs_local_package_id]view/" + set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]" + set url3 [lorsm::fix_url -url $identifierref] + set content_root [fs::get_root_folder -package_id $fs_package_id] + set url "$item_title" + } + } + + return $url } @@ -96,6 +122,347 @@ } } + + ad_proc -public get_course_name { + -manifest_id:required + } { + Given a man_id, it returns the name of the course + + @param manifest_id the Id for the course + @author Ernie Ghiglione (ErnieG@mm.st) + } { + + return [db_string course_name {select course_name from ims_cp_manifests where man_id = :manifest_id}] + + } + + ad_proc -public dates_calc { + -start_date:required + -end_date:required + } { + Returns the number of minutes, hours or dates given a start + and end date. + + @param start_date Starting date + @param end_date Ending date + @author Ernie Ghiglione (ErnieG@mm.st) + } { + + set start [clock scan "$start_date"] + set end [clock scan "$end_date"] + + set difference [expr {$end - $start}] + + if {$difference >= 0 && $difference < 60} { + return "$difference seconds" + } elseif {$difference >= 60 && $difference < 3600} { + + return "[expr {$difference / 60.0}] minutes" + + } elseif {$difference >= 3600 && $difference < 86400} { + return "[expr {$difference / 60.0 /60.0 }] hours" + + } else { + return "[expr {$difference / 60.0 / 60.0 / 24.0}] days" + } + } + + + ad_proc -public fix_href2 { + -item_id:required + -identifierref:required + -fs_package_id:required + -fs_local_package_id:required + -folder_id:required + -type:required + -track_id:required + } { + Function use to fix the HREF of resources. + It could be that the reference to a resource is outside the + scope of the learning object (somewhere on the web) instead + of a file or resource in the course. + + Therefore, this function determines whether ther link to the + resource is within the course materials. If that is the case + it created the link to where the file is stored in the file- + storage. Otherwise, if the resource needs to be fetched from + the web (http://) then we use that href instead. + + @param item_title The title of the item in question + @param identifierref The resource's identifierref + @param fs_package_id the file-storage package id + @param fs_local_package_id the local file-storage package id + @param folder_id file-storage folder id + @param type type of resource + @param track_id whether the ims_cp_item should be tracked or not. + @author Ernie Ghiglione (ErnieG@mm.st) + + } { + + + if {![empty_string_p $identifierref]} { + + # if the href is already a link to another site, then just + # let it be that + if {[regexp "http://" $identifierref]} { + set identifierref $identifierref + } else { + # otherwise, let the fun begin! + # we need to construct the right URL for this item and + # the instance of the class that is trying to deploy + # it. Further explanation in the documentation. + switch $type { + default { + set url1 "[apm_package_url_from_id $fs_local_package_id]view/" + set folder_id $folder_id + set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + set url3 [lorsm::fix_url -url $identifierref] + set content_root [fs::get_root_folder -package_id $fs_package_id] + set item_id $item_id + set identifierref [export_vars -base [concat $url1$url2$url3] {content_root}] + + # if the course is trackable, we need to make + # sure we record the items the user has + # seen. These are ims_items type of objects + if {$track_id != 0} { + + set redirect_url $identifierref + set identifierref [export_vars -base record-view {item_id}] + + } + } + } + } + return $identifierref + } else { + return "" + } + + } + + + +### Testing ground + + ad_proc -public fix_href3 { + -man_id:required + -item_id:required + -identifierref:required + -fs_package_id:required + -fs_local_package_id:required + -folder_id:required + -type:required + -track_id:required + } { + Function use to fix the HREF of resources. + It could be that the reference to a resource is outside the + scope of the learning object (somewhere on the web) instead + of a file or resource in the course. + + Therefore, this function determines whether ther link to the + resource is within the course materials. If that is the case + it created the link to where the file is stored in the file- + storage. Otherwise, if the resource needs to be fetched from + the web (http://) then we use that href instead. + + @param man_id manifest Id + @param item_title The title of the item in question + @param identifierref The resource's identifierref + @param fs_package_id the file-storage package id + @param fs_local_package_id the local file-storage package id + @param folder_id file-storage folder id + @param type type of resource + @param track_id whether the ims_cp_item should be tracked or not. + @author Ernie Ghiglione (ErnieG@mm.st) + + } { + + if {![empty_string_p $identifierref]} { + + # if the href is already a link to another site, then just + # let it be that + if {[regexp "http://" $identifierref]} { + set identifierref $identifierref + } else { + # otherwise, let the fun begin! + # we need to construct the right URL for this item and + # the instance of the class that is trying to deploy + # it. Further explanation in the documentation. + switch $type { + default { + set url1 "view/" +#CM creating url2 in record-view +# set folder_id $folder_id +# set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" +#CM Not using url3 anymore +# set url3 [lorsm::fix_url -url $identifierref] + set content_root [fs::get_root_folder -package_id $fs_package_id] + set item_id $item_id +# set identifierref [export_vars -base record-view {content_root url2 url3 item_id man_id}] + set identifierref [export_vars -base record-view {item_id man_id content_root}] + + # if the course is trackable, we need to make + # sure we record the items the user has + # seen. These are ims_items type of objects + if {$track_id != 0} { + +# set redirect_url $identifierref +# set identifierref [export_vars -base record-view {redirect_url item_id}] + + } + } + } + } + return $identifierref + } else { + return "" + } + + } + +ad_proc -public set_ims_item_id { ims_it_id } { + + variable ims_item_id $ims_it_id } + +ad_proc -public get_ims_item_id {} { + + variable ims_item_id + return $ims_item_id + +} + + +ad_proc -public init { urlvar rootvar {content_root ""} {template_root ""} {context "public"} {rev_id ""} {content_type ""} } { + upvar $urlvar url $rootvar root_path + + variable item_id + variable revision_id + + # if a .tcl file exists at this url, then don't do any queries + if { [file exists [ns_url2file "$url.tcl"]] } { + return 0 + } + + # cache this query persistently for 1 hour + # this is faster than 1 query because a pl/sql function in the + # where clause is a very bad idea + db_0or1row get_item_id "" + db_0or1row get_item_type "" + # No item found, so do not handle this request + if { ![info exists item_id] } { + db_0or1row get_template_info "" -column_array item_info + + if { ![info exists item_info] } { + ns_log notice "content::init: no content found for url $url" + return 0 + } + } + + variable item_url + set item_url $url + + if { [empty_string_p $content_type] } { + set content_type $item_info(content_type) + } + + # Make sure that a live revision exists + if { [empty_string_p $rev_id] } { + set live_revision [db_string get_live_revision ""] + + if { [template::util::is_nil live_revision] } { + ns_log notice "content::init: no live revision found for content item $item_id" + return 0 + } + set revision_id $live_revision + } else { + set revision_id $rev_id + } + + variable template_path + + # Get the template + set template_found_p [db_0or1row get_template_url "" -column_array info] + + if { !$template_found_p || [string equal $info(template_url) {}] } { + ns_log notice "content::init: No template found to render content item $item_id in context '$context'" + return 0 + } + + set url $info(template_url) + set root_path [get_template_root] + + return 1 +} + +ad_proc -public get_template_root {} { + + # Look for package-defined root + set package_id [ad_conn package_id] + set template_root \ + [ad_parameter -package_id $package_id TemplateRoot dummy ""] + + if { [empty_string_p $template_root] } { + # Look for template root defined in the CR + set package_id [apm_package_id_from_key "acs-content-repository"] + + set template_root [ad_parameter -package_id $package_id \ + TemplateRoot dummy "templates"] + } + + if { [string index $template_root 0] != "/" } { + # Relative path, prepend server_root + set template_root "[acs_root_dir]/$template_root" + } + + return [ns_normalizepath $template_root] + +} + + +ad_proc -public get_content { { content_type {} } } { + + variable item_id + variable revision_id + variable ims_item_id + variable ims_item_title + + if { [template::util::is_nil item_id] } { + ns_log warning "content::get_content: No active item in content::get_content" + return + } + + # Get the live revision + set revision_id [db_string get_revision ""] + + if { [template::util::is_nil revision_id] } { + ns_log notice "content::get_content: No live revision for item $item_id" + return + } + + # Get the mime type, decide if we want the text + set mime_type [db_string get_mime_type ""] + + if { [template::util::is_nil mime_type] } { + ns_log notice "content::get_content: No such revision: $revision_id" + return + } + + # Get the content type + if { [empty_string_p $content_type] } { + set content_type [db_string get_content_type ""] + } + + upvar content content + + array set content "item_id $item_id revision_id $revision_id mime_type $mime_type content_type $content_type" + +} + + + +} + + Index: openacs-4/packages/lorsm/tcl/lorsm-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/tcl/lorsm-procs.xql 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,80 @@ + + + + + + + select live_revision from cr_items where item_id = :item_id + + + + + + + + select mime_type from cr_revisions + where revision_id = :revision_id + + + + + + + + select content_type from cr_items + where item_id = :item_id + + + + + + + + select table_name from acs_object_types + where object_type = :content_type + + + + + + + + , content as text + + + + + + + + select + x.*, + :content_type as content_type + $text_sql + from + cr_revisions r, ${table_name}x x + where + r.revision_id = :revision_id + and + x.revision_id = r.revision_id + + + + + + + + select live_revision from cr_items where item_id = :item_id + + + + + + + + select live_revision from cr_items where item_id = :item_id + + + + + Index: openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/tcl/lorsm-tracking-procs.tcl 4 Sep 2004 14:51:20 -0000 1.1 @@ -0,0 +1,120 @@ +# packages/lorsm/tcl/lorsm-tracking-procs.tcl + +ad_library { + + LORSM Student Tracking + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-24 + @arch-tag b8bbe245-6535-4ea9-a4a6-2be2d888b36d + @cvs-id $Id: lorsm-tracking-procs.tcl,v 1.1 2004/09/04 14:51:20 ernieg Exp $ +} + +# +# Copyright (C) 2004 Ernie Ghiglione +# +# This package is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# It is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +namespace eval lorsm::track { + + ad_proc -public new { + -user_id:required + -community_id:required + -course_id:required + } { + Tracks everytime a student gets deliver a course. + The aim of tracking is to see how many time a user has seen a + course as well as the time he/she has spent on it. + + @param user_id User ID + @param community_id Class or Club ID + @param course_id Course ID (Manifest ID) + @author Ernie Ghiglione (ErnieG@mm.st) + + } { + + db_transaction { + set track_id [db_exec_plsql track_st_new { + + select lorsm_student_track__new ( + :user_id, + :community_id, + :course_id + ); + + } + ] + + } + return $track_id + } + + ad_proc -public exit { + -track_id:required + } { + Sets the time when the student leaves the delivery environment + + @param track_id Track ID (given when the delivery session opened + @author Ernie Ghiglione (ErnieG@mm.st) + + } { + + db_transaction { + set track_id [db_exec_plsql track_st_exit { + + select lorsm_student_track__exit ( + :track_id + ); + + } + ] + + } + return $track_id + } + + ad_proc -public istrackable { + -course_id:required + -package_id:required + } { + Checks whether the instance of this course in the specified + community is trackable. + + If it is, then it returns 1. Otherwise, 0. + + @param course_id Course ID (or manifest_id) + @param community_id Commuinity ID. + @author Ernie Ghiglione (ErnieG@mm.st) + + } { + + set istrackable [db_string trackable { + select istrackable from ims_cp_manifest_class + where man_id = :course_id and lorsm_instance_id = :package_id + }] + + if {$istrackable == "f"} { + return 0 + } else { + return 1 + } + + } + +} + + + + + + + Index: openacs-4/packages/lorsm/www/course-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-add-2.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-add-2.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-add-2.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -24,6 +24,11 @@

IMS Package Info

+ + The uploaded file is a Blackboard 6 complaint package. +

+ +

Index: openacs-4/packages/lorsm/www/course-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-add-2.tcl 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-add-2.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -68,6 +68,17 @@ } +# Is this a Blackboard6 package? +set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] + +if {$isBB == 1} { + # we generate metadata for the file + ns_log Notice "Generating MD record from Blackboard6 package $tmp_dir --" + lors::imscp::bb6::create_MD -tmp_dir $tmp_dir -file $file + ns_log Notice "Done!" + +} + ## adds folder to the CR set parent_id $folder_id set fs_dir $tmp_dir Index: openacs-4/packages/lorsm/www/course-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-add-3.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-add-3.tcl 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-add-3.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -5,6 +5,8 @@ Add files to the CR Process imsmanifest.xml + Determines this is a Blackboard course and if it is process it accordingly. + Inserts all ims_items, resources and all IMS CP entities into the DB. @author Ernie Ghiglione (ErnieG@mm.st) @creation-date 19 March 2003 @@ -31,6 +33,33 @@ ad_require_permission $folder_id admin +# Display progress bar +ad_progress_bar_begin \ + -title "Uploading course..." \ + -message_1 "Uploading and processing your course, please wait ..." \ + -message_2 "We will continue automatically when processing is complete." + + +ns_write "

Initiating Updating log...

" + +# Is this a Blackboard6 package? +set isBB [lors::imscp::bb6::isBlackboard6 -tmp_dir $tmp_dir] + +if {$isBB == 1} { + ns_write "

Blackboard6 Content Packaging Course.
Modifying package to be IMS CP compliant..." + ns_write "


Cleaning up unused application and folders..." + lors::imscp::bb6::clean_items -tmp_dir $tmp_dir -file "imsmanifest.xml" + ns_write "Done!" + ns_write "
Renaming content types according to IMS CP specification..." + lors::imscp::bb6::extract_html -tmp_dir $tmp_dir -file "imsmanifest.xml" + ns_write "Done!
" + +} + + +ns_write "

Starting File Processing...

" + + db_transaction { ## adds folder to the CR @@ -59,17 +88,51 @@ set new_parent_id [lors::cr::add_folder -parent_id $parent_id -folder_name $cr_dir] - # Display progress bar - ad_progress_bar_begin \ - -title "Uploading course..." \ - -message_1 "Uploading and processing your course, please wait ..." \ - -message_2 "We will continue automatically when processing is complete." + # PERMISSIONS FOR FILE-STORAGE + # Before we go about anything else, lets just set permissions straight. + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $new_parent_id + # Set read permissions for community/class dotlrn_member_rel - ns_write "

Initiating Updating log...

" + set community_id [dotlrn_community::get_community_id] + set party_id_member [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_member_rel'}] + + permission::grant -party_id $party_id_member -object_id $new_parent_id -privilege read + + # Set read permissions for community/class dotlrn_admin_rel + + set party_id_admin [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_admin_rel'}] + + permission::grant -party_id $party_id_admin -object_id $new_parent_id -privilege read + + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) + + set party_id_professor [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_professor_profile_rel'}] + + permission::grant -party_id $party_id_professor -object_id $new_parent_id -privilege read + + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) + + set party_id_admins [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_admin_profile_rel'}] + + permission::grant -party_id $party_id_admins -object_id $new_parent_id -privilege read + + + + + set filesx [lors::cr::add_files -parent_id $new_parent_id -indb_p $indb_p -files [lors::cr::has_files -fs_dir $fs_dir]] set all_files [concat $all_files $filesx] @@ -106,7 +169,7 @@ #For display purposes ns_write "Processing file(s):
" foreach file $files { - ns_write " [string trimleft $file $tmp_dir]...OK
" + ns_write " [regsub $tmp_dir $file {}]...OK
" } ns_write "
" # @@ -227,8 +290,59 @@ -hasmetadata $man_hasmetadata \ -isscorm $man_isscorm \ -folder_id $new_parent_id \ - -fs_package_id $fs_package_id] + -fs_package_id $fs_package_id \ + -community_id $community_id] + + ns_write "Granting permissions $course_name Manifest...
" + + # PERMISSIONS FOR MANIFEST and learning objects + + # set up in the same way as permissions for the file storage + # objects. As we want to maintain consistency btw the + # learnining objects and their content + + # Disable folder permissions inheritance + permission::toggle_inherit -object_id $man_id + + # Set read permissions for community/class dotlrn_member_rel + + set community_id [dotlrn_community::get_community_id] + + set party_id_member [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_member_rel'}] + + permission::grant -party_id $party_id_member -object_id $man_id -privilege read + + # Set read permissions for community/class dotlrn_admin_rel + + set party_id_admin [db_string party_id {select segment_id from rel_segments \ + where group_id = :community_id \ + and rel_type = 'dotlrn_admin_rel'}] + + permission::grant -party_id $party_id_admin -object_id $man_id -privilege read + + # Set read permissions for *all* other professors within .LRN + # (so they can see the content) + + set party_id_professor [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_professor_profile_rel'}] + + permission::grant -party_id $party_id_professor -object_id $man_id -privilege read + + # Set read permissions for *all* other admins within .LRN + # (so they can see the content) + + set party_id_admins [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_admin_profile_rel'}] + + permission::grant -party_id $party_id_admins -object_id $man_id -privilege read + + + # Done with Manifest and learning object Permissions + + ns_write "Adding $course_name Manifest...
" if {$man_hasmetadata == 1} { @@ -298,13 +412,6 @@ set resourcex [$resources child all resource] - -########## REMOVE DEBUGGING PURPOSE ONLY #### - set f_handler [open /tmp/add.txt w+] - puts -nonewline $f_handler $add - close $f_handler -########## REMOVE DEBUGGING PURPOSE ONLY #### - if { ![empty_string_p $resourcex] } { set res_list [list] @@ -316,8 +423,21 @@ set res_hasmetadata [lors::imsmd::hasMetadata $resource] set res_files [lors::imsmd::getResource -node $resource -att files] set res_scormtype [lors::imsmd::getAtt $resource adlcp:scormtype] - +### Addition to showcase integration with Assessment + +# if {$res_type == "ims-qti-package"} { + +# set res_href [ims_qti_register_assessment $tmp_dir/$res_href] + + +# } + + +## End integration showcase + + + set resource_id [lors::imscp::resource_add \ -man_id $man_id \ -identifier $res_identifier \ @@ -372,13 +492,7 @@ #ns_write "no page" } -########## REMOVE DEBUGGING PURPOSE ONLY #### - set f_handler [open /tmp/res_list.txt w+] - puts -nonewline $f_handler $res_list - close $f_handler -########## REMOVE DEBUGGING PURPOSE ONLY #### - # Here's where we link items and resources. Take into # account that a resources can have 1 to many items @@ -411,21 +525,7 @@ ns_write "Now we are almost done...
" -# set all_files [lindex $all_files 0] -# ns_write -# ns_write - - -########## REMOVE DEBUGGING PURPOSE ONLY #### - set f_handler [open /tmp/all_files.txt w+] - puts -nonewline $f_handler $all_files - close $f_handler - set f_handler [open /tmp/l_files.txt w+] - puts -nonewline $f_handler $l_files - close $f_handler -########## REMOVE DEBUGGING PURPOSE ONLY #### - foreach file $l_files { set filename [lindex $file 0] Index: openacs-4/packages/lorsm/www/course-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-add.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-add.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-add.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -2,8 +2,29 @@ Upload an IMS/SCORM Content Package Course @context;noquote@ - -

We have detected the root folder for @folder_name;noquote@ and we will import your course in this folder.

- - - + + + + + + + + + + + +
+

Shared Courses in the Repository

+
+
+

You can add courses already existing in the repository + +

+
+

Add your own course

+
+
+

We have detected the root folder for @folder_name;noquote@ and we will import your course in this folder.

+ +
+
Index: openacs-4/packages/lorsm/www/course-structure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-structure.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-structure.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-structure.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -4,30 +4,30 @@
- +
- - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + " } + } + + set table_item [concat $table_item [ad_table -Tmissing_text $missing_text -Textra_vars {fs_local_package_id track_id} -Ttable_extra_html $table_extra_html blah { + SELECT + o.object_id, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 2) as indent, + i.item_id, + i.title as item_title, + i.hasmetadata, + i.org_id, + case + when i.identifierref <> '' then ( + SELECT + res.href + FROM + ims_cp_items_to_resources i2r, + ims_cp_resources res + WHERE + i2r.res_id = res.res_id + AND + i2r.item_id = i.item_id + ) + else '' + end as identifierref, + case + when i.identifierref <> '' then ( + SELECT + res.type + FROM + ims_cp_items_to_resources i2r, + ims_cp_resources res + WHERE + i2r.res_id = res.res_id + AND + i2r.item_id = i.item_id + ) + else '' + end as type, + m.fs_package_id, + m.folder_id, + m.course_name + FROM + acs_objects o, ims_cp_items i, ims_cp_manifests m + WHERE + o.object_type = 'ims_item' + AND + i.org_id = :org_id + AND + o.object_id = i.item_id + AND + m.man_id = :man_id + ORDER BY + object_id, tree_sortkey + + + } $table_def]] + + append orgs_list "$table_item" + + + append orgs_list "" + +} + + Index: openacs-4/packages/lorsm/www/delivery2/blank.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/blank.htm,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/blank.htm 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery2/body.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/body.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/body.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + +

Welcome to @course_name@
Course Delivery System for LORS +

+ +

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

+ + Index: openacs-4/packages/lorsm/www/delivery2/body.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/body.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/body.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,17 @@ +# 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 2004/09/04 14:51:26 ernieg Exp $ +} { + course_name:notnull +} -properties { +} -validate { +} -errors { +} + Index: openacs-4/packages/lorsm/www/delivery2/displayToc.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/displayToc.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/displayToc.js 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,170 @@ +/*------------------------------------------------------------------- +Author's Statement: +This script is based on ideas of the author. +You may copy, modify and use it for any purpose. The only condition is that if you publish web pages that use this script you point to its author at a suitable place and don't remove this Statement from it. +It's your responsibility to handle possible bugs even if you didn't modify anything. I cannot promise any support. +Dieter Bungers +GMD (www.gmd.de) and infovation (www.infovation.de) +--------------------------------------------------------------------*/ +// Checking the client's browser and setting the text sizes of the headings in the ToC depending on the global parameter textSizes set in tocParas and the browser useed: + +var isIE = navigator.appName.toLowerCase().indexOf("explorer") > -1; +var mdi = (isIE) ? textSizes[1]:textSizes[3]; +var sml = (isIE) ? textSizes[2]:textSizes[4]; + +// Other global variables: + +// oldCurrentNumber is required to keep a hedings ordering string (or number) in case the ToC should change (tocChange > 0) but the content's location should remain unchanged (i.e. noLink == 1). In those cases the heading preceeded by oldCurrentNumber has to remain hilited (otherwise the heading preceeded by currentNumber has to be hilited). +var oldCurrentNumber = "", oldLastVisitNumber = ""; + +// toDisplay: Array to keep the display status for each heading. It is initialised so only the top level headings are displayed (headings preceeded by a single string without a dot): +var toDisplay = new Array(); +for (ir=0; ir\n\nToC\n\n\n
Course Information
+ Course Name: @course_name;noquote@
+ Version: @version;noquote@
+ Metadata?: @@ -40,15 +40,15 @@
+ Identifier: + @identifier@
+ Is SCORM?:
+ Storage Folder: + @instance@
+ Created By: + @created_by@
+ Date: + @creation_date;noquote@
+
Submanifests: + @submanifests@
+ Status: + + + Enabled + + + Disabled + +
+ Change +
+
+ Trackable: + + + Yes + + + No + +
+ Change +
+
+ Is shared? + + + Shared + + + Not Shared + +
+ Change +
+
Organizations Index: openacs-4/packages/lorsm/www/course-structure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/course-structure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/course-structure.tcl 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/course-structure.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -15,6 +15,8 @@ } -errors { } +set package_id [ad_conn package_id] + ad_proc -public getFolderKey { {-object_id:required} } { @@ -31,6 +33,7 @@ set context [list "Course Structure"] set title "Course Structure" + if {[db_0or1row manifest " select cp.man_id, @@ -48,14 +51,19 @@ end as isscorm, cp.fs_package_id, cp.folder_id, + cp.isshared, acs.creation_user, acs.creation_date, - acs.context_id + acs.context_id, + cpmc.isenabled, + cpmc.istrackable from - ims_cp_manifests cp, acs_objects acs + ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc where cp.man_id = acs.object_id and cp.man_id = :man_id + and cp.man_id = cpmc.man_id + and cpmc.lorsm_instance_id = :package_id and cp.parent_man_id = 0"]} { # Sets the variable for display. @@ -105,7 +113,7 @@ } -append orgs_list "" +append orgs_list "
" append orgs_list " @@ -129,25 +137,36 @@ } { - append orgs_list "" } - { metadata "" "no_sort" "" } + { title "Item Name" "no_sort" "" } + { Edit "Edit?" "no_sort" "\"}]"} + { metadata "Metadata?" "no_sort" "" } + { type "Type" "no_sort" "" } + { shared "Is Shared?" "no_sort" "" } } - set table_item [ad_table -Tmissing_text $missing_text -Ttable_extra_html $table_extra_html blah { + set table_item [ad_table -Tmissing_text $missing_text -Textra_vars $table_extra_vars -Theader_row_extra "style=\"background-color: #e0e0e0; font-weight: bold;\" class=\"list-header\"" -Ttable_extra_html $table_extra_html blah { SELECT o.object_id, - repeat(' ', (tree_level(tree_sortkey) - :indent)* 5) as indent, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 3) as indent, i.item_id, i.title as item_title, i.hasmetadata, i.org_id, + case + when i.isshared = 'f' then ( + 'false' + ) + else 'true' + end as isshared, case when i.identifierref <> '' then ( SELECT @@ -162,6 +181,20 @@ ) else '' end as identifierref, + case + when i.identifierref <> '' then ( + SELECT + res.type + FROM + ims_cp_items_to_resources i2r, + ims_cp_resources res + WHERE + i2r.res_id = res.res_id + AND + i2r.item_id = i.item_id +) + else '' + end as type, m.fs_package_id, m.folder_id, m.course_name @@ -192,6 +225,7 @@ append orgs_list "
Organization Metadata?
$org_title$hasmetadata" + append orgs_list "
$org_title$hasmetadata" set indent [expr $indent +1] set missing_text "Nothing here" - + set return_url [export_vars -base [ns_conn url] man_id] set table_extra_html { width="100%" } + + set table_extra_vars {return_url} set table_def { - { title "" "no_sort" "$indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}][if {$hasmetadata == \"f\"} {set hasmetadata \"\"} else {set hasmetadata \"Metadata\"}]$indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}][if {![empty_string_p $identifierref]} {set href \"Edit[if {$hasmetadata == \"f\"} {set hasmetadata \"No\"} else {set hasmetadata \"Metadata\"}]$type[if {$isshared == false} {set ret \"No\"}]
" +set enabler_url [export_vars -base enabler {man_id}] +set tracker_url [export_vars -base tracker {man_id}] +set sharer_url [export_vars -base sharer {man_id folder_id return_url}] - - Index: openacs-4/packages/lorsm/www/edit-content.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/edit-content.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/edit-content.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,48 @@ +# packages/lorsm/www/edit-content.tcl + +ad_page_contract { + + Online content editor for LORSm + + Uses htmlarea to edit html/txt file-storage + content + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-06 + @arch-tag: 6f57a7d1-7032-44e4-b333-6a7fb74ae30b + @cvs-id $Id: edit-content.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + folder_id:integer + fs_package_id:integer + identifierref + return_url +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] + +set folder [db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}] +set fs_root_folder [db_string sql {select file_storage__get_root_folder(:fs_package_id)}] +set identifierref [lorsm::fix_url -url $identifierref] +set pather $folder/$identifierref + +# in some case, the resource is defined with a / that conflicts with +# our existing / creating a double //. Therefore we use a regsub to +# get rid of it +regsub -all {//} $pather {/} pather + + +set file_id [db_string sql {select content_item__get_id(:pather, :fs_root_folder, 'f')}] + +# check for permissions +# By default, only the creator has admin access to content + +permission::require_write_permission -object_id $file_id -creation_user $user_id + +#ns_write "folder $folder\n pather: $pather \n file_id: $file_id" +#ad_script_abort + +ad_returnredirect [export_vars -base [apm_package_url_from_id $fs_package_id]file-content-edit {file_id return_url}] + Index: openacs-4/packages/lorsm/www/enabler.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/enabler.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/enabler.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,5 @@ + + @title@ + @context@ + + Index: openacs-4/packages/lorsm/www/enabler.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/enabler.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/enabler.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,67 @@ +# packages/lorsm/www/enabler.tcl + +ad_page_contract { + + enable/disable courses for a class + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-19 + @arch-tag ebea2a9b-b6d6-4083-83c5-58686ba9e201 + @cvs-id $Id: enabler.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + + + +set title "Set Course Trackable" +set context [list "Set Course Status"] + +ad_form -name enabler \ + -export {package_id} \ + -form { + {man_id:key} + {project:text(inform) + {label "Course Name:"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {isenabled:text(inform) + {label "Current Status:"} + } + {enable:text(radio) + {label Status?} + {options {{"Enable" t} {"Disable" f}}} + } + } -select_query { + select + case when isenabled = 't' then 'Enabled' + else 'Disabled' + end as isenabled + from ims_cp_manifest_class + where man_id = :man_id and + lorsm_instance_id = :package_id + } -edit_data { + db_dml do_update " + update ims_cp_manifest_class + set isenabled = :enable + where man_id = :man_id and + lorsm_instance_id = :package_id" + } -after_submit { + ad_returnredirect [site_node::get_url_from_object_id -object_id package_id] + ad_script_abort + } + + + + + Index: openacs-4/packages/lorsm/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/index.adp 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/index.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,15 +1,14 @@ + @title@ + @context@ - - - - + + Index: openacs-4/packages/lorsm/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/index.tcl 22 Apr 2004 03:58:09 -0000 1.1 +++ openacs-4/packages/lorsm/www/index.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,3 +1,5 @@ +# packages/lorsm/www/index.tcl + ad_page_contract { Learning Object Repository Management Index page @@ -8,6 +10,10 @@ } { } +set title "Manage Courses in Repository" +set context [list "Manage Courses"] + + set package_id [ad_conn package_id] set community_id [dotlrn_community::get_community_id] @@ -16,37 +22,49 @@ -community_id $community_id ] +set actions [list] + +if {$admin_p} { + lappend actions "Add Course" [export_vars -base "course-add"] "Add a IMS/SCORM Compliant Course" + lappend actions "Search Learning Objects" [export_vars -base "/search"] "Search for Learninng Objects in the Repository" + lappend actions "Available Courses" [export_vars -base "shared/"] "View Available Courses in the Repository" +} + template::list::create \ -name d_courses \ -multirow d_courses \ -html {width 50%} \ + -actions $actions \ -key man_id \ -no_data "No Courses" \ -elements { course_name { - label "Course Name" + label "Available Courses" display_col course_name link_url_eval {delivery/?[export_vars man_id]} link_html {title "Access Course"} } - course_structure { - label "Course Structure" - display_eval {\[view\]} - link_url_eval {course-structure?[export_vars man_id]} - link_html {title "Course Structure"} - html { align center } - } hasmetadata { label "Metadata?" link_url_eval {md/?[export_vars ims_md_id]} - link_html {title "See metadata"} + link_html {title "See metadata" } html { align center } } isscorm { label "SCORM?" html { align center } } + isenabled { + label "Status" + html { align center } + } + istrackable { + label "Tracking?" + link_url_eval {tracking/?[export_vars man_id]} + link_html {title "Track Student's Progress" class button} + html { align center } + } creation_user { label "Owner" display_eval {[person::name -person_id $creation_user]} @@ -59,12 +77,20 @@ export { label "Export" display_eval {\[zip\]} - link_url_eval {export/?[export_vars folder_id]} + link_url_eval {[export_vars -base export folder_id]} link_html {title "Export as IMS Content Package"} html { align center } } + admin { + label "Admin Course" + display_eval {Admin} + link_url_eval {[export_vars -base course-structure man_id]} + link_html {title "Admin Course" class button} + html { align center } + } } + db_multirow -extend { ims_md_id } d_courses select_d_courses { select cp.man_id, @@ -83,13 +109,25 @@ cp.folder_id, acs.creation_user, acs.creation_date, - acs.context_id + acs.context_id, + case + when cpmc.isenabled = 't' then 'Enabled' + else 'Disabled' + end as isenabled, + case + when cpmc.istrackable = 't' then 'Yes' + else 'No' + end as istrackable + from - ims_cp_manifests cp, acs_objects acs + ims_cp_manifests cp, acs_objects acs, ims_cp_manifest_class cpmc where cp.man_id = acs.object_id and - acs.context_id = :package_id + cp.man_id = cpmc.man_id + and + cpmc.community_id = :community_id + order by acs.creation_date desc } { set ims_md_id $man_id } Index: openacs-4/packages/lorsm/www/sharer.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/sharer.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/sharer.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,5 @@ + + @title@ + @context@ + + Index: openacs-4/packages/lorsm/www/sharer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/sharer.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/sharer.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,94 @@ +# packages/lorsm/www/sharer.tcl + +ad_page_contract { + + Enable sharing of courses, organizations and learning objects + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-09 + @arch-tag: 0d48cf78-3d5d-4a39-b2e0-2f090bfbecb8 + @cvs-id $Id: sharer.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + man_id:integer + folder_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +# check admin permisssion for the community +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id $user_id \ + -community_id $community_id ] + +# check write permisssion for the learning object/manifest +permission::require_write_permission -object_id $man_id -creation_user $user_id + + +set title "Share Course/Learning Object" +set context [list "Share Course/Learning Object"] + +ad_form -name sharer \ + -export {return_url folder_id} \ + -form { + {man_id:key} + {project:text(inform) + {label "Course Name:"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {isshared:text(inform) + {label "Current Status:"} + } + {share:text(radio) + {label Status?} + {options {{"Shared" t} {"Not Shared" f}}} + } + } -select_query { + select + case when isshared = 't' then 'Shared' + else 'Not Shared' + end as isshared + from ims_cp_manifests + where man_id = :man_id + } -edit_data { + db_transaction { + db_dml do_update { + update ims_cp_manifests + set isshared = :share + where man_id = :man_id } + + if {$share == "t"} { + + set party_id_students [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_student_profile_rel'}] + + permission::grant -party_id $party_id_students -object_id $man_id -privilege read + permission::grant -party_id $party_id_students -object_id $folder_id -privilege read + + + } else { + + set party_id_students [db_string party_id {select segment_id from rel_segments \ + where rel_type = 'dotlrn_student_profile_rel'}] + + permission::revoke -party_id $party_id_students -object_id $man_id -privilege read + permission::revoke -party_id $party_id_students -object_id $folder_id -privilege read + + } + } + } -after_submit { + ad_returnredirect $return_url + + } + + + + + + Index: openacs-4/packages/lorsm/www/tracker.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/tracker.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/tracker.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,7 @@ + + @title@ + @context@ + + + + Index: openacs-4/packages/lorsm/www/tracker.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/Attic/tracker.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/tracker.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,67 @@ +# packages/lorsm/www/tracker.tcl + +ad_page_contract { + + set a course for a class to be trackable + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-25 + @arch-tag 07ceb832-2053-4579-bec2-76708522707a + @cvs-id $Id: tracker.tcl,v 1.1 2004/09/04 14:51:21 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + + + +set title "Set Course Track Options" +set context [list "Set Course Options"] + +ad_form -name tracker \ + -export {package_id} \ + -form { + {man_id:key} + {project:text(inform) + {label "Course Name:"} + {value {[lorsm::get_course_name -manifest_id $man_id]}} + } + {istrackable:text(inform) + {label "Current Status:"} + } + {enable:text(radio) + {label Status?} + {options {{"Trackable?" t} {"No, Thanks" f}}} + } + } -select_query { + select + case when istrackable = 't' then 'Yes' + else 'No' + end as istrackable + from ims_cp_manifest_class + where man_id = :man_id and + lorsm_instance_id = :package_id + } -edit_data { + db_dml do_update " + update ims_cp_manifest_class + set istrackable = :enable + where man_id = :man_id and + lorsm_instance_id = :package_id" + } -after_submit { + ad_returnredirect [site_node::get_url_from_object_id -object_id package_id] + ad_script_abort + } + + + + + Index: openacs-4/packages/lorsm/www/delivery/body.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/body.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/body.adp 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/body.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,27 +1,24 @@ - - - + +
+ - - - - - - +

Welcome to @course_name@

+

- - - - - - - - - - -

Welcome to LEON
Course Delivery System for LORS -

- -

Click on the Course Index items to start your @course_name@ course.

- - + 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. Index: openacs-4/packages/lorsm/www/delivery/body.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/body.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/body.tcl 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/body.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -9,9 +9,58 @@ @arch-tag a20dffe3-6d54-4ece-858c-4529e82c163b @cvs-id $Id$ } { - course_name:notnull + man_id:notnull } -properties { } -validate { } -errors { } +set user_id [ad_conn user_id] +db_0or1row get_last_viewed { + select 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.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.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/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/exit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/exit.tcl 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,26 @@ +# 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 2004/09/04 14:51:21 ernieg Exp $ +} { + track_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +# stamps the time when leaving the delivery environment + +if {$track_id != 0} { + lorsm::track::exit -track_id $track_id +} + +# redirects +ad_returnredirect $return_url Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/footer.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/header.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/header.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/www/delivery/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/index.adp 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/index.adp 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,20 +1,8 @@ - - @course_name@ - - - - - - - +@course_name@ - - - <p><br /> - </p> - + + + - \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/delivery/index.tcl 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/delivery/index.tcl 4 Sep 2004 14:51:21 -0000 1.2 @@ -1,67 +1,57 @@ -# packages/lorsm/www/delivery/index.tcl +# packages/lorsm/www/delivery4/index.tcl ad_page_contract { - Course Delivery Based on IMS Content Packaging Structure + New index file using new tree menu - @author Ernie Ghiglione (ErnieG@mm.st) - @creation-date 2004-04-09 - @arch-tag cfea182c-c686-4bee-be61-ec73f3d3a10f + @author Roel Canicula (roelmc@info.com.ph) + @creation-date 2004-08-07 + @arch-tag: 64f3397b-4558-4298-a995-fc63e472f2a1 @cvs-id $Id$ } { - man_id:integer,notnull + man_id:integer,notnull + ims_id:integer,notnull,optional } -properties { } -validate { } -errors { } + +if { [info exists ims_id] } { + set item_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.man_id, cp.course_name, - cp.identifier, - cp.version, - text 'Yes' as hello, - case - when hasmetadata = 't' then 'Yes' - else 'No' - end as man_metadata, - case - when isscorm = 't' then 'Yes' - else 'No' - end as isscorm, - cp.fs_package_id, - cp.folder_id, - acs.creation_user, - acs.creation_date, - acs.context_id + cp.fs_package_id from - ims_cp_manifests cp, acs_objects acs + ims_cp_manifests cp where - cp.man_id = acs.object_id - and cp.man_id = :man_id + 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" + set course_name "No Course Name" } - - # Version - if {[empty_string_p $version]} { - set version "No version Available" - } - - # Instance - set instance [apm_package_key_from_id $fs_package_id] - - # Folder - set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] - } else { - - set display 0 - + 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] +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] +} else { + set track_id 0 +} Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/lists.css'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/lorsm_delivery.css'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/www/delivery/menu.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/menu.adp 4 Sep 2004 14:51:21 -0000 1.1 @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + Exit Course +  +


+ + + + + + Index: openacs-4/packages/lorsm/www/delivery/menu.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/menu.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/menu.tcl 4 Sep 2004 14:51:22 -0000 1.1 @@ -0,0 +1,182 @@ +# 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 2004/09/04 14:51:22 ernieg Exp $ +} { + man_id:integer,notnull + ims_id:integer,notnull,optional + track_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set counter 1 +set user_id [ad_conn user_id] + +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 + + 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.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 +} { + + set indent [expr $indent +1] + + db_foreach sql { + SELECT + (tree_level(tree_sortkey) - :indent) as indent, + i.item_id, + i.title as item_title + FROM + acs_objects o, ims_cp_items i + WHERE + o.object_type = 'ims_item' + AND + i.org_id = :org_id + AND + o.object_id = i.item_id + AND + EXISTS + (select 1 + from acs_object_party_privilege_map p + where p.object_id = i.item_id + and p.party_id = :user_id + and p.privilege = 'read') + + ORDER BY + o.object_id, tree_sortkey + } { + lappend js [list $indent $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"] +} + +# return_url +set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] Index: openacs-4/packages/lorsm/www/delivery/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/record-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/record-view.tcl 4 Sep 2004 14:51:22 -0000 1.1 @@ -0,0 +1,85 @@ +# 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 2004/09/04 14:51:22 ernieg 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 revision_id [item::get_best_revision $item_id] + +db_1row manifest_info "select fs_package_id, folder_id from ims_cp_manifests where man_id = :man_id" +set content_root [fs::get_root_folder -package_id $fs_package_id] + +set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + +set href [db_string href "select href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.item_id = :item_id and ir.res_id = r.res_id" -default ""] + +db_1row item_info "select title from ims_cp_items where item_id = :item_id" + +set fs_item_id [fs::get_item_id -folder_id $folder_id -name $href] + +# If no fs_item_id, this item is probably a folder +# Else deliver the page +if { ![empty_string_p $fs_item_id] } { + + set fs_revision_id [item::get_best_revision $fs_item_id] + set fs_item_mime [item::get_mime_info $fs_revision_id mime_info] + + + if { ![string equal -length 4 "text" $mime_info(mime_type)] } { + + # It's a file. + cr_write_content -revision_id $fs_revision_id + ad_script_abort + + } else { + + set href $url2$href + regsub -all {//} $href {/} href + set imsitem_id $item_id + + # lorsm::set_content_root content_root + lorsm::set_ims_item_id $item_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 {imsitem_id} ] + } +} else { + lorsm::set_ims_item_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 +} Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/toc.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/www/delivery/toc.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/www/delivery/Images/leaf.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/Images/leaf.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/Images/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/Images/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/Images/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/Images/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/index.html 4 Sep 2004 14:51:22 -0000 1.1 @@ -0,0 +1,275 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + + +
-

Courses

+

Courses in your Repository

+
+ + + + + + + + +
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/tigra/logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/logo.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/tree.js 4 Sep 2004 14:51:22 -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/tigra/tree_items.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/tree_items.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/tree_items.js 4 Sep 2004 14:51:22 -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/tigra/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/tree_tpl.js 4 Sep 2004 14:51:22 -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/tigra/ttm.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/ttm.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/compressed/readme.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/compressed/readme.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/compressed/readme.txt 4 Sep 2004 14:51:23 -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/tigra/compressed/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/compressed/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/compressed/tree.js 4 Sep 2004 14:51:23 -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/tigra/demo1/footer.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/footer.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/footer.html 4 Sep 2004 14:51:24 -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/tigra/demo1/header.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/header.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/header.html 4 Sep 2004 14:51:24 -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/tigra/demo1/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/index.html 4 Sep 2004 14:51:24 -0000 1.1 @@ -0,0 +1,21 @@ + + + JavaScript Tree Menu - Demo #1 (Frames Targeting) + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/links.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/links.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/links.html 4 Sep 2004 14:51:24 -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/tigra/demo1/logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/logo.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/pixel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/pixel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree.html 4 Sep 2004 14:51:24 -0000 1.1 @@ -0,0 +1,34 @@ + + + JavaScript Tree Menu + + + + + + + + + + + + + + + + + +
+ +
+ + + + Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree.js 4 Sep 2004 14:51:24 -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/tigra/demo1/tree_items.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree_items.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree_items.js 4 Sep 2004 14:51:24 -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/tigra/demo1/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo1/tree_tpl.js 4 Sep 2004 14:51:24 -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/tigra/demo1/ttm.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/ttm.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/base.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/base.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/empty.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/empty.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/folder.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/folderopen.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/folderopen.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/join.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/join.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/joinbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/joinbottom.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/line.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/line.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/minusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/minusbottom.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/page.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/page.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/plusbottom.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo1/icons/plusbottom.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/index.html,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo2/index.html 4 Sep 2004 14:51:25 -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/tigra/demo2/logo.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/logo.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/pixel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/pixel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree.js 4 Sep 2004 14:51:25 -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/tigra/demo2/tree_items.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree_items.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree_items.js 4 Sep 2004 14:51:25 -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/tigra/demo2/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/tigra/demo2/tree_tpl.js 4 Sep 2004 14:51:25 -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/tigra/demo2/ttm.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/ttm.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/empty.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/empty.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/folder.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/folder.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/folderopen.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/folderopen.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/foldersel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/foldersel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/page.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/page.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/pagesel.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/pagesel.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/tigra/demo2/icons/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery/view/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/view/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/view/index-oracle.xql 4 Sep 2004 14:51:26 -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/view/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/view/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/view/index-postgresql.xql 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + + select content_template__get_root_folder() + + + + + + Index: openacs-4/packages/lorsm/www/delivery/view/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery/view/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery/view/index.vuh 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,55 @@ +################################################# +ad_page_contract { + + @author Unknown + @creation-date Unknown + @cvs-id $Id: index.vuh,v 1.1 2004/09/04 14:51:26 ernieg Exp $ +} { + { imsitem_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 imsitem_id]} { + lorsm::set_ims_item_id $imsitem_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 imsitem_id [lorsm::get_ims_item_id] + +#ad_script_abort + +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. + +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 +} + Index: openacs-4/packages/lorsm/www/delivery1/body.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/body.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/body.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + +

Welcome to LEON
Course Delivery System for LORS +

+ +

Click on the Course Index items to start your @course_name@ course.

+ + Index: openacs-4/packages/lorsm/www/delivery1/body.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/body.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/body.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,17 @@ +# 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 2004/09/04 14:51:26 ernieg Exp $ +} { + course_name:notnull +} -properties { +} -validate { +} -errors { +} + Index: openacs-4/packages/lorsm/www/delivery1/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/exit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/exit.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,26 @@ +# 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 2004/09/04 14:51:26 ernieg Exp $ +} { + track_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +# stamps the time when leaving the delivery environment + +if {$track_id != 0} { + lorsm::track::exit -track_id $track_id +} + +# redirects +ad_returnredirect $return_url Index: openacs-4/packages/lorsm/www/delivery1/header.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/header.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/header.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + +
@course_name@
+ Exit Course + + Log Out + +
+ + + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery1/header.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/header.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/header.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,24 @@ +# packages/lorsm/www/delivery/header.tcl + +ad_page_contract { + + Course Delivery Header + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-04-09 + @arch-tag 3e231cd4-395e-428e-a3ba-ca52cf73a0dd + @cvs-id $Id: header.tcl,v 1.1 2004/09/04 14:51:26 ernieg Exp $ +} { + course_name:notnull + track_id:integer +} -properties { +} -validate { +} -errors { +} + +set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] + + +# urls +set exit_url "exit?[export_vars {return_url track_id}]" +set logout_url "exit?return_url=/register/logout&[export_vars track_id]" Index: openacs-4/packages/lorsm/www/delivery1/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/index.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,19 @@ + + + + @course_name@ + + + + + + + + + + <p>Sorry, your browser must support frames to view this page. + </p> + + + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery1/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/index.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,82 @@ +# packages/lorsm/www/delivery/index.tcl + +ad_page_contract { + + Course Delivery Based on IMS Content Packaging Structure + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-04-09 + @arch-tag cfea182c-c686-4bee-be61-ec73f3d3a10f + @cvs-id $Id: index.tcl,v 1.1 2004/09/04 14:51:26 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} +if {[db_0or1row manifest " + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + text 'Yes' as hello, + case + when hasmetadata = 't' then 'Yes' + else 'No' + end as man_metadata, + case + when isscorm = 't' then 'Yes' + else 'No' + end as isscorm, + cp.fs_package_id, + cp.folder_id, + acs.creation_user, + acs.creation_date, + acs.context_id + from + ims_cp_manifests cp, acs_objects acs + where + cp.man_id = acs.object_id + and 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" + } + + # Version + if {[empty_string_p $version]} { + set version "No version Available" + } + + # Instance + set instance [apm_package_key_from_id $fs_package_id] + + # Folder + set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] + + # Student tracking + set package_id [ad_conn package_id] + set community_id [dotlrn_community::get_community_id] + set user_id [ad_conn user_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] + } else { + set track_id 0 + } + +} else { + + set display 0 + +} + + Index: openacs-4/packages/lorsm/www/delivery1/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/record-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/record-view.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,24 @@ +# packages/lorsm/www/delivery/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 2004/09/04 14:51:26 ernieg Exp $ +} { + item_id:notnull + redirect_url:notnull +} -properties { +} -validate { +} -errors { +} + +set viewer_id [ad_conn user_id] + +set views [views::record_view -object_id $item_id -viewer_id $viewer_id] + +ad_returnredirect $redirect_url Index: openacs-4/packages/lorsm/www/delivery1/toc.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/toc.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/toc.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + +@table_item;noquote@ +
+ + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery1/toc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery1/toc.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery1/toc.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,126 @@ +# packages/lorsm/www/delivery/toc.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: toc.tcl,v 1.1 2004/09/04 14:51:26 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + +set table_item "" +set package_id [ad_conn package_id] + +# In order to share courses across classes, we need to share +# file-storage objects across file-storage instances. This has been +# proven to be really tricky. But here we pass the fs_package_id for +# the current community, so we don't have to have permissions for +# other instances of file-storages of other classes. See +# documentation for further details. + +set community_id [dotlrn_community::get_community_id] +set fs_local_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"\ + ] +set track_id [lorsm::track::istrackable -course_id $man_id -package_id $package_id] + +set extra_vars fs_local_package_id + + +db_foreach organizations { + select + org.org_id, + 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 +} { + + set indent [expr $indent +1] + set missing_text "Nothing here" + + set table_extra_html { width="100%" } + # the table_def isn't quite neat as I'd like to, but it does the job for a + # simple indexing for delivery. + set table_def { + { title "" "no_sort" "
$indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}]
\n\n\n"); + +// This is for defining the number of columns of the ToC table and the width of the last one. The first cells of each following row shall be empty or contain the heading symbol, the last ones are reserved for displaying the heding's text: + for (k=0; k "); + } + toc.document.write(""); + +// currentLevel = the level of the current heading: + var currentNumArray = currentNumber.split("."); + var currentLevel = currentNumArray.length-1; + +// currentIndex = Current heading's index in the tocTab array: + var currentIndex = null; + for (i=0; i currentLevel && toDisplay[currentIndex+1]; + } + else currentIsExpanded = false; + +// Determining the new URL and target (if given) of the current heading + theHref = (noLink) ? "" : tocTab[currentIndex][2]; + theTarget = tocTab[currentIndex][3]; + +// *************************************** +// 1st loop over the tocTab entries: Determining which heading to display: +// *************************************** + for (i=1; i 0) { + for (j=0; jcurrentLevel) ? false : isOnPath && (thisNumArray[j] == currentNumArray[j]); + } + } +// By the following, the headings on the path to the current heading and the siblings of such headings (isOnPath==true, see above) will be displayed anyway. If the tocChange parameter is set to 1 no other heading will be displayed. If it is set to a number greater than 1 the headings that have been displayed before will additionally be displayed again. + toDisplay[i] = (tocChange == 1) ? isOnPath : (isOnPath || toDisplay[i]); + +// Now let's perform the expand/collaps mechanism: If the heading is a descendant of the current heading it's next display depends on wether the current heading was expanded or collapsed. If it was expanded the descendants have not to be displayed this time, otherwise only the childs has to be displayed but not the grandchildren, great-grandchildren etc.. Remember that currentIsExpanded says wether the current heading was expanded or not. The if-clause is a criteria for being a descendant of the current heading. If it's a descendant and thisLevel == currentLevel+1 it's a child. + if (thisNumber.indexOf(currentNumber+".")==0 && thisLevel > currentLevel) { + if (currentIsExpanded) toDisplay[i] = false; + else toDisplay[i] = (thisLevel == currentLevel+1); + } + } + } // End of loop over the tocTab + +// *************************************** +// 2nd loop over the tocTab entries: Displaying the headings: +// *************************************** + var scrollY=0, addScroll=tocScroll; + for (i=1; i= nextLevel) ? "leaf" : ((toDisplay[i+1]) ? "minus" : "plus"); + } + else img = "leaf"; // The last heading is always a leaf. + +// If the scoll parameter is set true than increment the scrollY value: + if (addScroll) scrollY+=((thisLevel<2)?mdi:sml)*25; + if (isCurrent) addScroll=false; + +// thisTextColor = the text color of this heading + if (noLink) + thisTextColor = (thisNumber==oldCurrentNumber) ? currentColor:((thisNumber==oldLastVisitNumber) ? lastVisitColor:normalColor); + else thisTextColor = (thisNumber==currentNumber) ? currentColor:((thisNumber==oldCurrentNumber) ? lastVisitColor:normalColor); + +// Now writing this ToC line, i.e. a table row...: + toc.document.writeln(""); + +// ...first some empty cells for the line indent depending on the level of this heading...: + for (k=1; k<=thisLevel; k++) { + toc.document.writeln(""); + } + +// ...then the hading symbol and the heading text each with a javaScript link caling just this function reDisplay again: + toc.document.writeln(""); + } + } // End of loop over the tocTab + +// *************************************** +// Closing the ToC document, scrolling its frame window and displaying new content in the content frame or in the top window if required +// *************************************** + +// Updating the global variables oldCurrentNumber and oldLastVisitNumber. See above for its definition + if (!noLink) { + oldLastVisitNumber = oldCurrentNumber; + oldCurrentNumber = currentNumber; + } + +// Closing the ToC table and the document + toc.document.writeln("
" + tocTab[0][1] + "
 
  " + tocTab[i][1] + "
\n"); + toc.document.close(); + +// Scrolling the ToC if required + if (tocScroll) toc.scroll(0,scrollY); + +// Setting the top or content window's location if required + if (theHref) + if (theTarget=="top") top.location.href = theHref; + else if (theTarget=="parent") parent.location.href = theHref; + else if (theTarget=="blank") open(theHref,""); + else content.location.href = theHref; +} \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery2/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/exit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/exit.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,26 @@ +# 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 2004/09/04 14:51:26 ernieg Exp $ +} { + track_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +# stamps the time when leaving the delivery environment + +if {$track_id != 0} { + lorsm::track::exit -track_id $track_id +} + +# redirects +ad_returnredirect $return_url Index: openacs-4/packages/lorsm/www/delivery2/header.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/header.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/header.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + +
@course_name@
+ Exit Course + + Log Out + +
+ + + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery2/header.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/header.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/header.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,24 @@ +# packages/lorsm/www/delivery/header.tcl + +ad_page_contract { + + Course Delivery Header + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-04-09 + @arch-tag 3e231cd4-395e-428e-a3ba-ca52cf73a0dd + @cvs-id $Id: header.tcl,v 1.1 2004/09/04 14:51:26 ernieg Exp $ +} { + course_name:notnull + track_id:integer +} -properties { +} -validate { +} -errors { +} + +set return_url [dotlrn_community::get_community_url [dotlrn_community::get_community_id]] + + +# urls +set exit_url "exit?[export_vars {return_url track_id}]" +set logout_url "exit?return_url=/register/logout&[export_vars track_id]" Index: openacs-4/packages/lorsm/www/delivery2/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/index.adp 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,19 @@ + + +@course_name@ + + + + + + + + + + + + Index: openacs-4/packages/lorsm/www/delivery2/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/index.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,222 @@ +# 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: index.tcl,v 1.1 2004/09/04 14:51:26 ernieg Exp $ +} { + man_id:integer,notnull +} -properties { +} -validate { +} -errors { +} + + +set package_id [ad_conn package_id] + +# In order to share courses across classes, we need to share +# file-storage objects across file-storage instances. This has been +# proven to be really tricky. But here we pass the fs_package_id for +# the current community, so we don't have to have permissions for +# other instances of file-storages of other classes. See +# documentation for further details. + +set community_id [dotlrn_community::get_community_id] +set fs_local_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"\ + ] + + +if {[db_0or1row manifest " + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + text 'Yes' as hello, + case + when hasmetadata = 't' then 'Yes' + else 'No' + end as man_metadata, + case + when isscorm = 't' then 'Yes' + else 'No' + end as isscorm, + cp.fs_package_id, + cp.folder_id, + acs.creation_user, + acs.creation_date, + acs.context_id + from + ims_cp_manifests cp, acs_objects acs + where + cp.man_id = acs.object_id + and 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" + } + + # Version + if {[empty_string_p $version]} { + set version "No version Available" + } + + # Instance + set instance [apm_package_key_from_id $fs_package_id] + + # Folder + set folder [apm_package_url_from_id $fs_package_id]?[export_vars folder_id] + + # Student tracking + set package_id [ad_conn package_id] + set community_id [dotlrn_community::get_community_id] + set user_id [ad_conn user_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] + } else { + set track_id 0 + } + +} else { + + set display 0 + +} + + + +db_foreach organizations { + select + org.org_id, + 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 +} { + + set indent [expr $indent +1] + + db_foreach sql { + SELECT + (tree_level(tree_sortkey) - :indent) as indent, + i.item_id, + i.title as item_title + FROM + acs_objects o, ims_cp_items i + WHERE + o.object_type = 'ims_item' + AND + i.org_id = :org_id + AND + o.object_id = i.item_id + AND + EXISTS + (select 1 + from acs_object_party_privilege_map p + where p.object_id = i.item_id + and p.party_id = :user_id + and p.privilege = 'read') + + ORDER BY + o.object_id, tree_sortkey + } { + lappend js_file [list $indent $item_id $item_title] + } +} + + +if {![exists_and_not_null js]} { + + set js [list] + # the first element must be blank + lappend js [list 0 0 "Course Index"] + +} + +foreach one $js_file { + lappend js [list [lindex $one 0] [lindex $one 1] [lindex $one 2]] +# ns_write "[lindex $one 0] [lindex $one 1] [lindex $one 2]\n" +} + + +set counter 0 +set counterx 0 +set maxcols 0 +set jsfile "var tocTab = new Array();\n" + +foreach one $js { + + if {[lindex $one 0] != 0 } { + + for {set x [lindex [lindex $js [expr $counter -1]] 0]} {$x < [lindex $one 0]} {incr x} { + set counterx [concat $counterx.$x] + } + + for {set x [lindex [lindex $js [expr $counter -1]] 0]} {$x > [lindex $one 0]} {set x [expr $x -1]} { + + set counterx [string range $counterx 0 [expr [string length $counterx] - [expr 1 + [string length [file extension $counterx]]]]] + + } + + + if { [lindex [lindex $js [expr $counter -1]] 0] >= [lindex $one 0]} { + + set subnum [string range $counterx [expr [string length $counterx] -1] [string length $counterx]] + set subnum [expr $subnum + 1] + set counterx [string replace $counterx [expr [string length $counterx] -1] [string length $counterx] $subnum] + + } + + + } else { + set counterx $counter + } + + set item_id [lindex $one 1] + + if {[lindex $one 1] == 0} { + + set url "" + + } else { + + set url [export_vars -base record-view {man_id item_id}] + + } + + set jsfile [concat $jsfile "tocTab\[$counter\] = new Array (\"$counterx\", \"[lindex $one 2]\", \"$url\"); \n"] + incr counter + + # maxcols + + if {[lindex $one 0] > $maxcols} { + set maxcols [lindex $one 0] + } + +} + +set jsfile [concat $jsfile "var nCols = [expr $maxcols + 1];"] + + +#ns_write $jsfile \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery2/record-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/record-view.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/record-view.tcl 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,85 @@ +# 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 2004/09/04 14:51:26 ernieg 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 revision_id [item::get_best_revision $item_id] + +db_1row manifest_info "select fs_package_id, folder_id from ims_cp_manifests where man_id = :man_id" +set content_root [fs::get_root_folder -package_id $fs_package_id] + +set url2 "[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/" + +set href [db_string href "select href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.item_id = :item_id and ir.res_id = r.res_id" -default ""] + +db_1row item_info "select title from ims_cp_items where item_id = :item_id" + +set fs_item_id [fs::get_item_id -folder_id $folder_id -name $href] + +# If no fs_item_id, this item is probably a folder +# Else deliver the page +if { ![empty_string_p $fs_item_id] } { + + set fs_revision_id [item::get_best_revision $fs_item_id] + set fs_item_mime [item::get_mime_info $fs_revision_id mime_info] + + + if { ![string equal -length 4 "text" $mime_info(mime_type)] } { + + # It's a file. + cr_write_content -revision_id $fs_revision_id + ad_script_abort + + } else { + + set href $url2$href + regsub -all {//} $href {/} href + set imsitem_id $item_id + + # lorsm::set_content_root content_root + lorsm::set_ims_item_id $item_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 ../delivery/view/$href {imsitem_id} ] + } +} else { + lorsm::set_ims_item_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/delivery2/tocParas.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/tocParas.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/tocParas.js 4 Sep 2004 14:51:26 -0000 1.1 @@ -0,0 +1,16 @@ +/* These are the parameters to define the appearance of the ToC. */ +var + showNumbers = true, // display the ordering strings: yes=true | no=false + backColor = "#6C9A83", // background color of the ToC + normalColor = "#FFFFFF", // text color of the ToC headlines + lastVisitColor = "#FFFFBB", // text color of the line last visited + currentColor = "#FFFF00", // text color of the actual line just clicked on + titleColor = "#FFFFFF", // text color of the title "Table of Contents" + mLevel = 1, // number of levels minus 1 the headlines of which are presentet with large and bold fonts + textSizes = new Array(1, 0.7, 0.6, 0.7, 0.6), // font-size factors for: [0] the title "Table of Contents", [1] larger and bold fonts [2] smaller fonts if MS Internet Explorer [3] larger and bold fonts [4] smaller fonts if Netscape Navigator. + fontTitle = "Helvetica,Arial", // font-family of the title "Table of Contents" + fontLines = "Helvetica,Arial", // font-family of the headlines + tocScroll=true, // Automatic scrolling of the ToC frame (true) or not(false) + tocBehaviour = new Array(1,0), // Indicates how the ToC shall change when clicking in the heading symbol (1st arg.) resp. in the heading text (2nd arg). Arg's meaning: 0 = No change, 1 = ToC changes with automatic collapsing, 2 = ToC changes with no automatic collapsing. + tocLinks = new Array(1,0); // Indicates wether the content's location shall be changed when clicking in the heading symbol (1st arg.) resp. in the heading text (2nd arg). Arg's meaning: 1 = No, 0 = Yes. + \ No newline at end of file Index: openacs-4/packages/lorsm/www/delivery2/Images/leaf.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/Images/leaf.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery2/Images/minus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/Images/minus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery2/Images/plus.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/Images/plus.gif,v diff -u Binary files differ Index: openacs-4/packages/lorsm/www/delivery2/view/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/view/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/view/index-oracle.xql 4 Sep 2004 14:51:28 -0000 1.1 @@ -0,0 +1,15 @@ + + + + oracle8.1.6 + + + + + select content_template.get_root_folder from dual + + + + + + Index: openacs-4/packages/lorsm/www/delivery2/view/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/view/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/view/index-postgresql.xql 4 Sep 2004 14:51:28 -0000 1.1 @@ -0,0 +1,15 @@ + + + + postgresql7.1 + + + + + select content_template__get_root_folder() + + + + + + Index: openacs-4/packages/lorsm/www/delivery2/view/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/delivery2/view/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/delivery2/view/index.vuh 4 Sep 2004 14:51:28 -0000 1.1 @@ -0,0 +1,51 @@ +################################################# +ad_page_contract { + + @author Unknown + @creation-date Unknown + @cvs-id $Id: index.vuh,v 1.1 2004/09/04 14:51:28 ernieg Exp $ +} { + { imsitem_id "" } +} + +# +if {[info exists imsitem_id]} { + lorsm::set_ims_item_id $imsitem_id +} + +# Get the paths +set the_root [ns_info pageroot] +set the_url [ad_conn path_info] +set content_type "content_revision" + +# Get the IDs +set content_root [lindex [nsv_get delivery_vars [ad_conn session_id]] 0] +set imsitem_id [lorsm::get_ims_item_id] + +#ad_script_abort + +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. + +if { [lorsm::init the_url the_root $content_root $template_root public "" $content_type] } { + + # we introduced our own template + rp_internal_redirect -absolute_path /home/ernieg/web/concord/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 +} + Index: openacs-4/packages/lorsm/www/export/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/export/Attic/index.vuh,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/export/index.vuh 22 Apr 2004 03:58:12 -0000 1.1 +++ openacs-4/packages/lorsm/www/export/index.vuh 4 Sep 2004 14:51:28 -0000 1.2 @@ -12,9 +12,15 @@ {folder_id:integer,optional} } +set user_id [ad_conn user_id] + +# check write permisssion to export the course + + # Based on Yun's file system exports if {[exists_and_not_null folder_id]} { + permission::require_write_permission -object_id $folder_id -creation_user $user_id set download_name [fs::get_file_system_safe_object_name -object_id $folder_id] # We get rid of spaces since they are annoying Index: openacs-4/packages/lorsm/www/lib/repository-shared-courses.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/lib/Attic/repository-shared-courses.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/lib/repository-shared-courses.adp 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,3 @@ + + + Index: openacs-4/packages/lorsm/www/lib/repository-shared-courses.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/lib/Attic/repository-shared-courses.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/lib/repository-shared-courses.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,97 @@ +# packages/lorsm/www/lib/repository-shared-courses.tcl + +ad_page_contract { + + List all the shared courses in the repository + View shared courses + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-09 + @arch-tag: 9dd389d3-195f-49ed-b610-ee893cde06d6 + @cvs-id $Id: repository-shared-courses.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ +} { + +} -properties { +} -validate { +} -errors { +} + + +set title "Shared Courses" +set context [list "Shared Courses"] + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + +set com_url [dotlrn_community::get_community_url $community_id] + +template::list::create \ + -name d_courses \ + -multirow d_courses \ + -html {width 50%} \ + -key man_id \ + -no_data "No Courses" \ + -elements { + course_name { + label "Available Courses" + display_col course_name + link_url_eval {[export_vars -base $community_url/lorsm/shared/course-info {man_id fs_package_id folder_id}]} + link_html {title "Access Course"} + + } + hasmetadata { + label "Metadata?" + link_url_eval {[export_vars -base $community_url/lorsm/md {ims_md_id}]} + link_html {title "See metadata" } + html { align center } + } + creation_user { + label "Owner" + display_eval {[person::name -person_id $creation_user]} + link_url_eval {[acs_community_member_url -user_id $creation_user]} + } + creation_date { + label "Creation Date" + display_eval {[lc_time_fmt $creation_date "%x %X"]} + } + admin { + label "Course Info" + display_eval {Info/View} + link_url_eval {[export_vars -base $community_url/lorsm/shared/course-info man_id]} + link_html {title "Info" class button} + html { align center } + } + } + + +db_multirow -extend { ims_md_id community_url } d_courses select_d_courses { + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + case + when hasmetadata = 't' then 'Yes' + else 'No' + end as hasmetadata, + cp.fs_package_id, + cp.folder_id, + acs.creation_user, + acs.creation_date, + acs.context_id + from + ims_cp_manifests cp, acs_objects acs + where + cp.man_id = acs.object_id + and + cp.isshared = 't' + order by acs.creation_date desc +} { + set ims_md_id $man_id + set community_url $com_url +} + Index: openacs-4/packages/lorsm/www/md/general_title.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/general_title.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/md/general_title.adp 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,29 @@ + +@title;noquote@ +@context;noquote@ + + + +
+ +

List of General Metadata Titles

+
+ + + + + + + + + +
General Metadata
Titles:
+
+

+ +

Add/Edit General Metadata Title

+
+ +
Index: openacs-4/packages/lorsm/www/md/general_title.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/general_title.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/md/general_title.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,103 @@ +# packages/lorsm/www/md/general_title.tcl + +ad_page_contract { + + Add/Edit General MD Title + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-03 + @arch-tag 1956d02e-511a-470c-81d0-c2857242651c + @cvs-id $Id: general_title.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ +} { + ims_md_id:integer + ims_md_ge_ti_id:integer,optional +} -properties { +} -validate { +} -errors { +} + +# set context & title +if { ![ad_form_new_p -key ims_md_ge_ti_id]} { + set context [list "IMS Metadata Editor - General MD"] + set title "Edit General MD Title" +} else { + set context [list "IMS Metadata Editor - General MD"] + set title "Add General MD Title" +} + +# Form + +ad_form -name generalmd_title \ + -cancel_url index \ + -mode edit \ + -form { + + ims_md_ge_ti_id:key(ims_md_general_title_seq) + + {title_l:text,nospell,optional + {section "Add/Edit General MD Title"} + {html {size 10}} + {help_text "i.e.: 'en_AU' for Australian English"} + {label "Language:"} + } + + {title_s:text,nospell + {html {size 50}} + {label "Title:"} + } + + {ims_md_id:text(hidden) + } + +} -select_query {select * from ims_md_general_title where ims_md_ge_ti_id = :ims_md_ge_ti_id and ims_md_id = :ims_md_id + +} -edit_data { + db_dml do_update " + update ims_md_general_title + set title_l = :title_l, title_s = :title_s + where ims_md_ge_ti_id = :ims_md_ge_ti_id " +} -new_data { + db_dml do_insert " + insert into ims_md_general_title (ims_md_ge_ti_id, ims_md_id, title_l, title_s) + values + (:ims_md_ge_ti_id, :ims_md_id, :title_l, :title_s)" + +} -after_submit { + ad_returnredirect [export_vars -base "general_title" {ims_md_id}] + ad_script_abort +} + +# General Title +template::list::create \ + -name d_gen_titles \ + -multirow d_gen_titles \ + -no_data "No Titles Available" \ + -html { align right style "width: 100%;" } \ + -elements { + title_l { + label "" + } + title_s { + label "" + } + export { + display_eval {\[Edit\]} + link_url_eval { [export_vars -base "general_title" {ims_md_ge_ti_id ims_md_id}] } + link_html {title "Edit Record "} + html { align center } + } + } + +db_multirow d_gen_titles select_ge_titles { + select title_l, + title_s, + ims_md_ge_ti_id, + ims_md_id + from + ims_md_general_title + where + ims_md_id = :ims_md_id +} { + set item_url [export_vars -base "item" { ims_md_id }] +} + Index: openacs-4/packages/lorsm/www/md/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/md/index.adp 22 Apr 2004 03:58:13 -0000 1.1 +++ openacs-4/packages/lorsm/www/md/index.adp 4 Sep 2004 14:51:29 -0000 1.2 @@ -5,3 +5,12 @@ +

+ + You can upload a XML LOM metadata node to add/change the metadata for this record. + +
+ + Here's a link to the actual element + + Index: openacs-4/packages/lorsm/www/md/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/md/Attic/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/lorsm/www/md/index.tcl 22 Apr 2004 03:58:13 -0000 1.1 +++ openacs-4/packages/lorsm/www/md/index.tcl 4 Sep 2004 14:51:29 -0000 1.2 @@ -11,4 +11,9 @@ # set context set context [list "IMS Metadata Editor"] -set title "IMS Metadata Editor" \ No newline at end of file +set title "IMS Metadata Editor" +set link [export_vars -base "md_upload" ims_md_id] + +set write_p [permission::permission_p -party_id [ad_conn user_id] -object_id $ims_md_id -privilege write] + +set read_p [permission::permission_p -party_id [ad_conn user_id] -object_id $ims_md_id -privilege read] Index: openacs-4/packages/lorsm/www/shared/add-shared-course-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/add-shared-course-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/add-shared-course-2.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,51 @@ +# packages/lorsm/www/shared/add-shared-course-2.tcl + +ad_page_contract { + + Adds an existing course to a .LRN class + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-13 + @arch-tag: efa8621f-daa6-4743-9711-28a4195232ec + @cvs-id $Id: add-shared-course-2.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ +} { + man_id:integer + return_url +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] +set class_key [dotlrn_community::get_community_type_from_community_id $community_id] + +# check admin permisssion for the community +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id $user_id \ + -community_id $community_id ] + +# check if the course is actually shared +if {[db_string isshared {select isshared from ims_cp_manifests where man_id = :man_id}] == "f"} { + # if it ain't complain and quit + ad_complain "The course you are trying to add to your class is not shared." + +} + +# check if the course is already added as course for this class + +if {![db_0or1row exists {select man_id, lorsm_instance_id from ims_cp_manifest_class where man_id = :man_id \ + and lorsm_instance_id = :package_id \ + and community_id = :community_id}]} { + ad_complain "The course [lorsm::get_course_name -manifest_id $man_id], is already part of your class" + + +} + +db_dml add-course {insert into ims_cp_manifest_class \ + (man_id, lorsm_instance_id, community_id, class_key, isenabled, istrackable) \ + values \ + (:man_id, :package_id, :community_id, :class_key, 't', 'f')} + +ad_returnredirect $return_url \ No newline at end of file Index: openacs-4/packages/lorsm/www/shared/add-shared-course.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/add-shared-course.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/add-shared-course.adp 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,13 @@ + + @title@ + @context@ + +

You are about to add @course_name@ to your class.

+

+Confirm? +

+ + + +
+ Index: openacs-4/packages/lorsm/www/shared/add-shared-course.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/add-shared-course.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/add-shared-course.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,51 @@ +# packages/lorsm/www/shared/add-shared-course.tcl + +ad_page_contract { + + Adds an existing shared course to a .LRN class + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-12 + @arch-tag: 9f1edd88-ff55-4328-8f3b-6d014351e48a + @cvs-id $Id: add-shared-course.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ +} { + man_id:integer +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_conn user_id] +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] +set class_key [dotlrn_community::get_community_type_from_community_id $community_id] + +# check admin permisssion for the community +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id $user_id \ + -community_id $community_id ] + +# check if the course is actually shared +if {[db_string isshared {select isshared from ims_cp_manifests where man_id = :man_id}] == "f"} { + # if it ain't complain and quit + ad_complain "The course you are trying to add to your class is not shared." + +} + +# check if the course is already added as course for this class + +if {![db_0or1row exists {select man_id, lorsm_instance_id from ims_cp_manifest_class where man_id = :man_id \ + and lorsm_instance_id = :package_id \ + and community_id = :community_id}]} { + ad_complain "The course [lorsm::get_course_name -manifest_id $man_id], is already part of your class" + + +} + +set title "Add Course Confirmation" +set course_name [lorsm::get_course_name -manifest_id $man_id] + +set context [list [list [export_vars -base .] "Shared Courses"] [list [export_vars -base course-info {man_id}] "Preview Course: $course_name"] "Confirmation"] + +set return_url [site_node::get_url_from_object_id -object_id $package_id] + Index: openacs-4/packages/lorsm/www/shared/course-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/course-info.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/course-info.adp 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,123 @@ + + @title;noquote@ + @context;noquote@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Course Information +
+ Course Name: + + @course_name;noquote@ +
+ Version: + + @version;noquote@ +
+ Metadata?: + + + Yes + + + No + +
+ Identifier: + + @identifier@ +
+ Is SCORM?: + + class="list" style="font-weight: bold;" + + + class="list" + + valign="top" align="left">@isscorm;noquote@ +
+ Created By: + + @created_by@ +
+ Date: + + @creation_date;noquote@ +
+ Submanifests: + + @submanifests@ +
+ Add course to my class now: + + + + Course already part of your class +
+ Organizations +
+ +
+ @orgs_list;noquote@ +
+
+ +
Index: openacs-4/packages/lorsm/www/shared/course-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/course-info.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/course-info.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,232 @@ +# packages/lorsm/www/shared/course-info.tcl + +ad_page_contract { + + Previews course + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-09 + @arch-tag: 9687443a-686e-4784-9702-5c00ee0bdc88 + @cvs-id $Id: course-info.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ + } { + man_id:integer +} -properties { +} -validate { +} -errors { +} + + +set context [list [list [export_vars -base .] "Shared Courses"] "Preview Course"] +set title "Preview Course" + +# In order to share courses across classes, we need to share +# file-storage objects across file-storage instances. This has been +# proven to be really tricky. But here we pass the fs_package_id for +# the current community, so we don't have to have permissions for +# other instances of file-storages of other classes. See +# documentation for further details. + +set community_id [dotlrn_community::get_community_id] +set fs_local_package_id [site_node_apm_integration::get_child_package_id \ + -package_id [dotlrn_community::get_package_id $community_id] \ + -package_key "file-storage"\ + ] + +# Checks whether this course is already in use on this community + + +set active [db_0or1row check " + select + man_id, + community_id, + lorsm_instance_id + from + ims_cp_manifest_class + where + man_id = :man_id + and + community_id = :community_id"] + + + +if {[db_0or1row manifest " + select + cp.man_id, + cp.course_name, + cp.identifier, + cp.version, + text 'Yes' as hello, + case + when hasmetadata = 't' then 'Yes' + else 'No' + end as man_metadata, + case + when isscorm = 't' then 'Yes' + else 'No' + end as isscorm, + cp.isshared, + acs.creation_user, + acs.creation_date, + acs.context_id + from + ims_cp_manifests cp, acs_objects acs + where + cp.man_id = acs.object_id + and cp.man_id = :man_id + and cp.parent_man_id = 0"]} { + + # Sets the variable for display. + set display 1 + + # Course Name + if {[empty_string_p $course_name]} { + set course_name "No course Name" + } + + # Version + if {[empty_string_p $version]} { + set version "No version Available" + } + + # Created By + set created_by [person::name -person_id $creation_user] + + # Creation Date + set creation_date [lc_time_fmt $creation_date "%x %X"] + + # Check for submanifests + if {[db_0or1row submans " + select + count(*) as submanifests + from + ims_cp_manifests + where + man_id = :man_id + and + parent_man_id = :man_id"]} { + } else { + set submanifests 0 + } + + +} else { + + set display 0 + +} + + +append orgs_list "" +append orgs_list " + + + + +" +db_foreach organizations { + select + org.org_id, + 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 +} { + + + append orgs_list "" } + { metadata "Metadata?" "no_sort" "" } + { type "Type" "no_sort" "" } + } + + set table_item [ad_table -Tmissing_text $missing_text -Textra_vars $table_extra_vars -Theader_row_extra "style=\"background-color: #e0e0e0; font-weight: bold;\" class=\"list-header\"" -Ttable_extra_html $table_extra_html blah { + SELECT + o.object_id, + repeat(' ', (tree_level(tree_sortkey) - :indent)* 3) as indent, + i.item_id, + i.title as item_title, + i.hasmetadata, + i.org_id, + case + when i.isshared = 'f' then ( + 'false' + ) + else 'true' + end as isshared, + case + when i.identifierref <> '' then ( + SELECT + res.href + FROM + ims_cp_items_to_resources i2r, + ims_cp_resources res + WHERE + i2r.res_id = res.res_id + AND + i2r.item_id = i.item_id +) + else '' + end as identifierref, + case + when i.identifierref <> '' then ( + SELECT + res.type + FROM + ims_cp_items_to_resources i2r, + ims_cp_resources res + WHERE + i2r.res_id = res.res_id + AND + i2r.item_id = i.item_id +) + else '' + end as type, + m.fs_package_id, + m.folder_id, + m.course_name + FROM + acs_objects o, ims_cp_items i, ims_cp_manifests m + WHERE + o.object_type = 'ims_item' + AND + i.org_id = :org_id + AND + o.object_id = i.item_id + AND + m.man_id = :man_id + ORDER BY + tree_sortkey, object_id + + + } $table_def] + + append orgs_list "$table_item" + + + append orgs_list "" + +} if_no_rows { + append orgs_list "" +} + +append orgs_list "
OrganizationMetadata?Items
$org_title$hasmetadata" + + set indent [expr $indent +1] + set missing_text "Nothing here" + set return_url [export_vars -base [ns_conn url] man_id] + set table_extra_html { width="100%" } + + set track_id 0 + set table_extra_vars {return_url fs_local_package_id track_id} + set table_def { + { title "" "no_sort" "$indent[if {![empty_string_p $identifierref]} {set href \"$item_title\"} else {set href $item_title}][if {$hasmetadata == \"f\"} {set hasmetadata \"No\"} else {set hasmetadata \"Metadata\"}]$type
" + +set shared_url [export_vars -base add-shared-course {man_id}] + + Index: openacs-4/packages/lorsm/www/shared/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/index.adp 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,15 @@ + + @title@ + @context@ + + + + + + + +
+

Shared Courses in the Repository

+
+ +
Index: openacs-4/packages/lorsm/www/shared/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/shared/Attic/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/shared/index.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,20 @@ +# packages/lorsm/www/shared/index.tcl + +ad_page_contract { + + View shared courses + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-07-09 + @arch-tag: 6222c3f4-af54-44a3-a84e-de89740c9aaa + @cvs-id $Id: index.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ +} { + +} -properties { +} -validate { +} -errors { +} + +set title "Shared Courses" +set context [list "Shared Courses"] + Index: openacs-4/packages/lorsm/www/tracking/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/tracking/Attic/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/tracking/index.adp 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,9 @@ + + @title@ + @context@ + +
+

+ +
+ Index: openacs-4/packages/lorsm/www/tracking/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/www/tracking/Attic/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/lorsm/www/tracking/index.tcl 4 Sep 2004 14:51:29 -0000 1.1 @@ -0,0 +1,213 @@ +# packages/lorsm/www/tracking/index.tcl + +ad_page_contract { + + Student Tracking Index Page + + @author Ernie Ghiglione (ErnieG@mm.st) + @creation-date 2004-05-25 + @arch-tag a5b230ee-0fa7-4e48-be1b-eeae323291e7 + @cvs-id $Id: index.tcl,v 1.1 2004/09/04 14:51:29 ernieg Exp $ +} { + man_id:integer,notnull + {item_id 0} + group:optional +} -properties { +} -validate { +} -errors { +} + +set package_id [ad_conn package_id] +set community_id [dotlrn_community::get_community_id] + +set admin_p [dotlrn::user_can_admin_community_p \ + -user_id [ad_conn user_id] \ + -community_id $community_id ] + + +set title "Student Tracking" +set context {Tracking} + +if {![exists_and_not_null group]} { + set group 1 +} + +if {$group == 1} { + + template::list::create \ + -name student_track \ + -multirow student_track \ + -actions [list "Summarize" [export_vars -base ".?group=0" {man_id item_id}] "Summarize all students"] \ + -key man_id \ + -html {width 50%} \ + -no_data "No Students" \ + -elements { + student_name { + label "Student Name" + display_eval {[person::name -person_id $student_name]} + link_url_eval {[acs_community_member_url -user_id $student_name]} + link_html {title "Student's profile"} + } + start_time { + label "Start Course" + display_eval {[lc_time_fmt $start_time "%x %T"]} + html { align center } + } + end_time { + label "Exit Course" + display_eval {[lc_time_fmt $end_time "%x %T"]} + html { align center } + } + time_spend { + label "Time Spent" + display_eval {[lorsm::dates_calc -start_date [lc_time_fmt $start_time "%x %T"] -end_date [lc_time_fmt $end_time "%x %T"]]} + html { align center } + } + } + + db_multirow -extend { ims_md_id } student_track select_students { + select + user_id as student_name, + start_time, + end_time + from + lorsm_student_track + where + community_id = :community_id + and + course_id = :man_id + and + end_time NOTNULL + order by + start_time desc + } { + set ims_md_id $man_id + } + + template::list::create \ + -name object_views \ + -multirow object_views \ + -elements { + title { + label "Title" + } + viewer_name { + label "Viewed By" + } + views { + label "Total Views" + } + last_viewed { + label "Last Viewed On" + } + } + + if {$item_id} { + set extra_where " and v.object_id = :item_id" + } else { + set extra_where "" + } + + db_multirow -extend {viewer_name} object_views objects_views " + select v.*, + i.title + from views v, + ims_cp_items i, + ims_cp_organizations o + where + i.item_id = v.object_id + and + i.org_id = o.org_id + and + o.man_id = :man_id + $extra_where + " { + set viewer_name [acs_user::get_element -user_id $viewer_id -element name] + } + +} else { + # group display + + template::list::create \ + -name student_track \ + -multirow student_track \ + -key man_id \ + -actions [list "Expand" [export_vars -base ".?group=1" {man_id item_id}] "Expand all students"] \ + -html {width 50%} \ + -no_data "No Students" \ + -elements { + student_name { + label "Student Name" + display_eval {[person::name -person_id $student_name]} + link_url_eval {[acs_community_member_url -user_id $student_name]} + link_html {title "Student's profile"} + } + counter { + label "Times Viewed" + html { align center } + } + time_spent { + label "Time Spent" + html { align center } + } + } + + db_multirow -extend { ims_md_id } student_track select_students { + select + user_id as student_name, + count(*) as counter, + sum(end_time - start_time) as time_spent + from + lorsm_student_track + where + community_id = :community_id + and + course_id = :man_id + and + end_time NOTNULL + group by user_id + + } { + set ims_md_id $man_id + } + + template::list::create \ + -name object_views \ + -multirow object_views \ + -elements { + title { + label "Title" + } + views { + label "Total Views" + } + unique_views { + label "Unique Views" + } + last_viewed { + label "Last Viewed On" + } + } + + if {$item_id} { + set extra_where " and v.object_id = :item_id" + } else { + set extra_where "" + } + + db_multirow object_views objects_views " + select v.*, + i.title + from view_aggregates v, + ims_cp_items i, + ims_cp_organizations o + where + i.item_id = v.object_id + and + i.org_id = o.org_id + and + o.man_id = :man_id + $extra_where + " + +}