Index: openacs-4/packages/latest/latest.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/latest.info,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/latest.info 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,27 @@ + + + + + Latest + + f + t + latest + + + Hector Amado + Rocael Hernandez + 2006-06-29 + Viaro Networks + 3 + + + + + + + + + + + Index: openacs-4/packages/latest/tcl/callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/tcl/callback-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/tcl/callback-procs.tcl 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,63 @@ +# Tcl callback proc implementations + +ad_proc -public -callback subsite::get_extra_headers -impl latest {} { + return the stuff to run well in the latest frame viewer +} { + set scripts { + + + + +} + + return $scripts +} + +ad_proc -public -callback subsite::header_onload -impl latest {} { + return the function to load when the page is served +} { + + return {hide_headers();} + +} Index: openacs-4/packages/latest/tcl/latest-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/tcl/latest-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/tcl/latest-procs.tcl 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,156 @@ +# Procs for each type of application + +namespace eval latest {} + +ad_proc -public latest::forums { + -pkgs_ids +} { + Gets all the forums from X time to now. +} { + + set limit [parameter::get -parameter LinksPerApplication] + + db_multirow -upvar_level 1 forums forums_select " + select o.title, o.object_id, t.pretty_name as object_type, to_char(o.last_modified, 'MM-DD-YYYY') as last_modified + from acs_object_types t, acs_objects o + where t.object_type = o.object_type and + o.object_type in ('forums_forum','forums_message') + and o.package_id in ($pkgs_ids) order by last_modified desc limit $limit " + +} + +ad_proc -public latest::fs { + -pkgs_ids +} { + Gets all the file storage objects from X time to now. +} { + + set limit [parameter::get -parameter LinksPerApplication] + + db_multirow -upvar_level 1 fs fs_select " + select o.title, o.object_id, t.pretty_name as object_type, to_char(o.last_modified, 'MM-DD-YYYY') as last_modified + from acs_object_types t, acs_objects o + where t.object_type = o.object_type and + o.object_type in ('file_storage_object') + and o.package_id in ($pkgs_ids) order by last_modified desc limit $limit " + +} + + +ad_proc -public latest::asm { + -pkgs_ids +} { + Gets all the assessment objects from X time to now. +} { + + set user_id [ad_conn user_id] + set limit [parameter::get -parameter LinksPerApplication] + + set old_comm_node_id 0 + db_multirow -upvar_level 1 -extend { assessment_url } assessment_sessions answered_assessments " + select cr.item_id as assessment_id, cr.title, a.password, + to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, + to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, + to_char(now(), 'YYYY-MM-DD HH24:MI:SS') as cur_time, + to_char(cr.publish_date, 'MM-DD-YYYY') as publish_date, + sc.node_id as comm_node_id, sa.node_id as as_node_id + from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, + site_nodes sa, site_nodes sc, apm_packages p + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = cf.folder_id + and sa.object_id = cf.package_id + and sc.node_id = sa.parent_id + and cf.package_id in ($pkgs_ids) + and p.package_id = sc.object_id + and exists (select 1 + from as_assessment_section_map asm, as_item_section_map ism + where asm.assessment_id = a.assessment_id + and ism.section_id = asm.section_id) + and acs_permission__permission_p (a.assessment_id, :user_id, 'read') = 't' + order by publish_date desc limit $limit + " { + + if {([empty_string_p $start_time] || $start_time <= $cur_time) && ([empty_string_p $end_time] || $end_time >= $cur_time)} { + set assessment_url [site_node::get_url -node_id $as_node_id] + + if {[empty_string_p $password]} { + append assessment_url [export_vars -base "assessment" {assessment_id}] + } else { + append assessment_url [export_vars -base "assessment-password" {assessment_id}] + } + + } + } + +} + + +ad_proc -public latest::lors { + -pkgs_ids +} { + Gets all the lors objects from X time to now. +} { + + set user_id [ad_conn user_id] + set limit [parameter::get -parameter LinksPerApplication] + + db_multirow -upvar_level 1 -extend { course_url } \ + d_courses select_d_courses " + select + cp.man_id, + cp.course_name, + to_char(acs.creation_date, 'MM-DD-YYYY') as creation_date, + pf.folder_name, + pf.format_name, + cpmc.lorsm_instance_id + from + ims_cp_manifests cp, + acs_objects acs, + ims_cp_manifest_class cpmc, + lorsm_course_presentation_formats pf + where + cp.man_id = acs.object_id + and + cp.man_id = cpmc.man_id + and + cpmc.lorsm_instance_id in ($pkgs_ids) + and + cpmc.isenabled = 't' + and + pf.format_id = cp.course_presentation_format + order by acs.creation_date desc limit $limit +" { + set ims_md_id $man_id + if { [string eq $format_name "default"] } { + + set context [site_node::get_url_from_object_id -object_id $lorsm_instance_id] + if ([db_0or1row query " + select + cpr.man_id, + cpr.res_id, + case + when upper(scorm_type) = 'SCO' then 'delivery-scorm' + else 'delivery' + end as needscorte + from + ims_cp_resources cpr + where + cpr.man_id = :man_id + order by cpr.scorm_type desc limit 1" + ]) { + + set delivery_method $needscorte + + set course_url_url [export_vars -base "[lindex $context 0]$delivery_method" -url {man_id}] + set course_url "$course_name" + ns_log Debug "lorsm - course_url: $course_url" + } else { + set course_url "NO RESOURCES ERROR" + } + } else { + set course_url "$course_name" + } +} + +} Index: openacs-4/packages/latest/www/exit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/exit.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/www/exit.tcl 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,18 @@ +# exit.tcl + +ad_page_contract { + + @author Hector Roderico Amado S. (hr_amado@viaro.net) + @creation-date 2006-05-11 + @arch-tag: 7b852c75-e4a6-41de-929b-1cf6f0ec9007 + @cvs-id $Id: exit.tcl,v 1.1 2006/07/13 03:16:39 rocaelh Exp $ +} { + +} -properties { +} -validate { +} -errors { +} + +ad_returnredirect "/dotlrn" + + Index: openacs-4/packages/latest/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/index.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/www/index.adp 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,13 @@ + + + + +Latest stuff + + + + + +<body> +</body> + Index: openacs-4/packages/latest/www/menu.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/menu.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/www/menu.adp 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,61 @@ + + + + +Latest Menu + + + + + +
+
+Latest stuff +
+
+ +Expand all | Collapse All | Exit + + + + + +
+ +
+

+ + + Index: openacs-4/packages/latest/www/menu.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/menu.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/www/menu.tcl 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,60 @@ +# /lastest/www/menu.tcl +ad_page_contract { + Left Menu + @author Hector Amado (hr_amado@viaro.net) + @creation-date 24-03-2006 + +} { +} -properties { +} -validate { +} -errors { +} + +set user_id [ad_maybe_redirect_for_registration] + +# Communities that I belong to +db_multirow -extend {} communities select_communities " + select dotlrn_communities_all.community_id, + dotlrn_community__url(dotlrn_communities_all.community_id) as url, + pretty_name + from + dotlrn_communities_all, dotlrn_member_rels_approved + where + dotlrn_communities_all.community_id = dotlrn_member_rels_approved.community_id and + dotlrn_member_rels_approved.user_id = :user_id and archived_p='f' +" { +} + +# List of pkg_ids +set communities_list [db_list communities_all_select " + select dotlrn_communities_all.package_id + from + dotlrn_communities_all, dotlrn_member_rels_approved + where + dotlrn_communities_all.community_id = dotlrn_member_rels_approved.community_id and + dotlrn_member_rels_approved.user_id = :user_id and archived_p='f' +"] + + +set packages_names [list] +set objects [list] +set packages [list] + +foreach community $communities_list { + set snode [site_node::get_node_id_from_object_id -object_id $community] + foreach package [site_node::get_children -all -node_id $snode -element package_id] { + if {![empty_string_p $package] } { + lappend packages $package + } + } +} + + +if {![llength $packages] == 0 } { + set pkgs_ids [join $packages ,] + latest::forums -pkgs_ids $pkgs_ids + latest::fs -pkgs_ids $pkgs_ids + latest::asm -pkgs_ids $pkgs_ids + latest::lors -pkgs_ids $pkgs_ids +} + Index: openacs-4/packages/latest/www/navigator.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/navigator.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/www/navigator.adp 13 Jul 2006 03:16:39 -0000 1.1 @@ -0,0 +1,10 @@ + + + Navitator Viaro-Latest + + +Select an activity type that you want to see the latest information. +Navigator Viaro-Latest + + + Index: openacs-4/packages/latest/www/resources/contents_bg.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/resources/contents_bg.gif,v diff -u -N Binary files differ Index: openacs-4/packages/latest/www/resources/ico_collapse.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/resources/ico_collapse.gif,v diff -u -N Binary files differ Index: openacs-4/packages/latest/www/resources/ico_expand.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/resources/ico_expand.gif,v diff -u -N Binary files differ Index: openacs-4/packages/latest/www/resources/ico_hide.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/resources/ico_hide.gif,v diff -u -N Binary files differ Index: openacs-4/packages/latest/www/resources/ico_show.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/resources/ico_show.gif,v diff -u -N Binary files differ Index: openacs-4/packages/latest/www/resources/mktree.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/latest/www/resources/mktree.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/latest/www/resources/mktree.js 13 Jul 2006 03:16:43 -0000 1.1 @@ -0,0 +1,258 @@ +// JavaScript Document +// =================================================================== +// Author: Matt Kruse +// WWW: http://www.mattkruse.com/ +// +// NOTICE: Matt kindly gave OpenACS permission to incorporate his code. +// Details are here: http://openacs.org/forums/message-view?message_id=284521 +// I'm leaving in his original notice below. AG. +// +// NOTICE: You may use this code for any purpose, commercial or +// private, without any further permission from the author. You may +// remove this notice from your final code if you wish, however it is +// appreciated by the author if at least my web site address is kept. +// +// You may *NOT* re-distribute this code in any way except through its +// use. That means, you can include it in your product, or your web +// site, or any other form where the code is actually being used. You +// may not put the plain javascript up on your site for download or +// include it in your javascript libraries for download. +// If you wish to share this code with others, please just point them +// to the URL instead. +// Please DO NOT link directly to my .js files from your site. Copy +// the files to your server and use them there. Thank you. +// =================================================================== + +// HISTORY +// ------------------------------------------------------------------ +// December 9, 2003: Added script to the Javascript Toolbox +// December 10, 2003: Added the preProcessTrees variable to allow user +// to turn off automatic conversion of UL's onLoad +// March 1, 2004: Changed it so if a
  • has a class already attached +// to it, that class won't be erased when initialized. This allows +// you to set the state of the tree when painting the page simply +// by setting some
  • 's class name as being "liOpen" (see example) +// March 29, 2005: Added cookie-managed state (AG). +/* +This code is inspired by and extended from Stuart Langridge's aqlist code: + http://www.kryogenix.org/code/browser/aqlists/ + Stuart Langridge, November 2002 + sil@kryogenix.org + Inspired by Aaron's labels.js (http://youngpup.net/demos/labels/) + and Dave Lindquist's menuDropDown.js (http://www.gazingus.org/dhtml/?id=109) +*/ + +// Automatically attach a listener to the window onload, to convert the trees +addEvent(window,"load",convertTrees); + +// Utility function to add an event listener +function addEvent(o,e,f){ + if (o.addEventListener){ o.addEventListener(e,f,true); return true; } + else if (o.attachEvent){ return o.attachEvent("on"+e,f); } + else { return false; } +} + +// utility function to set a global variable if it is not already set +function setDefault(name,val) { + if (typeof(window[name])=="undefined" || window[name]==null) { + window[name]=val; + } +} + +// Full expands a tree with a given ID +function expandTree(treeId) { + var ul = document.getElementById(treeId); + if (ul == null) { return false; } + expandCollapseList(ul,nodeOpenClass); +} + +// Fully collapses a tree with a given ID +function collapseTree(treeId) { + var ul = document.getElementById(treeId); + if (ul == null) { return false; } + expandCollapseList(ul,nodeClosedClass); +} + +// Expands enough nodes to expose an LI with a given ID +function expandToItem(treeId,itemId) { + var ul = document.getElementById(treeId); + if (ul == null) { return false; } + var ret = expandCollapseList(ul,nodeOpenClass,itemId); + if (ret) { + var o = document.getElementById(itemId); + if (o.scrollIntoView) { + o.scrollIntoView(false); + } + } +} + +// Performs 3 functions: +// a) Expand all nodes +// b) Collapse all nodes +// c) Expand all nodes to reach a certain ID +function expandCollapseList(ul,cName,itemId) { + if (!ul.childNodes || ul.childNodes.length==0) { return false; } + // Iterate LIs + for (var itemi=0;itemi