Index: dotlrn_packages/README_lamsdotlrn_packages.txt =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/README_lamsdotlrn_packages.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/README_lamsdotlrn_packages.txt 12 Sep 2007 06:31:54 -0000 1.1 @@ -0,0 +1,91 @@ +LAMS 2 and .LRN 2.3 Integration packages +---------------------------------------- +@creation-date 2007-09-12 +@cvs-id README_lamsdotlrn_packages.txt,v 1.1 2007/09/12 06:31:54 ernieg Exp + +These packages are released under GNU GPL version 2.0 (http://lamsfoundation.org/license/lams/2.0/) + +Packages: + +* dotlrn-lams2int + + LAMS2 dotLRN portlet + +* lams2conf + + Configuration settings + +* lams2int + + Integration logic + +* lams2int-portlet + + dotLRN portlet + + +These packages have to be places in your /packages + + +Installation Steps - .LRN Side +----------------------------- + + 1. Download lams2-dotLRN packages from the downloads page. + 2. Place the lams2 packages in your packages folder under your .LRN instance folder + 3. Navigate to Administration > Install Packages > Install from Local + 4. Select the dotLRN LAMS Integration Applet + 5. And install the four packages + 6. Once installed, reboot your AOLServer and go to the Site Map to configure the lams2conf parameters + + +Configuring the LAMS Side +------------------------- + + 1. Follow the instructions to install LAMS. You can either build LAMS from source or follow the instructions for Window Installers or Unix Installers. + 2. Login to LAMS as sysadmin. + 3. Goto Sys Admin->Maintain integrated servers->Add New Server. + 4. Setup the fields to match those that you put on the .LRN side + 5. The id, key and name should map to the "LAMS SERVER URL", "LAMS SERVER ID" and "LAMS SERVER SECRET KEY" respectively on the LAMS properties page in .LRN (see above). + 6. Fill in a description of the .LRN server. + 7. The "Prefix" field denotes a prefix that will be added to all users from .LRN, for example if you put lrn as the prefix and accessed LAMS with a user called "user", their name in LAMS would be "lrn_user". + 8. The 'disabled' checkbox disables this integration, you can select this later if you wish to disable the connection. + 9. You can select an existing group to add .LRN users to, or add a new one. + 10. Enter the User Information URL, this corresponds to the "USER DATA CALLBACK URL". In .LRN these usually is http:///lams2conf/userinfo?ts=%timestamp%&un=%username%&hs=%hash% + 11. You can specify a timeout page that LAMS will go to if there is an error. + + +Help? +--- + +LAMS Wiki: + + http://wiki.lamsfoundation.org/display/lams + +LAMS Documentation + + http://wiki.lamsfoundation.org/display/lamsdocs + +LAMS dotLRN Integration + + http://wiki.lamsfoundation.org/display/lams/dotLRN + http://wiki.lamsfoundation.org/display/lams/Integrations + +Further help: + + http://lamscommunity.org + + + +Contact Details: +--------------- + +Tech Info: Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + +LAMS Foundation Limited +Level 1, Dow Corning Building +3 Innovation Road +Macquarie University +NSW 2109 +Australia +Email: info@lamsfoundation.org for general enquiries and information. +Phone +61 2 9850 7522 for LAMS Foundation. Index: dotlrn_packages/dotlrn-lams2int/dotlrn-lams2int.info =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/dotlrn-lams2int/dotlrn-lams2int.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/dotlrn-lams2int/dotlrn-lams2int.info 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + dotLRN LAMS Integration Applet + dotLRN LAMS Integration Applets + f + t + + + Ernie Ghiglione + LAMS Foundation + 0 + + + + + + + + + + + + + + + + Index: dotlrn_packages/dotlrn-lams2int/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/dotlrn-lams2int/tcl/apm-callback-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/dotlrn-lams2int/tcl/apm-callback-procs.tcl 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,60 @@ +# packages/dotlrn-lams2int/tcl/apm-callback-procs.tcl + +ad_library { + + Procedures for registering implementations for the + dotlrn lams2int package. + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id apm-callback-procs.tcl,v 1.1 2007/09/12 06:37:01 ernieg Exp +} + +namespace eval dotlrn_lams2int {} + +ad_proc -public dotlrn_lams2int::install {} { + dotLRN LAMS2INT package install proc +} { + register_portal_datasource_impl +} + +ad_proc -public dotlrn_lams2int::uninstall {} { + dotLRN LAMS2INT package uninstall proc +} { + unregister_portal_datasource_impl +} + +ad_proc -public dotlrn_lams2int::register_portal_datasource_impl {} { + Register the service contract implementation for the dotlrn_applet service contract +} { + set spec { + name "dotlrn_lams2int" + contract_name "dotlrn_applet" + owner "dotlrn_lams2int" + aliases { + GetPrettyName dotlrn_lams2int::get_pretty_name + AddApplet dotlrn_lams2int::add_applet + RemoveApplet dotlrn_lams2int::remove_applet + AddAppletToCommunity dotlrn_lams2int::add_applet_to_community + RemoveAppletFromCommunity dotlrn_lams2int::remove_applet_from_community + AddUser dotlrn_lams2int::add_user + RemoveUser dotlrn_lams2int::remove_user + AddUserToCommunity dotlrn_lams2int::add_user_to_community + RemoveUserFromCommunity dotlrn_lams2int::remove_user_from_community + AddPortlet dotlrn_lams2int::add_portlet + RemovePortlet dotlrn_lams2int::remove_portlet + Clone dotlrn_lams2int::clone + ChangeEventHandler dotlrn_lams2int::change_event_handler + } + } + + acs_sc::impl::new_from_spec -spec $spec +} + +ad_proc -public dotlrn_lams2int::unregister_portal_datasource_impl {} { + Unregister service contract implementations +} { + acs_sc::impl::delete \ + -contract_name "dotlrn_applet" \ + -impl_name "dotlrn_lams2int" +} \ No newline at end of file Index: dotlrn_packages/dotlrn-lams2int/tcl/dotlrn-lams2int-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/dotlrn-lams2int/tcl/dotlrn-lams2int-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/dotlrn-lams2int/tcl/dotlrn-lams2int-procs.tcl 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,210 @@ +# packages/dotlrn-lams2int/tcl/dotlrn-lams2int-procs.tcl + +ad_library { + + Procs to set up the dotLRN Lamsint applet + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id dotlrn-lams2int-procs.tcl,v 1.1 2007/09/12 06:37:01 ernieg Exp +} + +namespace eval dotlrn_lams2int { + + ad_proc -public applet_key { + } { + What's my applet key? + } { + return "dotlrn_lams2int" + } + + ad_proc -public package_key { + } { + What package do I deal with? + } { + return "lams2int" + } + + ad_proc -public my_package_key { + } { + What's my package key? + } { + return "dotlrn-lams2int" + } + + ad_proc -public get_pretty_name { + } { + returns the pretty name + } { + return "LAMS Integration" + } + + ad_proc -public add_applet { + } { + Add the lams2int applet to dotlrn. One time init - must be + # repeatable! + } { + dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key] + } + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet + } { + ad_return_complaint 1 "[applet_key] remove_applet not implemented!" + } + + ad_proc -public add_applet_to_community { + community_id + } { + Add the lams2int applet to a specifc dotlrn community + } { + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] + + # create the lams2int package instance (all in one, I've + # mounted it) + set package_id [dotlrn::instantiate_and_mount $community_id [package_key]] + + # set up the admin portal + set admin_portal_id [dotlrn_community::get_admin_portal_id \ + -community_id $community_id + ] + + lams2int_admin_portlet::add_self_to_page \ + -portal_id $admin_portal_id \ + -package_id $package_id + + # add the portlet to the comm's portal using + # add_portlet_helper + set args [ns_set create] + ns_set put $args package_id $package_id + add_portlet_helper $portal_id $args + + return $package_id + } + ad_proc -public remove_applet_from_community { + community_id + } { + remove the applet from the community + } { + ad_return_complaint 1 "[applet_key] remove_applet_from_community not implemented!" + } + + ad_proc -public add_user { + user_id + } { + one time user-specifuc init + } { + # noop + } + + ad_proc -public remove_user { + user_id + } { + } { + # noop + } + + ad_proc -public add_user_to_community { + community_id + user_id + } { + Add a user to a specifc dotlrn community + } { + set package_id [dotlrn_community::get_applet_package_id -community_id $community_id -applet_key [applet_key]] + set portal_id [dotlrn::get_portal_id -user_id $user_id] + + # use "append" here since we want to aggregate + set args [ns_set create] + ns_set put $args package_id $package_id + ns_set put $args param_action append + add_portlet_helper $portal_id $args + } + ad_proc -public remove_user_from_community { + community_id + user_id + } { + Remove a user from a community + } { + set package_id [dotlrn_community::get_applet_package_id -community_id $community_id -applet_key [applet_key]] + set portal_id [dotlrn::get_portal_id -user_id $user_id] + + set args [ns_set create] + ns_set put $args package_id $package_id + + remove_portlet $portal_id $args + } + + ad_proc -public add_portlet { + portal_id + } { + A helper proc to add the underlying portlet to the given + # portal. + + @param portal_id + } { + # simple, no type specific stuff, just set some dummy values + + set args [ns_set create] + ns_set put $args package_id 0 + ns_set put $args param_action overwrite + add_portlet_helper $portal_id $args + } + ad_proc -public add_portlet_helper { + portal_id + args + } { + A helper proc to add the underlying portlet to the given + # portal. + + @param portal_id + @param args an ns_set + } { + lams2int_portlet::add_self_to_page \ + -portal_id $portal_id \ + -package_id [ns_set get $args package_id] \ + -param_action [ns_set get $args param_action] + } + + ad_proc -public remove_portlet { + portal_id + args + } { + A helper proc to remove the underlying portlet from the given + portal. + + @param portal_id + @param args A list of key-value pairs (possibly user_id, community_id, and more) + } { + lams2int_portlet::remove_self_from_page \ + -portal_id $portal_id \ + -package_id [ns_set get $args package_id] + } + ad_proc -public clone { + old_community_id + new_community_id + } { + Clone this applet's content from the old community to the new one + + } { + ns_log notice "Cloning: [applet_key]" + set new_package_id [add_applet_to_community $new_community_id] + set old_package_id [dotlrn_community::get_applet_package_id \ + -community_id $old_community_id \ + -applet_key [applet_key] + ] + + return $new_package_id + } + ad_proc -public change_event_handler { + community_id + event + old_value + new_value + } { + listens for the following events: + } { + } + +} \ No newline at end of file Index: dotlrn_packages/lams2conf/lams2conf.info =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2conf/lams2conf.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2conf/lams2conf.info 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,34 @@ + + + + + LAMS Integration Configuration + LAMS Integration Configurations + f + t + lams2conf + + + Ernie Ghiglione + LAMS Foundation + This package serves two purposes: + +* User data exchange between LAMS2.x and .LRN +* Configuration setting holder for .LRN + +See more details in the LAMS Community or LAMS/.LRN integration webpage (http://lamsfoundation.org/wiki) + 0 + + + + + + + + + + + + + + Index: dotlrn_packages/lams2conf/www/userinfo.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2conf/www/userinfo.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2conf/www/userinfo.tcl 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,55 @@ +# packages/lams2conf/www/userinfo.tcl + +ad_page_contract { + + This page return user info in CSV format to LAMS server. + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-16 + @cvs-id userinfo.tcl,v 1.1 2007/09/12 06:37:01 ernieg Exp +} { + ts + un + hs +} -properties { +} -validate { +} -errors { +} + +set timestamp $ts +set username $un +set hash $hs + +set datetime $timestamp + +ns_log Notice "LAMS2int: LAMS requestimestamp userinfo for user_id $username (datetime: $timestamp hash: $hash)" + +set lams_server_url [parameter::get -parameter lams_server_url -package_id [ad_conn package_id]] +set server_key [parameter::get -parameter server_key -package_id [ad_conn package_id]] +set server_id [parameter::get -parameter server_id -package_id [ad_conn package_id]] + + + +set plaintext [string tolower [concat $timestamp$username$server_id$server_key]] +set hashValue [string tolower [ns_sha1 $plaintext]] + +if {![string equal [string tolower $hash] $hashValue]} { + + ns_log Warning "LAMSint: userinfo request hash authentication failed. localhash: $hashValue requesthash: $hash" + ns_write "HTTP/1.1 401 Usernameauthenticated" + +} + +# get the user info we need to pass to LAMS +set first_name [acs_user::get_element -user_id $username -element first_names] +set last_name [acs_user::get_element -user_id $username -element last_name] +set email [acs_user::get_element -user_id $username -element email] + +ns_log Notice "LAMSint: userinfo transfered to LAMS (user_id $username)" + +# send it to LAMS +ReturnHeaders "text/plain" +ns_write "'',$first_name,$last_name,'','','','','','','','',$email,'',''" + + + Index: dotlrn_packages/lams2int/lams2int.info =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/lams2int.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/lams2int.info 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,26 @@ + + + + + .LRN LAMS2.x Integration + .LRN LAMS2.x Integration + f + t + + + Ernie Ghiglione + .LRN LAMS2.x integration package + LAMS Foundation + .LRN LAMS2.x integration package + 0 + + + + + + + + + + + Index: dotlrn_packages/lams2int/lib/user-lams2int.adp =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/lib/user-lams2int.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/lib/user-lams2int.adp 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,3 @@ + + + \ No newline at end of file Index: dotlrn_packages/lams2int/lib/user-lams2int.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/lib/user-lams2int.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/lib/user-lams2int.tcl 12 Sep 2007 06:37:01 -0000 1.1 @@ -0,0 +1,48 @@ +# packages/lams2int/lib/user-lams2int.tcl +# +# @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) +# @creation-date 2007-04-17 +# @cvs-id user-lams2int.tcl,v 1.1 2007/09/12 06:37:01 ernieg Exp + +template::list::create \ + -name d_lesson \ + -multirow d_lesson \ + -html {width 100%} \ + -key lesson_id \ + -no_data "No lessons available" \ + -elements { + lesson_name { + label "Title" + display_eval {[string_truncate -len 25 -ellipsis "..." $display_title]} + link_url_eval {[export_vars -base $comm_url/lams2int/ lesson_id]} + html { width 50% } + link_html {title "View lesson"} + } + subject { + label "Subject" + display_eval {[dotlrn_community::get_community_name $community_id]} + html { align center width 50% } + link_url_eval {[dotlrn_community::get_community_url $community_id]} + link_html {title "Access Course"} + } + } + +set user_id [ad_conn user_id] + +foreach package $package_id { + + db_multirow -extend {comm_url Community} -append d_lesson select_d_lesson { + select + lesson_id, display_title, introduction, hide, start_time, community_id + from + lams_lessons + where + package_id = :package + and + hide = 'f' + order by start_time desc + } { + set comm_url [dotlrn_community::get_community_url $community_id] + } + +} \ No newline at end of file Index: dotlrn_packages/lams2int/sql/postgresql/lams2int-create.sql =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/sql/postgresql/lams2int-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/sql/postgresql/lams2int-create.sql 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,61 @@ +-- +-- packages/lams2int/sql/postgresql/lams2int-create.sql +-- +-- @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) +-- @creation-date 2007-04-16 +-- @cvs-id lams2int-create.sql,v 1.1 2007/09/12 06:37:02 ernieg Exp +-- +-- Copyright (C) 2007 LAMS Foundation +-- +-- 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; version 2 of the License, +-- +-- 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. +-- + + +-- Configuration items table for LAMS/.LRN integration + +CREATE TABLE lams_lessons ( + lesson_id int + constraint lams_lessons_lesson_id_pk + references acs_objects (object_id) + primary key, + user_id int + constraint lams_lessons_user_id_fk + references users (user_id), + package_id int + constraint lams_lessons_pack_id_fk + references apm_packages (package_id), + community_id int + constraint lams_lessons_comm_id_fk + references dotlrn_communities_all (community_id), + learning_session_id int, + display_title varchar(250), + introduction text, + hide boolean default 'f' not null, + start_time timestamptz not null default current_timestamp, + end_time timestamptz +); + + +begin; +select acs_object_type__create_type ( + 'lams_lesson', -- object_type + 'LAMS Lesson', -- pretty_name + 'LAMS Lessons', -- pretty_plural + 'acs_object', -- supertype + 'lams_lessons', -- table_name + 'seq_id', -- id_column + null, -- name_method + 'f', + null, + null + ); +end; + +\i lams2int-package-create.sql \ No newline at end of file Index: dotlrn_packages/lams2int/sql/postgresql/lams2int-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/sql/postgresql/lams2int-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/sql/postgresql/lams2int-package-create.sql 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,63 @@ +-- +-- packages/lams2int/sql/postgresql/lams2int-package-create.sql +-- +-- @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) +-- @creation-date 2007-04-16 +-- @cvs-id lams2int-package-create.sql,v 1.1 2007/09/12 06:37:02 ernieg Exp +-- + +create or replace function lams_lesson__new ( + integer, -- learning_session_id + varchar, -- display_title + varchar, -- introduction + boolean, -- hide + timestamp with time zone, -- creation_date + integer, -- creation_user + varchar, -- creation_ip + integer, -- package_id + integer -- community_id +) +returns integer as ' +declare + p_learning_session_id alias for $1; + p_display_title alias for $2; + p_introduction alias for $3; + p_hide alias for $4; + p_creation_date alias for $5; + p_creation_user alias for $6; + p_creation_ip alias for $7; + p_package_id alias for $8; + p_community_id alias for $9; + + v_lesson_id integer; +begin + v_lesson_id := acs_object__new ( + v_lesson_id, -- object_id + ''lams_lesson'', -- object_type + p_creation_date, -- creation_date + p_creation_user, -- creation_user + p_creation_ip, -- creation_ip + p_package_id, -- context_id + ''t'' -- security_inherit_p + ); + + insert into lams_lessons + (lesson_id, user_id, community_id, learning_session_id, display_title, introduction, hide, start_time, package_id) + values + (v_lesson_id, p_creation_user, p_community_id, p_learning_session_id, p_display_title, p_introduction, p_hide, p_creation_date, p_package_id); + return v_lesson_id; +end; +' language 'plpgsql'; + +create or replace function lams_lesson__delete ( + integer -- lesson_id +) +returns integer as ' +declare + p_lesson_id alias for $1; +begin + perform acs_object__delete(p_lesson_id); + delete from lams_lessons where lesson_id = p_lesson_id; + return 0; +end; +' language 'plpgsql'; \ No newline at end of file Index: dotlrn_packages/lams2int/tcl/lams2int-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/tcl/lams2int-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/tcl/lams2int-procs.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,139 @@ +# packages/lams2int/tcl/lams2int-procs.tcl + +ad_library { + + LAMS2.x Integration Procedures + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-16 + @cvs-id lams2int-procs.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} + +# +# Copyright (C) 2005 LAMS Foundation +# +# 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; version 2 of the License +# +# 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 lams2int {} + +ad_proc -public lams2int::add { + {-learning_session_id:required} + {-display_title:required} + {-introduction ""} + {-hide "f"} + {-start_date ""} + {-creation_user} + {-package_id} + {-community_id} +} { + Adds a new LAMS lesson to .LRN + + @param learning_session_id LAMS learning session id + @param display_title title for the lesson to be displayed in .LRN + @param introduction Introduction to be displayed in .LRN + @param hide boolean, whether the lesson should be hiden to students or not + @param start_date start date to show the lesson to students + @param creation_user creation user + @param package_id package id + @param community_id the community where this lesson will live. + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + +} { + + # this should kick in *after* we get a learning_session_id from + # LAMS + + set creation_ip [ad_conn peeraddr] + + db_transaction { + set lesson_id [db_exec_plsql new_seq { + select lams_lesson__new ( + :learning_session_id, + :display_title, + :introduction, + :hide, + current_timestamp, + :creation_user, + :creation_ip, + :package_id, + :community_id + ); + + } + ] + + } + + return $lesson_id + +} + +ad_proc -public lams2int::get_datetime { + +} { + Generates the datetime for the hash + +} { + + set user_now_time [lc_time_system_to_conn [dt_systime]] + return [lc_time_fmt $user_now_time "%B %d,%Y %r"] + +} + +ad_proc -public lams2int::get_lams_server_url { + +} { + Gets the lams_server_url from the LAMS Configuration package + +} { + + set lams2conf_package_id [db_string pack_id_lams2_conf {select package_id from apm_packages where package_key = 'lams2conf'}] + return [parameter::get -parameter lams_server_url -package_id $lams2conf_package_id] + + +} + + +ad_proc -public lams2int::get_server_id { + +} { + Gets the lams_server_id from the LAMS2.x Configuration package (parameter) + +} { + + set lams2conf_package_id [db_string pack_id_lams_conf {select package_id from apm_packages where package_key = 'lams2conf'}] + return [parameter::get -parameter server_id -package_id $lams2conf_package_id] + +} + +ad_proc lams2int::get_server_key { + +} { + Gets the lams_server_key from the LAMS Configuration package (parameter) + +} { + + set lams2conf_package_id [db_string pack_id_lams_conf {select package_id from apm_packages where package_key = 'lams2conf'}] + return [parameter::get -parameter server_key -package_id $lams2conf_package_id] + +} + +ad_proc lams2int::get_request_source { + +} { + Gets the request_source from the LAMS Configuration package (parameter) + +} { + + set lams2conf_package_id [db_string pack_id_lams_conf {select package_id from apm_packages where package_key = 'lams2conf'}] + return [parameter::get -parameter request_source -package_id $lams2conf_package_id] + +} \ No newline at end of file Index: dotlrn_packages/lams2int/tcl/lams2int-ws-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/tcl/lams2int-ws-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/tcl/lams2int-ws-procs.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,66 @@ +# packages/lams2int/tcl/lams2int-ws-procs.tcl + +ad_library { + + LAMS2.x Web Services Library + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-16 + @cvs-id lams2int-ws-procs.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} +namespace eval lams2int::ws {} + +ad_proc -public lams2int::ws::generate_hash { + {-datetime ""} + {-username ""} + {-method ""} + {-server_id ""} + {-server_key ""} +} { + Returns the validation hash. If method is not passed, it will not + be included in the hash + + @param datetime + @param username + @param method (author, monitor, learner) + @param server_id + @param server_key + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + +} { + + + if {[empty_string_p $datetime]} { + + set datetime [lams2int::get_datetime] + + } + + if {[empty_string_p $username]} { + set username [ad_conn user_id] + + } + + if {[empty_string_p $server_id]} { + set server_id [string trim [lams2int::get_server_id]] + } + + if {[empty_string_p $server_key]} { + set server_key [string trim [lams2int::get_server_key]] + } + + if {[empty_string_p $method]} { + # we don't have a method, therefore we just create the + # rawstring without it + + set rawstring [string tolower [concat $datetime$username$server_id$server_key]] + } else { + + set rawstring [string tolower [concat $datetime$username$method$server_id$server_key]] + } + + ns_log Notice "Hash string: [string tolower [ns_sha1 $rawstring]] $datetime $server_key --- $rawstring" + + return [string tolower [ns_sha1 $rawstring]] + +} \ No newline at end of file Index: dotlrn_packages/lams2int/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/index.adp 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,58 @@ + +@title@ +@context@ + +

@display_title@

+

+

+Learner's Introduction: +

+

+@introduction;noquote@ +
+

+
+

+ + + + + + +

+ +

+ +

+
+ +

 

+
+ + + + + + + +
+ + Tell us what you think about @display_title@ + +
+ @general_comments_link;noquote@ +
+ +
+ + +
    + @the_comments;noquote@ +
+
+ +
Index: dotlrn_packages/lams2int/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/index.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,50 @@ +# packages/lams2int/www/index.tcl + +ad_page_contract { + + Jumps directly to a LAMS sequence + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id index.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + lesson_id +} -properties { +} -validate { +} -errors { +} + + +set lams_server_url [lams2int::get_lams_server_url] +set username [ad_verify_and_get_user_id] +set datetime [lams2int::get_datetime] +set server_id [lams2int::get_server_id] +set hashValue [lams2int::ws::generate_hash -datetime $datetime -username $username -method "learner"] +set course_id [dotlrn_community::get_community_id] + + +# LAMS Sequence info + +db_1row seq_info {select display_title, introduction, learning_session_id, user_id from lams_lessons where lesson_id = :lesson_id} + +set introduction [ad_convert_to_html $introduction] + +set title $display_title +set context [list "View Lesson: $display_title"] + + +# if the user that started the sequence is the same as the user +# trying to access the sequence, we give him admin access +if {[string equal $user_id $username]} { + set admin_p 1 + + set hashmonitor [lams2int::ws::generate_hash -datetime $datetime -username $username -method "monitor"] + +} else { + set admin_p 0 +} + + +# General comments +set the_comments [general_comments_get_comments -print_content_p 1 $lesson_id] +set general_comments_link [general_comments_create_link -object_name "$display_title" -link_text "Add comments to $display_title" -link_attributes {style="font:85% arial; border: solid 1px black; background-color: \\#e1e1e1; text-align: center; padding: 1px; padding-left: 8px; padding-right: 8px; color: black; text-decoration: none; white-space: nowrap;"} $lesson_id [ns_conn url]?[ns_conn query]] Index: dotlrn_packages/lams2int/www/admin/add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/add-2.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/add-2.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,55 @@ +# packages/lams2int/www/admin/add-2.tcl + +ad_page_contract { + + Creates a new instance of LAMS sequence and adds a new lesson to a course + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-16 + @cvs-id add-2.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + name + lesson_id:integer + sequence_id:integer + introduction:optional +} -properties { +} -validate { +} -errors { +} + + +# get parameters data +set datetime [lams2int::get_datetime] +set lams_server_url [lams2int::get_lams_server_url] +set server_id [lams2int::get_server_id] +set username [ad_verify_and_get_user_id] + +# get course data +set course_id [dotlrn_community::get_community_id] + + +# methods + +# start, schedule, delete + +set method "start" + +set hashSeq [lams2int::ws::generate_hash -datetime $datetime -username $username] + +set lesson_url "$lams_server_url/services/xml/LessonManager?method=$method&serverId=$server_id&ldId=$sequence_id&datetime=[ad_urlencode $datetime]&hashValue=$hashSeq&username=$username&courseId=$course_id&title=$name&desc=$introduction&country=AU&lang=en" + + +set xml [lindex [ad_httpget -url $lesson_url -timeout 30] 1] + +set xml [encoding convertfrom utf-8 $xml] +set doc [dom parse $xml] +set content [$doc documentElement] + + +set lesson_id [$content getAttribute lessonId] + +set seq_id [lams2int::add -learning_session_id $lesson_id -display_title $name -introduction $introduction \ + -hide "f" -creation_user $username -package_id [ad_conn package_id] -community_id $course_id] + +ad_returnredirect -message "Your lesson $name is now available" -html [dotlrn_community::get_community_url $course_id] + Index: dotlrn_packages/lams2int/www/admin/add.adp =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/add.adp 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,232 @@ + +@title@ +@context@ + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + +
+ Sequences
+

The directory structure below contains the sequences you can create a lesson for.
Select one and click on the next button to continue.

+
+ + + + +
+ + + + + +
+
+ + + + +
+ +
+
+ + \ No newline at end of file Index: dotlrn_packages/lams2int/www/admin/add.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/add.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,103 @@ +# packages/lams2int/www/admin/add.tcl + +ad_page_contract { + + Adds a LAMS lesson + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-16 + @cvs-id add.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + +} -properties { +} -validate { +} -errors { +} + + +set title "Add LAMS Lesson" +set context [list "Add LAMS Lesson"] + +# get parameters data +set datetime [lams2int::get_datetime] +set lams_server_url [lams2int::get_lams_server_url] +set server_id [lams2int::get_server_id] +set username [ad_verify_and_get_user_id] + +# get course data +set course_id [dotlrn_community::get_community_id] + +#set datetime 1 + +set hashValue [lams2int::ws::generate_hash -datetime $datetime -username $username -method "author"] + + +# get variables to pass to LAMS + +set requestSrc [lams2int::get_request_source] +set notifyCloseURL "[ad_url][util_get_current_url]" + + +# get seq list + +set hashSeq [lams2int::ws::generate_hash -datetime $datetime -username $username] + +set get_sequences_url "$lams_server_url/services/xml/LearningDesignRepository?serverId=$server_id&datetime=[ad_urlencode $datetime]&hashValue=$hashSeq&username=$username&courseId=$course_id&mode=2&country=AU&lang=en" + +ns_log Notice "URL requested $get_sequences_url" + + +set xml [lindex [ad_httpget -url $get_sequences_url -timeout 30] 1] + +set xml [encoding convertfrom utf-8 $xml] +set doc [dom parse $xml] +set content [$doc documentElement] + +proc process_node { node } { + + if {[string equal [$node nodeName] "Folder"]} { + + append output "\[ '[$node getAttribute name]', null , " + + if {[$node hasChildNodes]} { + + foreach child [$node childNodes] { + + append output [process_node $child] + + if {[string equal [$child nodeName] "Folder"]} { + + if {![empty_string_p [$child nextSibling]]} { + append output " \], " + } else { + append output " \]" + } + } + + } + + } else { + + append output "\['', null\]" + + } + } else { + # the node is a LearningDesign + + append output "\[ '[$node getAttribute name]', 'javascript:selectSequence([$node getAttribute resourceId])' \] " + + if {![empty_string_p [$node nextSibling]]} { + append output ", " + } else { + append output "" + } + + } + + return $output +} + + + +set sequence_list [concat [process_node $content] " \] "] + Index: dotlrn_packages/lams2int/www/admin/hide.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/hide.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/hide.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,37 @@ +# packages/lams2int/www/admin/hide.tcl + +ad_page_contract { + + Hide or displays a sequence + changes the display info for a sequence and returns back to the admin page + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id hide.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + lesson_id:integer + hide +} -properties { +} -validate { +} -errors { +} + +# checks whether the user has permissions on the lesson. + +permission::require_permission -object_id $lesson_id -privilege admin + +if { [string equal $hide "f"] } { + + db_dml update_lesson_display { + update lams_lessons set hide = 't' where lesson_id = :lesson_id + } + +} else { + + db_dml update_seq_display { + update lams_lessons set hide = 'f' where lesson_id = :lesson_id + } + + +} +ad_returnredirect -message "Display changed successfully!" [export_vars -base index lesson_id] Index: dotlrn_packages/lams2int/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/index.adp 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,14 @@ + +@title@ +@context@ + +

+ Add a LAMS Lesson +   + + LAMS Author +   + +

+ + Index: dotlrn_packages/lams2int/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/index.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,88 @@ +# packages/lams2int/www/admin/index.tcl + +ad_page_contract { + + LAMS Integration Admin + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id index.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + +} -properties { +} -validate { +} -errors { +} + +# +set title "LAMS Administration" +set context [list "LAMS Administration"] + +# LAMS Variables & settings +set username [ad_verify_and_get_user_id] +set package_id [ad_conn package_id] +set lams_server_url [lams2int::get_lams_server_url] +set datetime [lams2int::get_datetime] +set server_id [lams2int::get_server_id] +set course_id [dotlrn_community::get_community_id] +set requestSrc [lams2int::get_request_source] +set notifyCloseURL "[ad_url][util_get_current_url]" + +set hashauthor [lams2int::ws::generate_hash -datetime $datetime -username $username -method "author"] + + + +template::list::create \ + -name d_lesson \ + -multirow d_lesson \ + -html {width 100%} \ + -key lesson_id \ + -no_data "No available lessons" \ + -elements { + lesson_name { + label "Title" + display_eval {[string_truncate -len 40 -ellipsis "..." $display_title]} + link_url_eval {[export_vars -base ../index lesson_id]} + link_html {title "View lesson"} + } + hide { + label "Display?" + display_template {@d_lesson.hide_p;noquote@} + html {align "center"} + + } + creation_user { + label "Started by" + display_eval {[person::name -person_id $creation_user]} + link_url_eval {[acs_community_member_url -user_id $creation_user]} + html {align "center"} + } + start_time { + label "Started" + display_eval {[lc_time_fmt $start_time "%x %X"]} + html {align "center"} + } + + } + + + +db_multirow -extend {hide_p} d_lesson select_d_lesson { + select + lesson_id, display_title, introduction, hide, start_time, user_id as creation_user + from + lams_lessons + where + package_id = :package_id + order by start_time desc +} { + + # show Display or Hide checkbox + if {[string equal $hide "f"]} { + set hide_p "" + + } else { + set hide_p "" + } + +} \ No newline at end of file Index: dotlrn_packages/lams2int/www/admin/list.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/list.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,42 @@ +# packages/lams2int/www/admin/list.tcl + +ad_page_contract { + + send LAMS learning deisgn list as a string seperated by ":" to client + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id list.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + +} -properties { +} -validate { +} -errors { +} + +set datetime [lams2int::get_datetime] +set lams_server_url [lams2int::get_lams_server_url] +set server_id [lams2int::get_server_id] +set username [ad_conn user_id] + +#set rawstring [string tolower [concat +# $datetime$username$server_id$server_key]] +#set hash [string tolower [ns_sha1 $rawstring]] +set hash [lams2int::ws::generate_hash -datetime $datetime -username $username] + +set available_sequences [lams_get_sequences $server_id $datetime $hash $username] + +if {[regexp "AuthenticateException" $available_sequences]} { + ns_return 401 text/html "" + #ns_write "HTTP/1.1 401 Unauthenticated" + ad_script_abort +} elseif {[regexp "ServerNotFoundException" $available_sequences]} { + ns_write "HTTP/1.1 417 Expectation Failed" + ad_script_abort +} elseif {[string equal $available_sequences "NOT_SET_UP"]} { + ns_write "HTTP/1.1 402 Setup Required" + ad_script_abort +} + +ns_write $available_sequences +ad_script_abort \ No newline at end of file Index: dotlrn_packages/lams2int/www/admin/pdate.gif =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/Attic/pdate.gif,v diff -u Binary files differ Index: dotlrn_packages/lams2int/www/admin/scripts/calendar.css =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/scripts/calendar.css,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/scripts/calendar.css 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,172 @@ +/* +Copyright (c) 2006, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +Version 0.11.0 +*/ + +.yui-cal2upwrapper {height:1%;} /* IE */ +.yui-cal2upwrapper:after {content:'.';clear:both;display:block;visibility:hidden;height:0;} /* others */ + +.yui-calcontainer { + float:left; + padding:5px; + background-color:#F7F9FB; + border:1px solid #7B9EBD; +} + +.yui-calcontainer .title { + font:100% sans-serif; + color:#000; + font-weight:bold; + margin-bottom:5px; + height:auto; + width:304px; + position:relative; +} + +.yui-calcontainer .title .close-icon { + position:absolute; + right:0; + top:0; + border:none; +} + +.yui-calcontainer .cal2up { + float:left; +} + +.yui-calendar .calnavleft { + position:absolute; + background-repeat:no-repeat; + cursor:pointer; + top:2px; + bottom:0; + width:9px; + height:12px; + left:2px; +} + +.yui-calendar .calnavright { + position:absolute; + background-repeat:no-repeat; + cursor:pointer; + top:2px; + bottom:0; + width:9px; + height:12px; + right:2px; +} + +/* Calendar element styles */ + +.yui-calendar { + font:100% sans-serif; + text-align:center; + border-spacing:0; + border-collapse:separate; +} + +.yui-calendar td.calcell { + width:1.5em; + height:1em; + border:1px solid #E0E0E0; + background-color:#FFF; +} + +.yui-calendar td.calcell a { + color:#003DB8; + text-decoration:none; +} + +.yui-calendar td.calcell.today { + border:1px solid #000; +} + +.yui-calendar td.calcell.oom { + cursor:default; + color:#999; + background-color:#EEE; + border:1px solid #E0E0E0; +} + +.yui-calendar td.calcell.selected { + color:#003DB8; + background-color:#FFF19F; + border:1px solid #FF9900; +} + +.yui-calendar td.calcell.calcellhover { + cursor:pointer; + color:#FFF; + background-color:#FF9900; + border:1px solid #FF9900; +} + +/* Added to perform some correction for Opera 8.5 + hover redraw bug */ +table.yui-calendar:hover { + background-color:#FFF; +} + +.yui-calendar td.calcell.calcellhover a { + color:#FFF; +} + +.yui-calendar td.calcell.restricted { + text-decoration:line-through; +} + +.yui-calendar td.calcell.previous { + color:#CCC; +} + +.yui-calendar td.calcell.highlight1 { background-color:#CCFF99; } +.yui-calendar td.calcell.highlight2 { background-color:#99CCFF; } +.yui-calendar td.calcell.highlight3 { background-color:#FFCCCC; } +.yui-calendar td.calcell.highlight4 { background-color:#CCFF99; } + + +.yui-calendar .calhead { + border:1px solid #E0E0E0; + vertical-align:middle; + background-color:#FFF; +} + +.yui-calendar .calheader { + position:relative; + width:100%; + text-align:center; +} + +.yui-calendar .calheader img { + border:none; +} + +.yui-calendar .calweekdaycell { + color:#666; + font-weight:normal; +} + +.yui-calendar .calfoot { + background-color:#EEE; +} + +.yui-calendar .calrowhead, .yui-calendar .calrowfoot { + color:#666; + font-size:9px; + font-style:italic; + font-weight:normal; + width:15px; +} + +.yui-calendar .calrowhead { + border-right-width:2px; +} + +/*Specific changes for calendar running under fonts/reset */ +.yui-calendar a:hover {background:inherit;} +p#clear {clear:left; padding-top:10px;} + +#container1 {font-family:arial,helvetica,clean,sans-serif; font-size:small;} +table {font-size:inherit;font:100%;} Index: dotlrn_packages/lams2int/www/admin/scripts/calendar.js =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/scripts/calendar.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/scripts/calendar.js 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,155 @@ +/* +Copyright (c) 2006, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 0.11.0 +*/ +YAHOO.widget.DateMath=new function(){this.DAY="D";this.WEEK="W";this.YEAR="Y";this.MONTH="M";this.ONE_DAY_MS=1000*60*60*24;this.add=function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}} +d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;} +return d;};this.subtract=function(date,field,amount){return this.add(date,field,(amount*-1));};this.before=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()ms){return true;}else{return false;}};this.between=function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}};this.getJan1=function(calendarYear){return new Date(calendarYear,0,1);};this.getDayOffset=function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;};this.getWeekNumber=function(date,calendarYear,weekStartsOn){date.setHours(12,0,0,0);if(!weekStartsOn){weekStartsOn=0;} +if(!calendarYear){calendarYear=date.getFullYear();} +var weekNum=-1;var jan1=this.getJan1(calendarYear);var jan1Offset=jan1.getDay()-weekStartsOn;var jan1DayOfWeek=(jan1Offset>=0?jan1Offset:(7+jan1Offset));var endOfWeek1=this.add(jan1,this.DAY,(6-jan1DayOfWeek));endOfWeek1.setHours(23,59,59,999);var month=date.getMonth();var day=date.getDate();var year=date.getFullYear();var dayOffset=this.getDayOffset(date,calendarYear);if(dayOffset<0||this.before(date,endOfWeek1)){weekNum=1;}else{weekNum=2;var weekBegin=new Date(endOfWeek1.getTime()+1);var weekEnd=this.add(weekBegin,this.WEEK,1);while(!this.between(date,weekBegin,weekEnd)){weekBegin=this.add(weekBegin,this.WEEK,1);weekEnd=this.add(weekEnd,this.WEEK,1);weekNum+=1;}} +return weekNum;};this.isYearOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;} +return overlaps;};this.isMonthOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;} +return overlaps;};this.findMonthStart=function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;};this.findMonthEnd=function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;};this.clearTime=function(date){date.setHours(0,0,0,0);return date;};} +YAHOO.widget.Calendar_Core=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar_Core.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")==0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar_Core.DATE="D";YAHOO.widget.Calendar_Core.MONTH_DAY="MD";YAHOO.widget.Calendar_Core.WEEKDAY="WD";YAHOO.widget.Calendar_Core.RANGE="R";YAHOO.widget.Calendar_Core.MONTH="M";YAHOO.widget.Calendar_Core.DISPLAY_DAYS=42;YAHOO.widget.Calendar_Core.STOP_RENDER="S";YAHOO.widget.Calendar_Core.prototype={Config:null,parent:null,index:-1,cells:null,weekHeaderCells:null,weekFooterCells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,pageDate:null,_pageDate:null,minDate:null,maxDate:null,selectedDates:null,_selectedDates:null,shellRendered:false,table:null,headerCell:null};YAHOO.widget.Calendar_Core.prototype.init=function(id,containerId,monthyear,selected){this.setupConfig();this.id=id;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(containerId);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var month;var year;if(monthyear){var aMonthYear=monthyear.split(this.Locale.DATE_FIELD_DELIMITER);month=parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);year=parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);}else{month=this.today.getMonth()+1;year=this.today.getFullYear();} +this.pageDate=new Date(year,month-1,1);this._pageDate=new Date(this.pageDate.getTime());if(selected){this.selectedDates=this._parseDates(selected);this._selectedDates=this.selectedDates.concat();}else{this.selectedDates=new Array();this._selectedDates=new Array();} +this.wireDefaultEvents();this.wireCustomEvents();};YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents=function(){this.doSelectCell=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){if(cal.Options.MULTI_SELECT){var link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{var link=cell.getElementsByTagName("A")[0];link.blur() +cal.selectCell(index);}}} +this.doCellMouseOver=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(cell,cal.Style.CSS_CELL_HOVER);}} +this.doCellMouseOut=function(e,cal){YAHOO.util.Dom.removeClass(this,cal.Style.CSS_CELL_HOVER);} +this.doNextMonth=function(e,cal){cal.nextMonth();} +this.doPreviousMonth=function(e,cal){cal.previousMonth();}} +YAHOO.widget.Calendar_Core.prototype.wireCustomEvents=function(){} +YAHOO.widget.Calendar_Core.prototype.setupConfig=function(){this.Config=new Object();this.Config.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_CONTAINER:"yui-calcontainer",CSS_2UPWRAPPER:"yui-cal2upwrapper",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};this.Style=this.Config.Style;this.Config.Locale={MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],MONTHS_LONG:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKDAYS_1CHAR:["S","M","T","W","T","F","S"],WEEKDAYS_SHORT:["Su","Mo","Tu","We","Th","Fr","Sa"],WEEKDAYS_MEDIUM:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WEEKDAYS_LONG:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DATE_DELIMITER:",",DATE_FIELD_DELIMITER:"/",DATE_RANGE_DELIMITER:"-",MY_MONTH_POSITION:1,MY_YEAR_POSITION:2,MD_MONTH_POSITION:1,MD_DAY_POSITION:2,MDY_MONTH_POSITION:1,MDY_DAY_POSITION:2,MDY_YEAR_POSITION:3};this.Locale=this.Config.Locale;this.Config.Options={MULTI_SELECT:false,SHOW_WEEKDAYS:true,START_WEEKDAY:0,SHOW_WEEK_HEADER:false,SHOW_WEEK_FOOTER:false,HIDE_BLANK_WEEKS:false,NAV_ARROW_LEFT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/callt.gif",NAV_ARROW_RIGHT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/calrt.gif"};this.Options=this.Config.Options;this.customConfig();if(!this.Options.LOCALE_MONTHS){this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;} +if(!this.Options.LOCALE_WEEKDAYS){this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;} +if(this.Options.START_WEEKDAY>0){for(var w=0;w0){this.preMonthDays-=this.Options.START_WEEKDAY;} +if(this.preMonthDays<0){this.preMonthDays+=7;} +this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekRowIndex=0;for(var c=0;c=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(r,1);}} +break;case YAHOO.widget.Calendar_Core.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];} +break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];} +break;} +if(renderer){cellRenderers[cellRenderers.length]=renderer;}}} +if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=this.renderCellStyleSelected;} +if(this.minDate){this.minDate=YAHOO.widget.DateMath.clearTime(this.minDate);} +if(this.maxDate){this.maxDate=YAHOO.widget.DateMath.clearTime(this.maxDate);} +if((this.minDate&&(workingDate.getTime()this.maxDate.getTime()))){cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=this.renderCellDefault;} +for(var x=0;x=0&&c<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);} +if((c%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);} +if(((c+1)%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);} +var postDays=this.postMonthDays;if(postDays>=7&&this.Options.HIDE_BLANK_WEEKS){var blankWeeks=Math.floor(postDays/7);for(var p=0;p=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(e,cal){for(var c in cal.cells){c=null;} +cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;} +YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_HEADER);var useYear=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)){useYear=workingDate.getFullYear();} +var weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useYear,this.Options.START_WEEKDAY);cell.innerHTML=weekNum;if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML="";var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.addMonths=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.addYears=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar_Core.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar_Core.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar_Core.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar_Core.prototype.reset=function(){this.selectedDates.length=0;this.selectedDates=this._selectedDates.concat();this.pageDate=new Date(this._pageDate.getTime());this.onReset();};YAHOO.widget.Calendar_Core.prototype.clear=function(){this.selectedDates.length=0;this.pageDate=new Date(this.today.getTime());this.onClear();};YAHOO.widget.Calendar_Core.prototype.select=function(date){this.onBeforeSelect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a-1){if(this.pageDate.getMonth()==dCellDate.getMonth()&&this.pageDate.getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);} +this.selectedDates.splice(cellDateIndex,1);} +if(this.parent){this.parent.sync(this);} +this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var count=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this);} +if(count>0){this.onDeselect();} +return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(date){var returnDate=new Array();if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i0){this.init(id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar.prototype.buildShell=function(){this.border=document.createElement("DIV");this.border.className=this.Style.CSS_CONTAINER;this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.border.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();};YAHOO.widget.Calendar.prototype.renderShell=function(){this.border.appendChild(this.table);this.oDomContainer.appendChild(this.border);this.shellRendered=true;};YAHOO.widget.Calendar.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.previousMonth);} +this.linkLeft=document.createElement("A");this.linkLeft.innerHTML=" ";YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.previousMonth,this,true);this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.nextMonth);} +this.linkRight=document.createElement("A");this.linkRight.innerHTML=" ";YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.nextMonth,this,true);this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;headerContainer.appendChild(this.linkLeft);headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));headerContainer.appendChild(this.linkRight);this.headerCell.appendChild(headerContainer);};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(pageCount,id,containerId,monthyear,selected){if(arguments.length>0){this.init(pageCount,id,containerId,monthyear,selected);}} +YAHOO.widget.CalendarGroup.prototype.init=function(pageCount,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p0) +{year+=1;} +cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var p=0;p=0;--p) +{var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p0) +{this.init(id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.index==0){if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth);} +this.linkLeft=document.createElement("A");this.linkLeft.innerHTML=" ";this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth,this.parent);headerContainer.appendChild(this.linkLeft);} +headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));if(this.index==1){if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.parent.doNextMonth);} +this.linkRight=document.createElement("A");this.linkRight.innerHTML=" ";this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.parent.doNextMonth,this.parent);headerContainer.appendChild(this.linkRight);} +this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar2up=function(id,containerId,monthyear,selected){if(arguments.length>0) +{this.buildWrapper(containerId);this.init(2,id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar2up.prototype=new YAHOO.widget.CalendarGroup();YAHOO.widget.Calendar2up.CSS_2UPWRAPPER="yui-cal2upwrapper";YAHOO.widget.Calendar2up.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.Calendar2up.CSS_2UPCONTAINER="cal2up";YAHOO.widget.Calendar2up.CSS_2UPTITLE="title";YAHOO.widget.Calendar2up.CSS_2UPCLOSE="close-icon";YAHOO.widget.Calendar2up.prototype.constructChild=function(id,containerId,monthyear,selected){var cal=new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);return cal;};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);outerContainer.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var innerContainer=document.createElement("DIV");innerContainer.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;innerContainer.id=containerId+"_inner";var cal1Container=document.createElement("DIV");cal1Container.id=containerId+"_0";cal1Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;cal1Container.style.marginRight="10px";var cal2Container=document.createElement("DIV");cal2Container.id=containerId+"_1";cal2Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;outerContainer.appendChild(innerContainer);innerContainer.appendChild(cal1Container);innerContainer.appendChild(cal2Container);this.innerContainer=innerContainer;this.outerContainer=outerContainer;} +YAHOO.widget.Calendar2up.prototype.render=function(){this.renderHeader();YAHOO.widget.CalendarGroup.prototype.render.call(this);this.renderFooter();};YAHOO.widget.Calendar2up.prototype.renderHeader=function(){if(!this.title){this.title="";} +if(!this.titleDiv) +{this.titleDiv=document.createElement("DIV");if(this.title=="") +{this.titleDiv.style.display="none";}} +this.titleDiv.className=YAHOO.widget.Calendar2up.CSS_2UPTITLE;this.titleDiv.innerHTML=this.title;if(this.outerContainer.style.position=="absolute") +{var linkClose=document.createElement("A");linkClose.href="javascript:void(null)";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this);var imgClose=document.createElement("IMG");imgClose.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.linkClose=linkClose;this.titleDiv.appendChild(linkClose);} +this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild);} +YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal) +{cal=this;} +cal.outerContainer.style.display="none";} +YAHOO.widget.Calendar2up.prototype.renderFooter=function(){} +YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up; Index: dotlrn_packages/lams2int/www/admin/scripts/dom.js =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/scripts/dom.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/scripts/dom.js 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1 @@ +/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt Version: 0.11.1 */ YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var isOpera=(ua.indexOf('opera')>-1);var isSafari=(ua.indexOf('safari')>-1);var isIE=(window.ActiveXObject);var id_counter=0;var util=YAHOO.util;var property_cache={};var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf('-')>-1){property=convert(property);}return property;};var toHyphen=function(property){if(property.indexOf('-')>-1){return property;}var converted='';for(var i=0,len=property.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region(); Index: dotlrn_packages/lams2int/www/admin/scripts/event.js =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/scripts/event.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/scripts/event.js 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1 @@ +/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */ YAHOO.util.CustomEvent=function(_1,_2,_3){this.type=_1;this.scope=_2||window;this.silent=_3;this.subscribers=[];if(YAHOO.util.Event){YAHOO.util.Event.regCE(this);}if(!this.silent){}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_5,_6){this.subscribers.push(new YAHOO.util.Subscriber(fn,_5,_6));},unsubscribe:function(fn,_7){var _8=false;for(var i=0,len=this.subscribers.length;i=0){_60=_18[_59];}if(!el||!_60){return false;}if(el.removeEventListener){el.removeEventListener(_58,_60[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_58,_60[this.WFN]);}}delete _18[_59][this.WFN];delete _18[_59][this.FN];delete _18[_59];return true;},getTarget:function(ev,_62){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_64){if(_64&&_64.nodeName&&"#TEXT"==_64.nodeName.toUpperCase()){return _64.parentNode;}else{return _64;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||((ev.type=="keypress")?ev.keyCode:0);},_getCacheIndex:function(el,_68,fn){for(var i=0,len=_18.length;i0);}var _73=[];for(var i=0,len=_19.length;i0){for(var i=0,len=_18.length;i0){for(i=0,len=_18.length;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: dotlrn_packages/lams2int/www/admin/scripts/tree_tpl.js =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/scripts/tree_tpl.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/scripts/tree_tpl.js 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,36 @@ +/* + Feel free to use your custom treeicons for the tree. Make sure they are all of the same size. + User treeicons collections are welcome, we'll publish them giving all regards. +*/ + +var TREE_TPL = { + 'target' : '_self', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : 'treeicons/empty.gif', // empty image + 'icon_l' : 'treeicons/line.gif', // vertical line + + 'icon_32' : 'treeicons/base.gif', // root leaf icon normal + 'icon_36' : 'treeicons/base.gif', // root leaf icon selected + + 'icon_48' : 'treeicons/base.gif', // root icon normal + 'icon_52' : 'treeicons/base.gif', // root icon selected + 'icon_56' : 'treeicons/base.gif', // root icon opened + 'icon_60' : 'treeicons/base.gif', // root icon selected + + 'icon_16' : 'treeicons/folder.gif', // node icon normal + 'icon_20' : 'treeicons/folderopen.gif', // node icon selected + 'icon_24' : 'treeicons/folderopen.gif', // node icon opened + 'icon_28' : 'treeicons/folderopen.gif', // node icon selected opened + + 'icon_0' : 'treeicons/page.gif', // leaf icon normal + 'icon_4' : 'treeicons/page.gif', // leaf icon selected + + 'icon_2' : 'treeicons/joinbottom.gif', // junction for leaf + 'icon_3' : 'treeicons/join.gif', // junction for last leaf + 'icon_18' : 'treeicons/plusbottom.gif', // junction for closed node + 'icon_19' : 'treeicons/plus.gif', // junctioin for last closed node + 'icon_26' : 'treeicons/minusbottom.gif',// junction for opened node + 'icon_27' : 'treeicons/minus.gif' // junctioin for last opended node +}; + Index: dotlrn_packages/lams2int/www/admin/scripts/yahoo.js =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int/www/admin/scripts/yahoo.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int/www/admin/scripts/yahoo.js 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1 @@ +/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */ var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var _2=ns.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.log=function(_5,_6,_7){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_5,_6,_7);}else{return false;}};YAHOO.extend=function(_9,_10){var f=function(){};f.prototype=_10.prototype;_9.prototype=new f();_9.prototype.constructor=_9;_9.superclass=_10.prototype;if(_10.prototype.constructor==Object.prototype.constructor){_10.prototype.constructor=_10;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example"); \ No newline at end of file Index: dotlrn_packages/lams2int-portlet/lams2int-portlet.info =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/lams2int-portlet.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/lams2int-portlet.info 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,26 @@ + + + + + LAMS2.x Integration Portlet + LAMS2.x Integration Portlets + f + t + + + Ernie Ghiglione + LAMS Foundation + 0 + + + + + + + + + + + + + Index: dotlrn_packages/lams2int-portlet/sql/postgresql/lams2int-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/sql/postgresql/lams2int-admin-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/sql/postgresql/lams2int-admin-portlet-create.sql 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,148 @@ +-- +-- packages/lams2int-portlet/sql/postgresql/lams2int-admin-portlet-create.sql +-- +-- @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) +-- @creation-date 2007-04-17 +-- @cvs-id lams2int-admin-portlet-create.sql,v 1.1 2007/09/12 06:37:02 ernieg Exp +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id = portal_datasource__new( + ''lams2int_admin_portlet'', + ''Displays a folder_id'' + ); + +RAISE NOTICE '' created new ds''; + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shadeable_p'', + ''f'' + ); + +RAISE NOTICE '' set shadeable''; + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''f'' + ); + +RAISE NOTICE '' set hideable''; + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' + ); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '' '' + ); + + +return 0; + +end;' language 'plpgsql'; + +select inline_0(); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__new ( + 'portal_datasource', + 'lams2int_admin_portlet', + 'lams2int_admin_portlet' +); + +-- add all the hooks +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'GetMyName', + 'lams2int_admin_portlet::get_my_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'GetPrettyName', + 'lams2int_admin_portlet::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'Link', + 'lams2int_admin_portlet::link', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'AddSelfToPage', + 'lams2int_admin_portlet::add_self_to_page', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'Show', + 'lams2int_admin_portlet::show', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'Edit', + 'lams2int_admin_portlet::edit', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_admin_portlet', + 'RemoveSelfFromPage', + 'lams2int_admin_portlet::remove_self_from_page', + 'TCL' +); + +-- Add the binding +select acs_sc_binding__new( + 'portal_datasource', + 'lams2int_admin_portlet' +); \ No newline at end of file Index: dotlrn_packages/lams2int-portlet/sql/postgresql/lams2int-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/sql/postgresql/lams2int-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/sql/postgresql/lams2int-portlet-create.sql 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,157 @@ +-- +-- packages/lams2int-portlet/sql/postgresql/lams2int-portlet-create.sql +-- +-- @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) +-- @creation-date 2007-04-17 +-- @cvs-id lams2int-portlet-create.sql,v 1.1 2007/09/12 06:37:02 ernieg Exp +-- + +create function inline_0 () +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id = portal_datasource__new( + ''lams2int_portlet'', + ''Displays a Folder_id'' + ); + + +perform portal_datasource__set_def_param( + ds_id, + ''t'', + ''t'', + ''shadeable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' +); + + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''style'', + ''list'' +); + +perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '' '' +); + +return 0; + +end; ' language 'plpgsql'; + + +select inline_0 (); + +drop function inline_0 (); + +-- create the implementation +select acs_sc_impl__new( + 'portal_datasource', + 'lams2int_portlet', + 'lams2int_portlet' +); + + +-- add all the hooks +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'GetMyName', + 'lams2int_portlet::get_my_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'GetPrettyName', + 'lams2int_portlet::get_pretty_name', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'Link', + 'lams2int_portlet::link', + 'TCL' +); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'AddSelfToPage', + 'lams2int_portlet::add_self_to_page', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'Show', + 'lams2int_portlet::show', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'Edit', + 'lams2int_portlet::edit', + 'TCL' + ); + +select acs_sc_impl_alias__new( + 'portal_datasource', + 'lams2int_portlet', + 'RemoveSelfFromPage', + 'lams2int_portlet::remove_self_from_page', + 'TCL' + ); + + -- Add the binding +select acs_sc_binding__new ( + 'portal_datasource', + 'lams2int_portlet' +); + +\i lams2int-admin-portlet-create.sql Index: dotlrn_packages/lams2int-portlet/tcl/lams2int-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/tcl/lams2int-admin-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/tcl/lams2int-admin-portlet-procs.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,75 @@ +# packages/lams2int-portlet/tcl/lams2int-admin-portlet-procs.tcl + +ad_library { + + Procedures to support the LAMS Integration portlet. + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id lams2int-admin-portlet-procs.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} + +namespace eval lams2int_admin_portlet { + + ad_proc -private get_my_name { + } { + return "lams2int_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "LAMS Integration Admin" + } + + ad_proc -private my_package_key { + } { + return "lams2int-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a LAMS Integration admin PE to the given admin + # portal. There should only + ever be one of these portals on an admin page with only one + # lams2int_package_id + + @param portal_id The page to add self to + @param package_id the id of the lams2int package + + @return element_id The new element's id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + ] + } + + + ad_proc -public remove_self_from_page { + portal_id + } { + Removes a LAMS Integration admin PE from the given portal + } { + portal::remove_element -portal_id $portal_id -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "lams2int-admin-portlet" + } + +} Index: dotlrn_packages/lams2int-portlet/tcl/lams2int-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/tcl/lams2int-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/tcl/lams2int-portlet-procs.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,88 @@ +# packages/lams2int-portlet/tcl/lams2int-portlet-procs.tcl + +ad_library { + + Procedures to support the .LRN LAMS2.x Integrations portlet. + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id lams2int-portlet-procs.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} + +namespace eval lams2int_portlet { + + ad_proc -private get_my_name { + } { + return "lams2int_portlet" + } + + ad_proc -private my_package_key { + } { + return "lams2int-portlet" + } + + ad_proc -public get_pretty_name { + } { + return "LAMS Lessons" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + {-param_action:required} + } { + Adds a LAMS Integration PE to the given portal or appends the given + lams2int_package_id to the params of the lams2int pe already there + + @param portal_id The page to add self to + @param package_id the id of the lams2int package for this community + + @return element_id The new element's id + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id \ + -pretty_name [get_pretty_name] \ + -force_region [parameter::get_from_package_key \ + -package_key [my_package_key] \ + -parameter "lams2int_portlet_force_region"] \ + -param_action $param_action + ] + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + {-package_id:required} + } { + Removes a lams2int PE from the given page or just the passed + in lams2int_package_id parameter from the portlet + (that has other lams2int_package_ids) + + @param portal_id The page to remove self from + @param package_id + } { + portal::remove_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + } + + ad_proc -public show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "lams2int-portlet" + } + +} \ No newline at end of file Index: dotlrn_packages/lams2int-portlet/www/lams2int-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/www/lams2int-admin-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/www/lams2int-admin-portlet.adp 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,29 @@ + + +
+ +The LAMS .LRN Module parameters are not configured! +

+Configure the module parameters or contact your system administrator. +

+

+ For assistance see LAMS Community +

+
+ + +
+ + + + + + + Index: dotlrn_packages/lams2int-portlet/www/lams2int-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/www/lams2int-admin-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/www/lams2int-admin-portlet.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,41 @@ +# packages/lams2int-portlet/www/lams2int-admin-portlet.tcl + +ad_page_contract { + + The display logic for the LAMS Integration admin portlet + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id lams2int-admin-portlet.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + +} -properties { +} -validate { +} -errors { +} + + +array set config $cf +set list_of_package_ids $config(package_id) + +if {[llength $list_of_package_ids] > 1} { + # We have a problem! + return -code error "There should be only one instance of lams2int for admin purposes" +} + +set package_id [lindex $list_of_package_ids 0] + +set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0] + + +# we want to verify at least that a LAMS server has been configured + +set lams_server_url [lams2int::get_lams_server_url] + +if {[empty_string_p $lams_server_url]} { + set configured_p 0 +} else { + set configured_p 1 +} + +ad_return_template Index: dotlrn_packages/lams2int-portlet/www/lams2int-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/www/lams2int-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/www/lams2int-portlet.adp 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,8 @@ + + + + + + +   + Index: dotlrn_packages/lams2int-portlet/www/lams2int-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/dotlrn_packages/lams2int-portlet/www/lams2int-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dotlrn_packages/lams2int-portlet/www/lams2int-portlet.tcl 12 Sep 2007 06:37:02 -0000 1.1 @@ -0,0 +1,23 @@ +# packages/lams2int-portlet/www/lams2int-portlet.tcl + +ad_page_contract { + + The logic for the lorsm portlet. + + @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au) + @creation-date 2007-04-17 + @cvs-id lams2int-portlet.tcl,v 1.1 2007/09/12 06:37:02 ernieg Exp +} { + +} -properties { +} -validate { +} -errors { +} + +array set config $cf + +set shaded_p $config(shaded_p) +set list_of_package_ids [lsort $config(package_id)] +set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0] + +ad_return_template \ No newline at end of file