Index: openacs-4/packages/dotlrn-mmplayer/dotlrn-mmplayer.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/dotlrn-mmplayer.info,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/dotlrn-mmplayer.info	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!-- Generated by the OpenACS Package Manager -->
+
+<package key="dotlrn-mmplayer" url="http://openacs.org/repository/apm/packages/dotlrn-mmplayer" type="apm_service">
+    <package-name>dotLRN MMPlayer Applet</package-name>
+    <pretty-plural>dotLRN MMPlayer Applets</pretty-plural>
+    <initial-install-p>f</initial-install-p>
+    <singleton-p>t</singleton-p>
+
+    <version name="1.0" url="http://openacs.org/repository/download/apm/dotlrn-mmplayer-1.0.apm">
+        <owner url="http://openacs.org">OpenACS</owner>
+        <release-date>2006-05-15</release-date>
+        <vendor url="http://openacs.org">OpenACS</vendor>
+        <maturity>0</maturity>
+
+        <provides url="dotlrn-mmplayer" version="1.0"/>
+        <requires url="dotlrn" version="1.0"/>
+        <requires url="mmplayer-portlet" version="1.0"/>
+
+        <parameters>
+        <!-- No version parameters -->
+        </parameters>
+
+    </version>
+</package>
Index: openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.ca_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.ca_ES.ISO-8859-1.xml	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="dotlrn-mmplayer" package_version="1.0" locale="ca_ES" charset="ISO-8859-1">
+
+  <msg key="pretty_name">MMPlayer</msg>
+</message_catalog>
Index: openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.en_US.ISO-8859-1.xml	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="dotlrn-mmplayer" package_version="1.0" locale="en_US" charset="ISO-8859-1">
+
+  <msg key="pretty_name">MMPlayer</msg>
+</message_catalog>
Index: openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.es_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/catalog/dotlrn-mmplayer.es_ES.ISO-8859-1.xml	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="dotlrn-mmplayer" package_version="1.0" locale="es_ES" charset="ISO-8859-1">
+
+  <msg key="pretty_name">MMPlayer</msg>
+</message_catalog>
Index: openacs-4/packages/dotlrn-mmplayer/sql/postgresql/dotlrn-mmplayer-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/sql/postgresql/dotlrn-mmplayer-create.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/sql/postgresql/dotlrn-mmplayer-create.sql	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,131 @@
+
+-- create the implementation
+select acs_sc_impl__new (
+                'dotlrn_applet',
+                'dotlrn_mmplayer',
+                'dotlrn_mmplayer'
+);
+
+-- add all the hooks
+
+-- GetPrettyName
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'GetPrettyName',
+               'dotlrn_mmplayer::get_pretty_name',
+               'TCL'
+);
+
+-- AddApplet
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddApplet',
+               'dotlrn_mmplayer::add_applet',
+               'TCL'
+);
+
+-- RemoveApplet
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveApplet',
+               'dotlrn_mmplayer::remove_applet',
+               'TCL'
+);
+
+-- AddAppletToCommunity
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddAppletToCommunity',
+               'dotlrn_mmplayer::add_applet_to_community',
+               'TCL'
+);
+
+-- RemoveAppletFromCommunity
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveAppletFromCommunity',
+               'dotlrn_mmplayer::remove_applet_from_community',
+               'TCL'
+);
+
+-- AddUser
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddUser',
+               'dotlrn_mmplayer::add_user',
+               'TCL'
+);
+
+-- RemoveUser
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveUser',
+               'dotlrn_mmplayer::remove_user',
+               'TCL'
+);
+
+-- AddUserToCommunity
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddUserToCommunity',
+               'dotlrn_mmplayer::add_user_to_community',
+               'TCL'
+);
+
+-- RemoveUserFromCommunity
+select acs_sc_impl_alias__new (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveUserFromCommunity',
+               'dotlrn_mmplayer::remove_user_from_community',
+               'TCL'
+);
+
+-- AddPortlet
+select acs_sc_impl_alias__new (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'AddPortlet',
+        'dotlrn_mmplayer::add_portlet',
+        'TCL'
+    );
+
+-- RemovePortlet
+select acs_sc_impl_alias__new (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'RemovePortlet',
+        'dotlrn_mmplayer::remove_portlet',
+        'TCL'
+);
+
+-- Clone
+select acs_sc_impl_alias__new (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'Clone',
+        'dotlrn_mmplayer::clone',
+        'TCL'
+);
+
+select acs_sc_impl_alias__new (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'ChangeEventHandler',
+        'dotlrn_mmplayer::change_event_handler',
+        'TCL'
+);
+
+-- Add the binding
+select acs_sc_binding__new (
+            'dotlrn_applet',
+            'dotlrn_mmplayer'
+);
Index: openacs-4/packages/dotlrn-mmplayer/sql/postgresql/dotlrn-mmplayer-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/sql/postgresql/dotlrn-mmplayer-drop.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/sql/postgresql/dotlrn-mmplayer-drop.sql	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,99 @@
+
+select acs_sc_impl__delete(
+           'dotlrn_applet',             -- impl_contract_name
+           'dotlrn_mmplayer'            -- impl_name
+);
+
+
+-- add all the hooks
+
+-- GetPrettyName
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'GetPrettyName'
+);
+
+-- AddApplet
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddApplet'
+);
+
+-- RemoveApplet
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveApplet'
+);
+
+-- AddAppletToCommunity
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddAppletToCommunity'
+);
+
+-- RemoveAppletFromCommunity
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveAppletFromCommunity'
+);
+
+-- AddUser
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddUser'
+);
+
+-- RemoveUser
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveUser'
+);
+
+-- AddUserToCommunity
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'AddUserToCommunity'
+);
+
+-- RemoveUserFromCommunity
+select acs_sc_impl_alias__delete (
+               'dotlrn_applet',
+               'dotlrn_mmplayer',
+               'RemoveUserFromCommunity'
+);
+
+-- AddPortlet
+select acs_sc_impl_alias__delete (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'AddPortlet'
+    );
+
+-- RemovePortlet
+select acs_sc_impl_alias__delete (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'RemovePortlet'
+);
+
+-- Clone
+select acs_sc_impl_alias__delete (
+        'dotlrn_applet',
+        'dotlrn_mmplayer',
+        'Clone'
+);
+
+
+-- Add the binding
+select acs_sc_binding__delete (
+            'dotlrn_applet',
+            'dotlrn_mmplayer'
+);
Index: openacs-4/packages/dotlrn-mmplayer/tcl/dotlrn-mmplayer-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/tcl/dotlrn-mmplayer-procs-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/tcl/dotlrn-mmplayer-procs-postgresql.xql	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+
+<queryset>
+<rdbms><type>postgresql</type><version>7.1</version></rdbms>
+
+<fullquery name="dotlrn_mmplayer::clone.call_mmplayer_clone">
+  <querytext>
+    select mmplayer__clone ( 
+        :old_package_id,
+        :new_package_id
+      );
+  </querytext>
+</fullquery>
+
+
+</queryset>
Index: openacs-4/packages/dotlrn-mmplayer/tcl/dotlrn-mmplayer-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-mmplayer/tcl/dotlrn-mmplayer-procs.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-mmplayer/tcl/dotlrn-mmplayer-procs.tcl	22 Jun 2006 08:36:11 -0000	1.1
@@ -0,0 +1,202 @@
+
+ad_library {
+    
+    Procs to set up the dotLRN mmplayer applet
+    
+}
+
+namespace eval dotlrn_mmplayer {
+    
+    ad_proc -public applet_key {
+    } {
+        What's my applet key?
+    } {
+        return dotlrn_mmplayer
+    }
+
+    ad_proc -public package_key {
+    } {
+        What package do I deal with?
+    } {
+        return mmplayer
+    }
+
+    ad_proc -public my_package_key {
+    } {
+        What package do I deal with?
+    } {
+        return "dotlrn-mmplayer"
+    }
+
+    ad_proc -public get_pretty_name {
+    } {
+        returns the pretty name
+    } {
+        return "[_ dotlrn-mmplayer.pretty_name]"
+    }
+
+    ad_proc -public add_applet {
+    } {
+        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 {
+    } {
+        One time destroy. 
+    } {
+        dotlrn_applet::remove_applet_from_dotlrn -applet_key [applet_key]
+    }
+
+    ad_proc -public add_applet_to_community {
+        community_id
+    } {
+        Add the mmplayer applet to a specifc dotlrn community
+    } {
+        set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
+
+        # create the mmplayer 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
+        ]
+
+        mmplayer_admin_portlet::add_self_to_page \
+            -portal_id $admin_portal_id \
+            -package_id $package_id
+        
+        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 implimented!"
+    }
+
+    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
+    } {
+        mmplayer_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)
+    } { 
+        mmplayer_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
+    } {
+        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]
+        ]
+
+        db_exec_plsql call_mmplayer_clone {}
+        return $new_package_id
+    }
+
+    ad_proc -public change_event_handler {
+        community_id
+        event
+        old_value
+        new_value
+    } { 
+        listens for the following events: 
+    } { 
+    }   
+
+}
Index: openacs-4/packages/mmplayer/mmplayer.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/mmplayer.info,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/mmplayer.info	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!-- Generated by the OpenACS Package Manager -->
+
+<package key="mmplayer" url="http://openacs.org/repository/apm/packages/mmplayer/" type="apm_application">
+    <package-name>MMPlayer</package-name>
+    <pretty-plural>MMPlayer</pretty-plural>
+    <initial-install-p>f</initial-install-p>
+    <singleton-p>f</singleton-p>
+    
+    <version name="1.0" url="http://openacs.org/repository/download/apm/mmplayer-1.0.apm">
+        <owner url="http://openacs.org">OpenACS</owner>
+        <summary>MMPlayer</summary>
+        <release-date>2006-05-15</release-date>
+        <vendor url="http://openacs.org">OpenACS</vendor>
+        <description format="text/plain">MMPlayer</description>
+        <maturity>0</maturity>
+
+        <provides url="mmplayer" version="1.0"/>
+
+        <callbacks>
+        </callbacks>
+        <parameters>
+        </parameters>
+
+    </version>
+</package>
Index: openacs-4/packages/mmplayer/catalog/mmplayer.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/catalog/mmplayer.ca_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/catalog/mmplayer.ca_ES.ISO-8859-1.xml	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="mmplayer" package_version="1.0" locale="ca_ES" charset="ISO-8859-1">
+
+  <msg key="begin_date">Data d'inici</msg>
+  <msg key="comment">Comentaris</msg>
+  <msg key="enabled">Habilitat</msg>
+  <msg key="end_date">Data de fi</msg>
+  <msg key="height">Alt</msg>
+  <msg key="ok">Ok</msg>
+  <msg key="title">T�tol</msg>
+  <msg key="url">Url</msg>
+  <msg key="width">Ampl�ria</msg>
+</message_catalog>
Index: openacs-4/packages/mmplayer/catalog/mmplayer.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/catalog/mmplayer.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/catalog/mmplayer.en_US.ISO-8859-1.xml	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="mmplayer" package_version="1.0" locale="en_US" charset="ISO-8859-1">
+
+  <msg key="begin_date">Begin date</msg>
+  <msg key="comment">Comments</msg>
+  <msg key="enabled">Enabled</msg>
+  <msg key="end_date">End date</msg>
+  <msg key="height">Height</msg>
+  <msg key="ok">Ok</msg>
+  <msg key="title">Title</msg>
+  <msg key="url">Url</msg>
+  <msg key="width">Width</msg>
+</message_catalog>
Index: openacs-4/packages/mmplayer/catalog/mmplayer.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/catalog/mmplayer.es_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/catalog/mmplayer.es_ES.ISO-8859-1.xml	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="mmplayer" package_version="1.0" locale="es_ES" charset="ISO-8859-1">
+
+  <msg key="begin_date">Fecha inicio</msg>
+  <msg key="comment">Comentarios</msg>
+  <msg key="enabled">Habilitado</msg>
+  <msg key="end_date">Fecha fin</msg>
+  <msg key="height">Altura</msg>
+  <msg key="ok">Ok</msg>
+  <msg key="title">T�tulo</msg>
+  <msg key="url">Url</msg>
+  <msg key="width">Anchura</msg>
+</message_catalog>
Index: openacs-4/packages/mmplayer/sql/postgresql/mmplayer-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/sql/postgresql/mmplayer-create.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/sql/postgresql/mmplayer-create.sql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,21 @@
+
+create table mmplayer_items (
+    community_id                integer
+                                primary key
+                                not null,
+    url                         varchar(1000),
+    title                       varchar(200),    
+    comment                     varchar(500),
+    enabled_p                   char(1)
+                                default 't'
+                                not null
+                                check (enabled_p in ('t','f')),
+    width                       integer default 320,
+    height                      integer default 240,
+    begin_date                  timestamptz default current_timestamp not null,
+    end_date                    timestamptz default current_timestamp + interval '7 days' not null
+);
+
+
+--
+\i mmplayer-sc-create.sql
Index: openacs-4/packages/mmplayer/sql/postgresql/mmplayer-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/sql/postgresql/mmplayer-drop.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/sql/postgresql/mmplayer-drop.sql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,5 @@
+--
+
+drop table mmplayer_items;
+
+\i mmplayer-sc-drop.sql
Index: openacs-4/packages/mmplayer/sql/postgresql/mmplayer-sc-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/sql/postgresql/mmplayer-sc-create.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/sql/postgresql/mmplayer-sc-create.sql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,2 @@
+--
+
Index: openacs-4/packages/mmplayer/sql/postgresql/mmplayer-sc-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/sql/postgresql/mmplayer-sc-drop.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/sql/postgresql/mmplayer-sc-drop.sql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1 @@
+--
Index: openacs-4/packages/mmplayer/tcl/mmplayer-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/tcl/mmplayer-procs-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/tcl/mmplayer-procs-postgresql.xql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+
+<queryset>
+   <rdbms><type>postgresql</type><version>7.1</version></rdbms>
+
+</queryset>
Index: openacs-4/packages/mmplayer/tcl/mmplayer-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/tcl/mmplayer-procs.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/tcl/mmplayer-procs.tcl	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,56 @@
+ad_library {
+
+    Utility functions for MMPlayer Application
+    
+}
+
+namespace eval mmplayer {}
+
+ad_proc mmplayer_get_package_id {
+    -community_id
+} {
+   Get the mmplayer package in the selected community 
+
+    @param community_id
+} {
+
+    if {[info exist community_id] == 0} {
+        set community_id [dotlrn_community::get_community_id]
+    }
+    db_1row get_mmplayer_package_id {}
+
+    return $package_id
+}
+
+ad_proc -private mmplayer::now_plus_days { -ndays } {
+} {
+    set now [list]
+    foreach v [clock format [clock seconds] -format "%Y %m %d %H %M %S"] {
+      lappend now [template::util::leadingTrim $v]
+    }
+
+    set day [lindex $now 2]
+    set month [lindex $now 1]
+    set interval_def [template::util::date::defaultInterval day]
+    for { set i [lindex $interval_def 0] }  { $i <= 15 }  { incr i 1 } {
+      incr day
+      if { [expr $day + $i] >= [lindex $interval_def 1] } {
+      incr month 1
+      set day 1
+      }
+}
+
+    # replace the hour and minute values in the now list with new values
+    set now [lreplace $now 2 2 $day]
+    set now [lreplace $now 1 1 $month]
+
+    # set default time
+    set now [lreplace $now 3 3 23]
+    set now [lreplace $now 4 4 59]
+    set now [lreplace $now 5 5 59]
+
+    return [eval template::util::date::create $now]
+}
+
+
+
Index: openacs-4/packages/mmplayer/tcl/mmplayer-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/tcl/mmplayer-procs.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/tcl/mmplayer-procs.xql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+
+<queryset>
+
+
+</queryset>
Index: openacs-4/packages/mmplayer/www/add_resource.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/add_resource.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/add_resource.adp	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,7 @@
+
+<if @xhtml@ ne "">
+  @xhtml;noquote@
+</if>
+
+
+
Index: openacs-4/packages/mmplayer/www/add_resource.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/add_resource.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/add_resource.tcl	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,275 @@
+
+set user_id [ad_conn user_id]
+set community_id [dotlrn_community::get_community_id]
+
+set URL_PLAYER_FLV "/media/player_flv.swf"
+set URL_PLAYER_MP3 "/media/dewplayer.swf"
+set URL_LOGO "/media/uvlogo2.jpg"
+set apptype ""
+
+if {[exists_and_not_null community_id]} {
+  set res [db_0or1row do_select { select *,
+                                    (select to_date(begin_date,'YYYY-MM-DD HH24:MI:SS') from dual) as bd, 
+                                    (select to_date(end_date,'YYYY-MM-DD HH24:MI:SS') from dual) as ed
+                                  from mmplayer_items 
+                                  where community_id = :community_id
+                                        and begin_date <= now ()
+                                        and end_date >= now ()}]
+  if {$res == 1} {
+    set ext [string toupper [file extension $url]]
+    if {[string first "http://www.youtube.com/" $url] == 0} {
+      #http://www.youtube.com/v/cN7SNjVCOG4
+      set ext ".YOUTUBE"
+    } elseif {[string first "http://video.google.com/" $url] == 0} {
+      #http://video.google.com/
+      set ext ".GOOGLE"
+    } elseif {[string first "mms://" $url] == 0} {
+      #mms://147.156.41.66/IN-bib_regla-eng
+      set ext ".MMS"
+    }    
+
+    if {$enabled_p eq "t"} {
+      switch -glob $ext {      
+        ".FLV" {
+           set apptype "application/x-shockwave-flash"
+           set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                     <OBJECT type=\"$apptype\" data=\"$URL_PLAYER_FLV\" width=\"$width\" height=\"$height\">
+                       <PARAM name=\"movie\" value=\"$URL_PLAYER_FLV\" />
+                       <PARAM name=\"FlashVars\" 
+                              value=\"flv=$url&amp;width=$width&amp;height=$height&amp;startimage=$URL_LOGO&amp;margin=0&amp;showtime=1&amp;bgcolor=ff0000&amp;playercolor=ff0000&amp;loadingcolor=ff0000\" />
+                     </OBJECT>
+                     <BR>$comment</CENTER>"
+        }                                   
+        ".RM" {
+          set apptype "audio/x-pn-realaudio-plugin"
+          set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                      <OBJECT id=\"realplayer\" classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" width=\"$width\" height=\"$height\">
+                        <PARAM name=\"src\" value=\"$url\" />
+                        <PARAM name=\"autostart\" value=\"false\" />
+                        <PARAM name=\"controls\" value=\"imagewindow,controlpanel\" />
+                        <EMBED src=\"$url\" width=\"$width\" height=\"$height\" autostart=\"false\" controls=\"imagewindow,controlpanel\" 
+                               type=\"$apptype\">
+                        </EMBED>
+                      </OBJECT>
+                      <BR>$comment</CENTER>"      
+         }      
+        ".AAC" -                              
+        ".MOV" {
+          set apptype ""
+          set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                      <OBJECT classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" width=\"$width\" height=\"$height\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\">
+                        <PARAM name=\"qtsrc\" value=\"$url\" />
+                        <PARAM name=\"autoplay\" value=\"false\" />
+                        <PARAM name=\"controller\" value=\"true\" />
+                        <PARAM name=\"kioskmode\" value=\"true\" />
+                        <PARAM name=\"qtsrcdontusebrowser\" value=\"true\" />
+                        <PARAM name=\"src\" value=\"$url\" />
+                        <EMBED src=\"$url\" width=\"$width\" height=\"$height\" autoplay=\"false\"></EMBED>
+                      </OBJECT>
+                      <BR>$comment</CENTER>"      
+         }
+        ".MMS" {
+          set apptype "application/x-mplayer2"
+          set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                      <OBJECT src=\"$url\" srctype=\"$apptype\" width=\"$width\" height=\"$height\">
+                        <EMBED type=\"$apptype\" src=\"$url\" width=\"$width\" height=\"$height\" 
+                               ShowControls=\"1\" ShowDisplay=\"0\" ShowStatusBar=\"0\" Name=\"MediaPlayer\"
+                               pluginspage=\"http://www.microsoft.com/windows/windowsmedia/download/\">
+                        </EMBED>
+                      </OBJECT>
+                      <BR>$comment</CENTER>"      
+         }
+        ".WMA" -
+        ".WMV" {
+            set apptype "application/x-oleobject"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                       <OBJECT id=\"winplayer\" classid=\"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6\" 
+                               width=\"$width\" height=\"$height\" type=\"$apptype\">
+                         <PARAM name=\"url\" value=\"$url\" />
+                         <PARAM name=\"autostart\" value=\"-1\" />
+                         <PARAM name=\"uiMode\" value=\"full\" />
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" autostart=\"-1\" uiMode=\"full\" 
+                                type=\"$apptype\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\">
+                         </EMBED>
+                       </OBJECT>
+                       <BR>$comment</CENTER>"      
+         }                                   
+        ".MP3" {
+            set apptype "application/x-shockwave-flash"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                       <OBJECT type=\"$apptype\" data=\"$URL_PLAYER_MP3?son=$url&autoplay=0\" width=\"$width\" height=\"$height\">
+                         <PARAM name=\"movie\" value=\"$URL_PLAYER_MP3?son=$url&autoplay=0\" /> 
+                       </OBJECT>
+                       <BR>$comment</CENTER>"      
+         }                                   
+        ".AVI" {
+            set apptype ""
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT classid=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" width=\"$width\" height=\"$height\">
+                         <PARAM name=\"filename\" value=\"$url\" />
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" autostart=\"false\">
+                         </EMBED>
+                       </OBJECT>
+                       <BR>$comment</CENTER>"
+         } 
+        ".MPEG" - 
+        ".MPG" {
+            set apptype "video/mpeg"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT src=\"$url\" srctype=\"$apptype\" width=\"$width\" height=\"$height\">
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\"></EMBED>                       
+                       </OBJECT>
+                       <BR>$comment</CENTER>"
+         }          
+        ".PDF" {
+            set apptype "application/pdf"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT src=\"$url\" srctype=\"$apptype\" width=\"$width\" height=\"$height\">
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" type=\"$apptype\"></EMBED>
+                       </OBJECT>
+                       <BR>$comment</CENTER>"
+         }
+        ".SWF" {
+            set apptype "application/x-shockwave-flash"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT width=\"$width\" height=\"$height\">
+                         <PARAM name=\"movie\" value=\"$url\" />
+                         <PARAM name=\"play\" value=\"true\" />
+                         <PARAM name=\"showcontrols\" value=\"1\" />
+                         <PARAM name=\"quality\" value=\"high\" />
+                         <PARAM name=\"menu\" value=\"true\" />
+                         <PARAM name=\"wmode\" value=\"transparent\">
+                         <PARAM name=\"pluginurl\" value=\"http://www.macromedia.com/go/getflashplayer\">
+                         <EMBED src=\"$url\"
+                                type=\"$apptype\"
+                                play=\"true\"
+                                quality=\"high\" 
+                                menu=\"true\"
+                                pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"
+                                width=\"$width\" 
+                                height=\"$height\">
+                         </EMBED>
+                       </OBJECT>
+                       <BR>$comment</CENTER>"
+         } 
+        ".CLASS" {
+            set apptype "application/x-java-applet"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT src=\"$url\" srctype=\"$apptype\">
+                         <PARAM name=\"height\" value=\"$height\" valuetype=\"data\" />
+                         <PARAM name=\"width\" value=\"$width\" valuetype=\"data\" />
+                         This user agent cannot process a java applet.
+                       </OBJECT>                             
+                       <BR>$comment</CENTER>"
+        }
+        ".HTM" - 
+        ".HTML" {
+            set apptype "text/html"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                         <IFRAME src=\"$url\" width=\"$width\" height=\"$height\"></IFRAME>
+                       <BR>$comment</CENTER>"
+         }                  
+        ".PNG" -
+        ".GIF" -
+        ".JPG" -
+        ".JPEG" {
+            set apptype "image/jpeg"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                         <IMG src=\"$url\" width=\"$width\" height=\"$height\">
+                       <BR>$comment</CENTER>"      
+        }
+        ".RTF" -
+        ".DOC" {
+            set apptype "application/msword"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT DATA=\"$url\" TYPE=\"$apptype\"> 
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" TYPE=\"$apptype\"></EMBED>
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }                    
+        ".PPT" -
+        ".PPS" {
+            set apptype "application/vnd.ms-powerpoint"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT classid=\"clsid:98de59a0-d175-11cd-a7bd-00006b827d94\" TYPE=\"$apptype\" width=\"$width\" height=\"$height\" data=\"$url\"> 
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" TYPE=\"$apptype\"></EMBED>
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }                  
+        ".PS" -
+        ".EPS" {
+            set apptype "application/postscript"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT TYPE=\"$apptype\" width=\"$width\" height=\"$height\" data=\"$url\"> 
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" TYPE=\"$apptype\"></EMBED>
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }                           
+        ".XLS" {
+            set apptype "application/vnd.ms-excel"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT TYPE=\"$apptype\" width=\"$width\" height=\"$height\" data=\"$url\"> 
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" TYPE=\"$apptype\"></EMBED>
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }                           
+        ".VRML" {
+            set apptype "model/vrml"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT TYPE=\"$apptype\" width=\"$width\" height=\"$height\" data=\"$url\"> 
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" TYPE=\"$apptype\"></EMBED>
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }         
+        ".YOUTUBE" {
+            set apptype "application/x-shockwave-flash"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT width=\"$width\" height=\"$height\"> 
+                         <PARAM name=\"movie\" value=\"$url\" />
+                         <EMBED src=\"$url\" width=\"$width\" height=\"$height\" type=\"$apptype\"></EMBED>
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }                  
+        ".GOOGLE" {
+            set apptype "application/x-shockwave-flash"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>
+                       <OBJECT width=\"$width\" height=\"$height\"> 
+                         <PARAM name=\"movie\" value=\"$url\" />
+                         <EMBED style=\"width:$width px; height:$height px;\"
+                                id=\"VideoPlayback\" align=\"middle\"
+                                type=\"$apptype\"
+                                allowScriptAccess=\"sameDomain\" 
+                                quality=\"best\" 
+                                bgcolor=\"#ffffff\" 
+                                scale=\"noScale\" 
+                                wmode=\"window\" 
+                                salign=\"TL\"  
+                                FlashVars=\"playerMode=embedded\"                                 
+                                src=\"$url\">
+                       </OBJECT>  
+                       <BR>$comment</CENTER>"
+         }                           
+      default {
+            set apptype "image/jpeg"
+            set xhtml "<CENTER><BR><B><U>$title</U></B><BR><BR>    
+                         <BR>Invalid resource to display<BR>
+                         <IMG src=\"$URL_LOGO\" width=\"$width\" height=\"$height\">
+                       <BR>$comment</CENTER>"      
+        }
+      }
+    } else {
+      #MEDIA NOT ENABLED  
+      set xhtml ""
+    }
+  } else {
+     set xhtml "No media"     
+  }    
+} else {
+  #WE MUST SHOW THE RESSUMEN OF ALL CLASSES HERE
+  set xhtml "RESUMEN"
+}
+
+
+
+
+        
Index: openacs-4/packages/mmplayer/www/summary.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/summary.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/summary.adp	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,8 @@
+
+<if @communities:rowcount@ gt 0>
+  <UL>
+  <multiple name="communities">
+    <LI><a href="@communities.url@"> @communities.mmptitle@</a> (@communities.pretty_name@, @communities.bd@ -> @communities.ed@)
+  </multiple>
+  </UL>
+</if>
Index: openacs-4/packages/mmplayer/www/summary.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/summary.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/summary.tcl	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,4 @@
+
+set user_id [ad_conn user_id]
+db_multirow communities select_communities { *SQL* } 
+
Index: openacs-4/packages/mmplayer/www/summary.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/summary.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/summary.xql	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<queryset>
+    <rdbms><type>postgresql</type><version>7.1</version></rdbms>
+
+    <fullquery name="select_communities">
+        <querytext>
+            select dotlrn_communities_all.*,
+                   dotlrn_community__url(dotlrn_communities_all.community_id) as url,
+                   mmp.title as mmptitle,
+                   mmp.comment as comment,
+                   (select to_date(mmp.begin_date,'YYYY-MM-DD HH24:MI:SS') from dual) as bd,
+                   (select to_date(mmp.end_date,'YYYY-MM-DD HH24:MI:SS') from dual) as ed
+            from dotlrn_communities_all,
+                 dotlrn_member_rels_approved,
+                 mmplayer_items as mmp
+            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'
+                  and mmp.community_id = dotlrn_communities_all.community_id
+                  and mmp.enabled_p = 't'
+                  and mmp.begin_date <= now () 
+                  and mmp.end_date >= now ()
+        </querytext>
+    </fullquery>
+
+</queryset>
Index: openacs-4/packages/mmplayer/www/uvlogo.jpg
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/uvlogo.jpg,v
diff -u
Binary files differ
Index: openacs-4/packages/mmplayer/www/uvlogo2.jpg
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/uvlogo2.jpg,v
diff -u
Binary files differ
Index: openacs-4/packages/mmplayer/www/admin/setup.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/admin/setup.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/admin/setup.adp	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,19 @@
+<master>
+<property name="title">@title@</property>
+<property name="context">@context@</property>
+
+<formtemplate id="select_item"></formtemplate>
+
+<!--
+<HR>
+<B>Supported extensions:</B><BR>
+<TABLE>
+<TR><TD><B>Multimedia</B></TD><TD>SWF</TD></TR>
+<TR><TD><B>Video</B></TD>     <TD>FLV, MOV, RM, WMV, AVI, MPEG, MPG</TD></TR>
+<TR><TD><B>Audio</B></TD>     <TD>MP3, WMA</TD></TR>
+<TR><TD><B>Pictures</B></TD>  <TD>JPG, JPEG, GIF, PNG</TD></TR>
+<TR><TD><B>Text</B></TD>      <TD>HTML, HTM, PDF</TD></TR>
+<TR><TD><B>Other</B></TD>      <TD>file:///c:\mymedia.avi  (IExplorer)</TD></TR>
+</TABLE>
+-->
+
Index: openacs-4/packages/mmplayer/www/admin/setup.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer/www/admin/setup.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer/www/admin/setup.tcl	22 Jun 2006 08:34:42 -0000	1.1
@@ -0,0 +1,58 @@
+ad_page_contract {
+} {
+    {__new_p 0}
+}
+
+set title "#mmplayer-portlet.Manage_MMPlayer#"
+set context [list $title]
+
+set community_id [dotlrn_community::get_community_id]
+set url ""
+set xtitle ""
+set comment ""
+set enabled_p "t"
+set dcommunity_id [db_string do_select "select community_id from mmplayer_items where community_id = :community_id" -default "-1"]
+if {$dcommunity_id == -1} {
+  db_dml do_insert "insert into mmplayer_items (url, title, comment, enabled_p, community_id) 
+                    values (:url, :xtitle, :comment, :enabled_p, :community_id)"
+}
+               
+ad_form -name select_item -form {
+    {url:text,optional {label "#mmplayer.url#"} {html { size 50 maxlength 1000}}}
+    {xtitle:text,optional {label "#mmplayer.title#"} {html { size 50 maxlength 200}}}    
+    {comment:text,optional {label "#mmplayer.comment#"} {html { size 100 maxlength 500}}}
+    {enabled_p:boolean(radio),optional {label "#mmplayer.enabled#"} {options {{Si t} {No f}}} {value "t"}}
+    {width:integer,optional {label "#mmplayer.width#"} {html { size 5 maxlength 5}}}
+    {height:integer,optional {label "#mmplayer.height#"} {html { size 5 maxlength 5}}}    
+    {begin_date:date,to_sql(linear_date),from_sql(sql_date),optional
+       {label "[_ mmplayer.begin_date]"}
+       {format "MONTH DD YYYY HH24 MI SS"}
+       {help}
+       }
+    {end_date:date,to_sql(linear_date),from_sql(sql_date),optional
+       {label "[_ mmplayer.end_date]"}
+       {format "MONTH DD YYYY HH24 MI SS"}
+       {help}
+       }       
+    {submit:text(submit) {label "[_ mmplayer.ok]"}}
+} -on_request {
+    db_1row do_select { select * from mmplayer_items where community_id = :community_id }
+    set begin_date [template::util::date::from_ansi $begin_date "YYYY-MM-DD HH24:MI:SS"]    
+    set end_date [template::util::date::from_ansi $end_date "YYYY-MM-DD HH24:MI:SS"]        
+} -edit_request {
+    db_1row do_select { select * from mmplayer_items where community_id = :community_id }
+    set begin_date [template::util::date::from_ansi $begin_date "YYYY-MM-DD HH24:MI:SS"]    
+    set end_date [template::util::date::from_ansi $end_date "YYYY-MM-DD HH24:MI:SS"]        
+} -new_data {
+} -edit_data {
+    db_dml do_update "update mmplayer_items 
+                      set url= :url, title= :xtitle, comment= :comment, enabled_p= :enabled_p, width= :width, height= :height, 
+                          begin_date= (select to_date(:begin_date,'YYYY-MM-DD HH24:MI:SS') from dual),
+                          end_date= (select to_date(:end_date,'YYYY-MM-DD HH24:MI:SS') from dual)
+                      where community_id = :community_id"
+} -after_submit {
+    ad_returnredirect "../../one-community-admin"
+    ad_script_abort
+}
+
+        
Index: openacs-4/packages/mmplayer-portlet/mmplayer-portlet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/mmplayer-portlet.info,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/mmplayer-portlet.info	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!-- Generated by the OpenACS Package Manager -->
+
+<package key="mmplayer-portlet" url="http://openacs.org/repository/apm/packages/mmplayer-portlet" type="apm_service">
+    <package-name>MMPlayer Portlet</package-name>
+    <pretty-plural>MMPlayer Portlets</pretty-plural>
+    <initial-install-p>f</initial-install-p>
+    <singleton-p>t</singleton-p>
+    
+    <version name="1.0" url="http://openacs.org/repository/download/apm/mmplayer-portlet-1.0.apm">
+        <owner url="http://openacs.org">OpenACS</owner>
+        <release-date>2006-05-15</release-date>
+        <vendor url="http://openacs.org">OpenACS</vendor>
+        <maturity>0</maturity>
+
+        <provides url="mmplayer-portlet" version="1.0"/>
+        <requires url="new-portal" version="0.1a"/>
+        <requires url="mmplayer" version="1.0"/>
+
+        <callbacks>
+        </callbacks>
+        <parameters>
+        </parameters>
+
+    </version>
+</package>
Index: openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.ca_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.ca_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.ca_ES.ISO-8859-1.xml	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="mmplayer-portlet" package_version="1.0" locale="ca_ES" charset="ISO-8859-1">
+
+  <msg key="Add_a_MMPlayer_Item">Add one resource</msg>
+  <msg key="admin_pretty_name">Administraci� de MMPlayer</msg>
+  <msg key="Manage_MMPlayer">Admin MMPlayer</msg>
+  <msg key="pretty_name">MMPlayer </msg>
+</message_catalog>
Index: openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.en_US.ISO-8859-1.xml	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="mmplayer-portlet" package_version="1.0" locale="en_US" charset="ISO-8859-1">
+
+  <msg key="Add_a_MMPlayer_Item">Add one resource</msg>
+  <msg key="admin_pretty_name">MMPlayer Administration</msg>
+  <msg key="Manage_MMPlayer">Admin MMPlayer</msg>
+  <msg key="pretty_name">MMPlayer</msg>
+</message_catalog>
Index: openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.es_ES.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.es_ES.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/catalog/mmplayer-portlet.es_ES.ISO-8859-1.xml	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="mmplayer-portlet" package_version="1.0" locale="es_ES" charset="ISO-8859-1">
+
+  <msg key="Add_a_MMPlayer_Item">Agregar un recurso</msg>
+  <msg key="admin_pretty_name">Administraci�n de MMPlayer</msg>
+  <msg key="Manage_MMPlayer">Administrar MMPlayer</msg>
+  <msg key="pretty_name">MMPlayer</msg>
+</message_catalog>
Index: openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-admin-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-admin-portlet-create.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-admin-portlet-create.sql	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,158 @@
+
+create function inline_0()
+returns integer as '
+declare
+  ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+  ds_id  = portal_datasource__new( ''mmplayer_admin_portlet'', ''MMPlayer Admin portlet'');
+
+
+  --  the standard 4 params
+
+  -- shadeable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''shadeable_p'',
+        ''f''
+);      
+
+
+  -- hideable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''hideable_p'',
+        ''f''
+);      
+
+  -- user_editable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''user_editable_p'',
+        ''f''
+);      
+
+  -- shaded_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''shaded_p'',
+        ''f''
+);      
+
+  -- link_hideable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''link_hideable_p'',
+        ''t''
+);  
+
+-- mmplayer_admin-specific params
+
+  -- package_id must be configured
+  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 function inline_1()
+returns integer as '
+begin
+
+        -- create the implementation
+        perform acs_sc_impl__new (
+                ''portal_datasource'',
+                ''mmplayer_admin_portlet'',
+                ''mmplayer_admin_portlet''
+        );
+
+        -- add all the hooks
+        perform acs_sc_impl_alias__new(
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''GetMyName'',
+               ''mmplayer_admin_portlet::get_my_name'',
+               ''TCL''
+        );
+
+        perform acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''GetPrettyName'',
+               ''mmplayer_admin_portlet::get_pretty_name'',
+               ''TCL''
+        );
+
+        perform acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''Link'',
+               ''mmplayer_admin_portlet::link'',
+               ''TCL''
+        );
+
+        perform acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''AddSelfToPage'',
+               ''mmplayer_admin_portlet::add_self_to_page'',
+               ''TCL''
+        );
+
+        perform acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''Show'',
+               ''mmplayer_admin_portlet::show'',
+               ''TCL''
+        );
+
+        perform acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''Edit'',
+               ''mmplayer_admin_portlet::edit'',
+               ''TCL''
+        );
+
+        perform acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_admin_portlet'',
+               ''RemoveSelfFromPage'',
+               ''mmplayer_admin_portlet::remove_self_from_page'',
+               ''TCL''
+        );
+
+        -- Add the binding
+        perform acs_sc_binding__new (
+            ''portal_datasource'',
+            ''mmplayer_admin_portlet''
+        );
+
+        return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+
Index: openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-admin-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-admin-portlet-drop.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-admin-portlet-drop.sql	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,83 @@
+
+create function inline_0 ()
+returns integer as '
+declare  
+  ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+  select datasource_id into ds_id
+    from portal_datasources
+    where name = ''mmplayer_admin_portlet'';
+
+    if not found then
+        raise exception ''No datasource_id found here '',ds_id ;
+        ds_id := null;        
+    end if;
+
+      
+  if ds_id is NOT null then
+    perform portal_datasource__delete(ds_id);
+  end if;
+
+return 0;
+
+end;' language 'plpgsql';
+
+select inline_0 ();
+
+drop function inline_0 ();
+
+-- create the implementation
+select acs_sc_impl__delete (
+                'portal_datasource',
+                'mmplayer_admin_portlet'
+);
+
+-- delete all the hooks
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'GetMyName'
+);
+
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'GetPrettyName'
+);
+
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'Link'
+);
+
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'AddSelfToPage'
+);
+
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'Show'
+);
+
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'Edit'
+);
+
+select acs_sc_impl_alias__delete (
+               'portal_datasource',
+               'mmplayer_admin_portlet',
+               'RemoveSelfFromPage'
+);
+
+-- Add the binding
+select acs_sc_binding__delete (
+                'portal_datasource',
+                'mmplayer_admin_portlet'
+);
Index: openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-portlet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-portlet-create.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-portlet-create.sql	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,163 @@
+
+create function inline_0()
+returns integer as '
+declare
+  ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+  ds_id = portal_datasource__new(
+    ''mmplayer_portlet'',                                               -- Name
+    ''MMPlayer portlet''                                                -- description     
+  );
+
+  --  the standard 4 params
+
+  -- shadeable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,                                          -- datasource_id
+        ''t'',                                          -- config_required_p
+        ''t'',                                          -- configured_p 
+        ''shadeable_p'',                        -- key 
+        ''t''                                           -- value
+);      
+
+
+  -- hideable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''hideable_p'',
+        ''t''
+);      
+
+  -- user_editable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''user_editable_p'',
+        ''f''
+);      
+
+  -- shaded_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''shaded_p'',
+        ''f''
+);      
+
+  -- link_hideable_p 
+  perform portal_datasource__set_def_param (
+        ds_id,
+        ''t'',
+        ''t'',
+        ''link_hideable_p'',
+        ''t''
+);  
+
+-- mmplayer-specific params
+
+  -- community_id must be configured
+  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 function inline_1()
+returns integer as '
+begin
+
+        -- create the implementation
+        perform acs_sc_impl__new (
+                ''portal_datasource'',
+                ''mmplayer_portlet'',
+                ''mmplayer_portlet''
+        );
+
+        -- add all the hooks
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''GetMyName'',
+               ''mmplayer_portlet::get_my_name'',
+               ''TCL''
+        );
+
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''GetPrettyName'',
+               ''mmplayer_portlet::get_pretty_name'',
+               ''TCL''
+        );
+
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''Link'',
+               ''mmplayer_portlet::link'',
+               ''TCL''
+        );
+
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''AddSelfToPage'',
+               ''mmplayer_portlet::add_self_to_page'',
+               ''TCL''
+        );
+
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''Show'',
+               ''mmplayer_portlet::show'',
+               ''TCL''
+        );
+
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''Edit'',
+               ''mmplayer_portlet::edit'',
+               ''TCL''
+        );
+
+        perform  acs_sc_impl_alias__new (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''RemoveSelfFromPage'',
+               ''mmplayer_portlet::remove_self_from_page'',
+               ''TCL''
+        );
+
+        -- Add the binding
+        perform acs_sc_binding__new (
+            ''portal_datasource'',
+            ''mmplayer_portlet''
+        );
+
+        return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+
+drop function inline_1();
+
+
+\i mmplayer-admin-portlet-create.sql
Index: openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-portlet-drop.sql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/sql/postgresql/mmplayer-portlet-drop.sql	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,87 @@
+
+create function inline_1()
+returns integer as '
+declare  
+  ds_id portal_datasources.datasource_id%TYPE;
+begin
+
+  select datasource_id into ds_id
+      from portal_datasources
+     where name = ''mmplayer_portlet'';
+
+   if not found then
+     RAISE EXCEPTION '' No datasource id found '', ds_id;
+     ds_id := null;
+   end if;
+
+  if ds_id is NOT null then
+    perform portal_datasource__delete(ds_id);
+  end if;
+
+        -- drop the hooks
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''GetMyName''
+        );
+
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''GetPrettyName''
+        );
+
+
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''Link''
+        );
+
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''AddSelfToPage''
+        );
+
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''Show''
+        );
+
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''Edit''
+        );
+
+        perform acs_sc_impl_alias__delete (
+               ''portal_datasource'',
+               ''mmplayer_portlet'',
+               ''RemoveSelfFromPage''
+        );
+
+        -- Drop the binding
+        perform acs_sc_binding__delete (
+            ''portal_datasource'',
+            ''mmplayer_portlet''
+        );
+
+        -- drop the impl
+        perform acs_sc_impl__delete (
+                ''portal_datasource'',
+                ''mmplayer_portlet''
+        );
+        
+        return 0;
+end;' language 'plpgsql';
+
+select inline_1();
+drop function inline_1();
+
+\i mmplayer-admin-portlet-drop.sql
+
+
+
+
Index: openacs-4/packages/mmplayer-portlet/tcl/mmplayer-admin-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/tcl/mmplayer-admin-portlet-procs.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/tcl/mmplayer-admin-portlet-procs.tcl	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,71 @@
+
+ad_library {
+
+    Procedures to support the mmplayer admin portlet
+
+}
+
+namespace eval mmplayer_admin_portlet {
+
+    ad_proc -private get_my_name {
+    } {
+        return "mmplayer_admin_portlet"
+    }
+
+    ad_proc -public get_pretty_name {
+    } {
+        return "#mmplayer-portlet.admin_pretty_name#"
+    }
+
+    ad_proc -private my_package_key {
+    } {
+        return "mmplayer-portlet"
+    }
+
+    ad_proc -public link {
+    } {
+        return ""
+    }
+
+    ad_proc -public add_self_to_page {
+        {-portal_id:required}
+        {-page_name ""}
+        {-package_id:required}
+    } {
+        Adds a mmplayer admin PE to the given portal
+
+        @param portal_id The page to add self to
+        @param package_id The package_id of the mmplayer 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:required}
+    } {
+          Removes a mmplayer admin PE from the given page
+    } {
+        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 "mmplayer-admin-portlet"
+
+    }
+
+}
Index: openacs-4/packages/mmplayer-portlet/tcl/mmplayer-portlet-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/tcl/mmplayer-portlet-procs.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/tcl/mmplayer-portlet-procs.tcl	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,88 @@
+
+ad_library {
+
+    Procedures to support the mmplayer portlet
+
+}
+
+namespace eval mmplayer_portlet {
+
+    ad_proc -private get_my_name {
+    } {
+        return "mmplayer_portlet"
+    }
+
+    ad_proc -private my_package_key {
+    } {
+        return "mmplayer-portlet"
+    }
+
+    ad_proc -public get_pretty_name {
+    } {
+        return "#mmplayer-portlet.pretty_name#"
+    }
+
+    ad_proc -public get_summary_length {
+    } {
+        return [parameter::get_from_package_key \
+                    -package_key [my_package_key] \
+                    -parameter mmplayer_portlet_summary_length
+        ]
+    }
+
+    ad_proc -public link {
+    } {
+        return ""
+    }
+
+    ad_proc -public add_self_to_page {
+        {-portal_id:required}
+        {-package_id:required}
+        {-param_action:required}
+    } {
+        Adds a mmplayer PE to the given portal.
+
+        @param portal_id The page to add self to
+        @param package_id The community with the folder
+
+        @return element_id The new element's id
+    } {
+        return [portal::add_element_parameters \
+            -portal_id $portal_id \
+            -portlet_name [get_my_name] \
+            -value $package_id \
+            -force_region [parameter::get_from_package_key \
+                               -parameter "mmplayer_portlet_force_region" \
+                               -package_key [my_package_key]] \
+            -pretty_name [get_pretty_name] \
+            -param_action $param_action
+        ]
+    }
+
+    ad_proc -public remove_self_from_page {
+        {-portal_id:required}
+        {-package_id:required}
+    } {
+        Removes a mmplayer PE from the given page or the package_id of the
+        mmplayer package from the portlet if there are others remaining
+
+        @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] \
+            -value $package_id
+    }
+
+    ad_proc -public show {
+         cf
+    } {
+    } {
+        portal::show_proc_helper \
+            -package_key [my_package_key] \
+            -config_list $cf \
+            -template_src "mmplayer-portlet"
+    }
+
+}
Index: openacs-4/packages/mmplayer-portlet/www/mmplayer-admin-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/www/mmplayer-admin-portlet.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/www/mmplayer-admin-portlet.adp	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,24 @@
+<%
+
+    #
+    #  Copyright (C) 2001, 2002 MIT
+    #
+    #  This file is part of dotLRN.
+    #
+    #  dotLRN is free software; you can redistribute it and/or modify it under the
+    #  terms of the GNU General Public License as published by the Free Software
+    #  Foundation; either version 2 of the License, or (at your option) any later
+    #  version.
+    #
+    #  dotLRN 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.
+    #
+
+%>
+
+<ul>
+  <li><a href="@url@admin/setup">#mmplayer-portlet.Manage_MMPlayer#</a>
+</ul>
+
Index: openacs-4/packages/mmplayer-portlet/www/mmplayer-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/www/mmplayer-admin-portlet.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/www/mmplayer-admin-portlet.tcl	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,41 @@
+#
+#  Copyright (C) 2001, 2002 MIT
+#
+#  This file is part of dotLRN.
+#
+#  dotLRN is free software; you can redistribute it and/or modify it under the
+#  terms of the GNU General Public License as published by the Free Software
+#  Foundation; either version 2 of the License, or (at your option) any later
+#  version.
+#
+#  dotLRN 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.
+#
+
+# www/mmplayer-portlet.tcl
+ad_page_contract {
+    The display logic for the mmplayer portlet
+
+    @author Arjun Sanyal (arjun@openforce.net)
+    @author Ben Adida (ben@openforce)
+    @cvs_id $Id: mmplayer-admin-portlet.tcl,v 1.1 2006/06/22 08:35:31 darior Exp $
+} -properties {
+    
+}
+
+array set config $cf
+set user_id [ad_conn user_id]
+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 mmplayer 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]
+
+ad_return_template 
Index: openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet-postgresql.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet-postgresql.xql	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+
+<queryset>
+<rdbms><type>postgresql</type><version>7.1</version></rdbms>
+
+</queryset>
Index: openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet.adp	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,9 @@
+
+<if @inside_comm_p@>
+  <include src="/packages/mmplayer/www/add_resource">
+</if>
+<else>
+   <include src="/packages/mmplayer/www/summary">
+</else>
+
+
Index: openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/mmplayer-portlet/www/mmplayer-portlet.tcl	22 Jun 2006 08:35:31 -0000	1.1
@@ -0,0 +1,24 @@
+ad_page_contract {
+} {
+} -properties {
+}
+
+array set config $cf
+set shaded_p $config(shaded_p)
+
+set list_of_package_ids $config(package_id)
+set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0]
+
+set mmplayer_url [ad_conn package_url]
+set comm_id [dotlrn_community::get_community_id_from_url -url $mmplayer_url]
+
+if {[exists_and_not_null comm_id]} {
+    set root_id [ad_conn node_id]
+    set user_id [ad_conn user_id]
+    set inside_comm_p 1
+} else {
+    set inside_comm_p 0
+}
+
+ad_return_template
+