Index: openacs-4/packages/dotlrn-bootstrap3-theme/dotlrn-bootstrap3-theme.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/dotlrn-bootstrap3-theme.info,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/dotlrn-bootstrap3-theme.info	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!-- Generated by the OpenACS Package Manager -->
+
+<package key="dotlrn-bootstrap3-theme" url="http://openacs.org/repository/apm/packages/dotlrn-bootstrap3-theme" type="apm_service">
+    <package-name>dotLRN Bootstrap 3 Theme</package-name>
+    <pretty-plural>dotLRN Bootstrap 3 Themes</pretty-plural>
+    <initial-install-p>f</initial-install-p>
+    <singleton-p>t</singleton-p>
+
+    <version name="2.9.0" url="http://openacs.org/repository/download/apm/dotlrn-bootstrap3-theme-2.9.0.apm">
+       <owner url="mailto:manderga@wu.ac.at">manderga</owner>
+        <release-date>2016-07-15</release-date>
+        <vendor url="http://wu.ac.at">WU Vienna</vendor>
+        <summary>Provides a Theme for DotLRN based on Twitter Bootstrap</summary>
+        <maturity>0</maturity>
+
+        <provides url="dotlrn-bootstrap3-theme" version="2.9.0"/>
+        <requires url="dotlrn" version="2.9.0"/>
+        <requires url="openacs-bootstrap3-theme" version="5.9.0"/>
+
+        <callbacks>
+            <callback type="after-install"    proc="dotlrn_bootstrap3_theme::apm::after_install"/>
+            <callback type="before-uninstantiate" proc="dotlrn_bootstrap3_theme::apm::before_uninstantiate"/>
+            <callback type="before-uninstall" proc="dotlrn_bootstrap3_theme::apm::before_uninstall"/>
+        </callbacks>
+        <parameters>
+            <parameter datatype="string"  min_n_values="1"  max_n_values="1" name="AdditionalNavbarTabs"  default="/dotlrn/ #dotlrn.Home# #dotlrn.Home_Accesskey# /dotlrn/courses #dotlrn.Courses# #dotlrn.Courses_Accesskey# /dotlrn/communities #dotlrn.Communities# #dotlrn.Communities_Accesskey# /dotlrn/control-panel #dotlrn.control_panel# #dotlrn.control_panel_accesskey#" description="list of URL Names pairs which will make it into additional navbar tabs"/>
+            
+            <parameter datatype="string"  min_n_values="1"  max_n_values="1" name="ZenToBootstrapMap"  default="#new-portal.simple_1column_layout_name# #dotlrn-bootstrap3-theme.bootstrap-1column# #new-portal.simple_2column_layout_name# #dotlrn-bootstrap3-theme.bootstrap-2column#  #new-portal.simple_3column_layout_name# #dotlrn-bootstrap3-theme.bootstrap-3column# #theme-zen.Zen_1_column# #dotlrn-bootstrap3-theme.bootstrap-1column#  #theme-zen.Zen_2_column# #dotlrn-bootstrap3-theme.bootstrap-2column# #theme-zen.Zen_3_column# #dotlrn-bootstrap3-theme.bootstrap-3column#  #theme-zen.Zen_thin_thick# #dotlrn-bootstrap3-theme.bootstrap-2column# #theme-zen.Zen_thin_thick_thin# #dotlrn-bootstrap3-theme.bootstrap-3column#"  description="list of old layout/new layout names used to update an existing .LRN site"/>
+            
+            <parameter datatype="string"  min_n_values="1"  max_n_values="1" name="BootstrapToZenMap"  default="#dotlrn-bootstrap3-theme.bootstrap-1column# #theme-zen.Zen_1_column# #dotlrn-bootstrap3-theme.bootstrap-2column# #theme-zen.Zen_2_column# #dotlrn-bootstrap3-theme.bootstrap-3column# #theme-zen.Zen_3_column#" description="list of old layout/new layout names used to update an existing .LRN site"/>
+            
+            <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="GenericCommunityTab"  default="0" description="Use a generic name for the community tab"/>
+        </parameters>
+
+    </version>
+</package>
+
Index: openacs-4/packages/dotlrn-bootstrap3-theme/install.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/install.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/install.xml	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+
+<application name="dotlrn-bootstrap3-theme" pretty-name="dotLRN Bootstrap 3 Theme" home="http://openacs.org/repository/download/apm/dotlrn-bootstrap3-theme-2.9.0.apm" min_stack_size="512">
+
+  <actions>
+
+    <set-parameter package-key="dotlrn" name="class_instance_pages_csv" value="#dotlrn.class_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.class_page_home_accesskey#;#dotlrn.class_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.class_page_calendar_accesskey#;#dotlrn.class_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.class_page_file_storage_accesskey#"/>
+
+    <set-parameter package-key="dotlrn" name="club_pages_csv" value="#dotlrn.club_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.club_page_home_accesskey#;#dotlrn.club_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.club_page_calendar_accesskey#;#dotlrn.club_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.club_page_file_storage_accesskey#;#dotlrn.club_page_people_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.club_page_people_accesskey#"/>
+
+    <set-parameter package-key="dotlrn" name="subcomm_pages_csv" value="#dotlrn.subcomm_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.subcomm_page_home_accesskey#;#dotlrn.subcomm_page_info_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.subcomm_page_info_accesskey#;#dotlrn.subcomm_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.subcomm_page_calendar_accesskey#;#dotlrn.subcomm_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column##,#dotlrn.subcomm_page_file_storage_accesskey#"/>
+
+    <set-parameter package-key="dotlrn" name="user_portal_pages_csv" value="#dotlrn.user_portal_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.user_portal_page_home_accesskey#;#dotlrn.user_portal_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.user_portal_page_calendar_accesskey#;#dotlrn.user_portal_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.user_portal_page_file_storage_accesskey#"/>
+
+    <set-parameter package-key="dotlrn" name="admin_layout_name" value="#dotlrn-bootstrap3-theme.bootstrap-2column#"/>
+    <set-parameter package-key="dotlrn" name="non_member_layout_name" value="#dotlrn-bootstrap3-theme.bootstrap-2column#"/>
+    <set-parameter package-key="dotlrn" name="DefaultMaster_p" value="/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master"/>
+
+    <set-parameter package-key="dotlrn" name="DefaultSiteTemplate" value="#dotlrn-bootstrap3-theme.bootstrap3-theme#"/>
+    <set-parameter-default package-key="dotlrn" name="DefaultSiteTemplate" value="#dotlrn-bootstrap3-theme.bootstrap3-theme#"/>
+
+    <set-parameter package-key="new-portal" name="default_theme_name" value="#dotlrn-bootstrap3-theme.bootstrap3-theme#"/>
+    <set-parameter package-key="new-portal" name="default_layout" value="#dotlrn-bootstrap3-theme.bootstrap-2column#"/>
+
+  </actions>
+
+</application>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/catalog/dotlrn-bootstrap3-theme.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/catalog/dotlrn-bootstrap3-theme.en_US.ISO-8859-1.xml,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/catalog/dotlrn-bootstrap3-theme.en_US.ISO-8859-1.xml	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<message_catalog package_key="dotlrn-bootstrap3-theme" locale="en_US" charset="ISO-8859-1">
+
+<msg key="bootstrap3-theme">.LRN Bootstrap3 Theme</msg>
+<msg key="bootstrap-1column">1-Column-Layout based on Bootstrap</msg>
+<msg key="bootstrap-2column">2-Column-Layout based on Bootstrap</msg>
+<msg key="bootstrap-3column">3-Column-Layout based on Bootstrap</msg>
+<msg key="maximize_portlet">Maximize portlet</msg>
+<msg key="minimize_portlet">Minimize portlet</msg>
+<msg key="begin_dotlrn_navigation">Begin .LRN Navigation</msg>
+<msg key="begin_dotlrn_sub_navigation">Begin .LRN sub navigation</msg>
+
+</message_catalog>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column.adp	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,22 @@
+<div class="row">
+	
+    <div class="col-xs-12">
+      <list name="element_ids_1">
+        <include src="@element_src;literal@" 
+          element_id="@element_ids_1:item;literal@" 
+          element_num="@element_ids_1:rownum;literal@"
+          element_first_num="0"
+          action_string="@action_string;literal@" 
+          theme_id="@theme_id;literal@" 
+          region="1" 
+          portal_id="@portal_id;literal@" 
+          edit_p="@edit_p;literal@"
+          return_url="@return_url;literal@" 
+          hide_links_p="@hide_links_p;literal@"
+          page_id="@page_id;literal@" 
+          layout_id="@layout_id;literal@">
+      </list>
+    </div> 
+</div> 
+      
+
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,53 @@
+#
+#  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.
+#
+
+ad_page_contract {
+
+    @cvs_id $Id: bootstrap-1column.tcl,v 1.1 2017/02/20 09:49:14 gustafn Exp $
+
+} -properties {
+    element_list:onevalue
+    element_src:onevalue
+    action_string:onevalue
+    theme_id:onevalue
+    return_url:onevalue
+}
+
+if { ![info exists action_string] } {
+    set action_string ""
+}
+
+if { ![info exists theme_id] } {
+    set theme_id ""
+}
+
+if { ![info exists return_url] } {
+    set return_url ""
+}
+
+if { [info exists resource_dir] && $resource_dir ne "" } {
+    portal::set_page_css $resource_dir
+}
+
+portal::layout_elements $element_list
+
+ad_return_template
+
+# Local variables:
+#    mode: tcl
+#    tcl-indent-level: 4
+#    indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column.adp	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,40 @@
+<div class="row">
+
+    <div class="col-sm-6">
+        <list name="element_ids_1">
+            <include src="@element_src;literal@"
+                element_id="@element_ids_1:item;literal@"
+                element_num="@element_ids_1:rownum;literal@"
+                element_first_num="0"
+                action_string="@action_string;literal@"
+                theme_id="@theme_id;literal@"
+                region="2"
+                portal_id="@portal_id;literal@"
+                edit_p="@edit_p;literal@"
+                return_url="@return_url;literal@"
+                hide_links_p="@hide_links_p;literal@"
+                page_id="@page_id;literal@"
+                layout_id="@layout_id;literal@">
+        </list>
+    </div>
+    
+    <div class="col-sm-6">
+        <list name="element_ids_2">
+            <include src="@element_src;literal@"
+                element_id="@element_ids_2:item;literal@"
+                element_num="@element_ids_2:rownum;literal@"
+                element_first_num="@element_2_first_num;literal@"
+                action_string="@action_string;literal@"
+                theme_id="@theme_id;literal@"
+                region="1"
+                portal_id="@portal_id;literal@"
+                edit_p="@edit_p;literal@"
+                return_url="@return_url;literal@"
+                hide_links_p="@hide_links_p;literal@"
+                page_id="@page_id;literal@"
+                layout_id="@layout_id;literal@">
+        </list>
+    </div>
+  
+</div> <!-- /row -->
+
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,59 @@
+#
+#  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.
+#
+
+# new-portal/www/layouts/simple2.tcl
+
+ad_page_contract {
+    This is a simple 2 column layout called from portal::render and the like. 
+    It laysout the elements with portal::layout_elements and hands off rendering
+    of the individual portlets to the template in the "element_src" var
+
+    @version $Id: bootstrap-2column.tcl,v 1.1 2017/02/20 09:49:14 gustafn Exp $
+} -properties {
+    element_list:onevalue
+    element_src:onevalue
+    action_string:onevalue
+    theme_id:onevalue
+    return_url:onevalue
+}
+
+if {![info exists action_string]} {
+    set action_string ""
+}
+
+if {![info exists theme_id]} {
+    set theme_id ""
+}
+
+if {![info exists return_url]} {
+    set return_url ""
+}
+
+if {[info exists resource_dir] && $resource_dir ne ""} {
+    portal::set_page_css $resource_dir
+}
+
+portal::layout_elements $element_list
+
+set element_2_first_num [llength $element_ids_1] 
+
+ad_return_template
+
+# Local variables:
+#    mode: tcl
+#    tcl-indent-level: 4
+#    indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column.adp	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,57 @@
+<div class="row">
+
+    <div class="col-md-4">
+        <list name="element_ids_1">
+          <include src="@element_src;literal@"
+            element_id="@element_ids_1:item;literal@"
+            element_num="@element_ids_1:rownum;literal@"
+            element_first_num="0"
+            action_string="@action_string;literal@"
+            theme_id="@theme_id;literal@"
+            region="1"
+            portal_id="@portal_id;literal@"
+            edit_p="@edit_p;literal@"
+            return_url="@return_url;literal@"
+            hide_links_p="@hide_links_p;literal@"
+            page_id="@page_id;literal@"
+            layout_id="@layout_id;literal@">
+        </list>
+    </div> 
+    
+    <div class="col-md-4">
+        <list name="element_ids_2">
+        <include src="@element_src;literal@"
+          element_id="@element_ids_2:item;literal@"
+          element_num="@element_ids_2:rownum;literal@"
+          element_first_num="@element_2_first_num;literal@"
+          action_string="@action_string;literal@"
+          theme_id="@theme_id;literal@"
+          region="2"
+          portal_id="@portal_id;literal@"
+          edit_p="@edit_p;literal@"
+          return_url="@return_url;literal@"
+          hide_links_p="@hide_links_p;literal@"
+          page_id="@page_id;literal@"
+          layout_id="@layout_id;literal@">
+        </list>
+    </div> 
+      
+    <div class="col-md-4">
+        <list name="element_ids_3">
+          <include src="@element_src;literal@"
+            element_id="@element_ids_3:item;literal@"
+            element_num="@element_ids_3:rownum;literal@"
+            element_first_num="@element_3_first_num;literal@"
+            action_string="@action_string;literal@"
+            theme_id="@theme_id;literal@"
+            region="3"
+            portal_id="@portal_id;literal@"
+            edit_p="@edit_p;literal@"
+            return_url="@return_url;literal@"
+            hide_links_p="@hide_links_p;literal@"
+            page_id="@page_id;literal@"
+            layout_id="@layout_id;literal@">
+        </list>
+    </div> 
+    
+</div> 
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,61 @@
+#
+#  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.
+#
+
+ad_page_contract {
+    This is a simple 3 column layout called from portal::render and the like. 
+    It lays out the elements with portal::layout_elements and hands off
+    rendering of the individual portlets to the template in the
+    "element_src" var
+
+    @author arjun@openforce.net
+    @author yon@openforce.net
+    @version $Id: bootstrap-3column.tcl,v 1.1 2017/02/20 09:49:14 gustafn Exp $
+} -properties {
+    element_list:onevalue
+    element_src:onevalue
+    action_string:onevalue
+    theme_id:onevalue
+    return_url:onevalue
+}
+
+if {![info exists action_string]} {
+    set action_string ""
+}
+
+if {![info exists theme_id]} {
+    set theme_id ""
+}
+
+if {![info exists return_url]} {
+    set return_url ""
+}
+
+if { [info exists resource_dir] && $resource_dir ne "" } {
+    portal::set_page_css $resource_dir
+}
+
+portal::layout_elements $element_list
+
+set element_2_first_num [llength $element_ids_1] 
+set element_3_first_num [llength $element_ids_2] 
+
+ad_return_template
+
+# Local variables:
+#    mode: tcl
+#    tcl-indent-level: 4
+#    indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme.adp	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,19 @@
+<div class="panel panel-default portlet">
+    <div class="panel-heading">
+    
+        <if @shadeable_p@ eq "t">     
+            <a href="@configure_element_url@">
+              <if @shaded_p@ eq "t">
+                <span style="float:right;color:#666;"><i class="glyphicon glyphicon-plus"></i> #dotlrn-bootstrap3-theme.maximize_portlet#</span>
+              </if>
+              <else>
+                <span style="float:right;color:#666;"><i class="glyphicon glyphicon-minus"></i> #dotlrn-bootstrap3-theme.minimize_portlet#</span>
+              </else>
+            </a>
+        </if>
+        <h3 class="panel-title">@name;noquote@</h3>
+    </div>
+    <div class="panel-body">
+        <slave>
+    </div>
+</div>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,7 @@
+set configure_element_url [export_vars -base configure-element {{op shade} element_id}]
+
+# Local variables:
+#    mode: tcl
+#    tcl-indent-level: 4
+#    indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master.adp	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,66 @@
+<master src="/www/blank-master">
+<if @doc@ defined><property name="&doc">doc</property></if>
+<if @body@ defined><property name="&body">body</property></if>
+<if @head@ not nil><property name="head">@head;noquote@</property></if>
+<if @focus@ not nil><property name="focus">@focus;noquote@</property></if>
+
+<if @signatory@ defined>
+    <property name="signatory">@signatory;noquote@</property>
+</if>
+<if @focus@ defined>
+    <property name="focus">@focus;literal@</property>
+</if>
+
+<div class="container-fluid">
+    <!-- START HEADER -->
+    <div class="row header">     
+        <widget src="header-bar" ds="0" subsite_logo="@subsite_logo;noquote@">
+        <widget src="search" ds="0">
+        <if @context_bar@ defined and @context_bar@ ne ""> <div class="col-xs-12 context"> @context_bar;noquote@ </div> </if>
+    </div>
+    <!-- END HEADER -->
+    
+    <div class="dotlrn-navigation">
+        <div class="block-marker">#dotlrn-bootstrap3-theme.begin_dotlrn_navigation#</div>
+        <if @dotlrn_navbar@ not nil>@dotlrn_navbar;noquote@</if> 
+        
+        <if @dotlrn_subnavbar@ not nil>
+            <div class="dotlrn-sub-navigation">
+                <div class="block-marker">#dotlrn-bootstrap3-theme.begin_dotlrn_sub_navigation#</div>
+                @dotlrn_subnavbar;noquote@
+            </div>
+        </if>
+    </div>
+  
+    <if @user_messages:rowcount@ gt 0>
+        <div id="alert-message">
+            <multiple name="user_messages">
+                <div class="alert">
+                    <strong>@user_messages.message;noquote@</strong>
+                </div>
+            </multiple>
+        </div>
+    </if>
+    
+    <div class="block-marker">Begin main content</div>
+    <div class="main-content" style="margin-bottom:100px;">
+        <slave>
+    </div>
+
+    <!-- START FOOTER -->
+    <div class="navbar navbar-default navbar-fixed-bottom" style="border-color:#ccc;">
+        <div class="footer" style='margin-top:0;font-size:90%;color:#666;padding-top:5px;'>
+            <p style="margin:0;">
+              This website is maintained by the OpenACS Community. Any problems, email <a href="mailto:@signatory@">webmaster</a> or <a href="/bugtracker/openacs.org/">Submit</a> a bug report.
+<br>
+              (Powered by Tcl<a href="http://www.tcl.tk/"><img alt="Tcl Logo" src="/resources/openacs-bootstrap3-theme/images/plume.png" width="14" height="18"></a>, 
+                Next Scripting <a href="https://next-scripting.org/"><img alt="NSF Logo" src="/resources/openacs-bootstrap3-theme/images/next-icon.png" width="14" height="8"></a>, 
+                NaviServer <%= [ns_info patchlevel] %> <a href="http://sourceforge.net/projects/naviserver/"><img src="/resources/openacs-bootstrap3-theme/images/ns-icon-16.png" alt="NaviServer Logo" width="12" height="12"></a>,
+                <a href='http://ipv6-test.com/validate.php?url=referer'><img src='http://ipv6-test.com/button-ipv6-80x15.png' alt='ipv6 ready' title='ipv6 ready' border='0' /></a>,
+                <%= [expr {[string match *.* [ns_conn peeraddr]] ? "IPv4" : "IPv6"}] %>
+            </p>
+        </div>
+    </div>
+    <!-- END FOOTER -->
+
+</div>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,142 @@
+ad_page_contract {
+
+    OpenACS.org  plain master, bootstrap3 flavor
+
+    @author modified by Patrick Colgan pat pat@museatech.net
+    @author modified by Ola Hansson ola@polyxena.net
+    @author modified by Monika Andergassen manderga@wu.ac.at
+    @creation-date 9/6/2001
+
+
+} {
+    { email "" }
+} -properties {
+    form_vars:onevalue
+    allow_persistent_login_p:onevalue
+    remember_password:onevalue
+    name:onevalue
+    first_names:onevalue
+    email:onevalue
+    home_url:onevalue
+    home_url_name:onevalue
+    oacs_admin_p:onevalue
+    pkid:onevalue
+}
+
+set pkid [ad_conn package_id]
+
+if {![info exists title]}     { set title     [ad_system_name]   }
+if {![info exists signatory]} { set signatory [ad_system_owner] }
+
+if {![info exists subsite_link]} {
+    set subsite_link "/"
+}
+
+set subsite_logo "/resources/openacs-bootstrap3-theme/images/logo_dotlrn_xs.png"
+
+
+###########################
+# dotLRN stuff            #
+###########################
+
+# $Id: dotlrn-master.tcl,v 1.1 2017/02/20 09:49:14 gustafn Exp $
+
+set user_id [ad_conn user_id] 
+set untrusted_user_id [ad_conn untrusted_user_id]
+set community_id [dotlrn_community::get_community_id]
+set dotlrn_url [dotlrn::get_url]
+
+set sitemap_url "$dotlrn_url/site-map"
+
+if {[dotlrn::user_p -user_id $user_id]} {
+    set portal_id [dotlrn::get_portal_id -user_id $user_id]
+}
+
+if {![info exists link_all]} {
+    set link_all 0
+}
+
+if {![info exists return_url]} {
+    set link [ad_conn -get extra_url]
+} else {
+    set link $return_url
+}
+
+if { [ad_conn package_key] ne [dotlrn::package_key] } {
+    # Peter M: We are in a package (an application) that may or may not be under a dotlrn instance 
+    # (i.e. in a news instance of a class)
+    # and we want all links in the navbar to be active so the user can return easily to the class homepage
+    # or to the My Space page
+    set link_all 1
+}
+
+set control_panel_text [_ acs-subsite.Admin]
+
+# Set dotlrn navbar
+if { !([info exists no_navbar_p] && $no_navbar_p ne "" && $no_navbar_p) && [info exists portal_id] && $portal_id ne "" } {
+    if { $community_id ne "" } {
+        set youarehere "[dotlrn_community::get_community_name $community_id]"
+    } else {
+        set youarehere "[_ theme-zen.MySpace]"
+    }
+
+    set extra_spaces "<img src=\"/resources/dotlrn/spacer.gif\" alt=\"\" border='0' width='15'>"    
+    set dotlrn_navbar [zen::portal_navbar]
+    set dotlrn_subnavbar [zen::portal_subnavbar \
+        -user_id $user_id \
+        -control_panel_text $control_panel_text \
+        -pre_html "$extra_spaces" \
+        -post_html $extra_spaces \
+        -link_all $link_all
+    ]
+} else {
+    set dotlrn_navbar ""
+    set dotlrn_subnavbar ""
+}
+
+
+
+###########################
+# END dotLRN stuff        #
+###########################
+
+template::head::add_meta \
+    -name "viewport" \
+    -content "width=device-width, initial-scale=1"
+template::head::add_meta \
+    -content "text/css" \
+    -http_equiv "content-style-type"
+
+if {[info exists context]}      { set context_bar [ad_context_bar {*}$context]}
+if {![info exists context_bar]} { set context_bar [ad_context_bar] }
+
+# clean out title and context bar for index page.
+if {[ad_conn url] eq "/" || [string match /index* [ad_conn url]] || [ad_conn url] eq "/community/"} { 
+    set context_bar {} 
+    set notitle 1
+}
+
+# stuff that is in the stock default-master
+
+template::multirow create attribute key value
+
+# Pull out the package_id of the subsite closest to our current node
+set pkg_id [site_node::closest_ancestor_package -package_key "acs-subsite"]
+
+template::multirow append \
+    attribute bgcolor [parameter::get -package_id $pkg_id -parameter bgcolor   -default "white"]
+template::multirow append \
+    attribute text    [parameter::get -package_id $pkg_id -parameter textcolor -default "black"]
+
+if { [info exists prefer_text_only_p]
+     && $prefer_text_only_p == "f"
+     && [ad_graphics_site_available_p] } {
+  template::multirow append attribute background \
+    [parameter::get -package_id $pkg_id -parameter background -default "/graphics/bg.gif"]
+}
+
+# User messages
+util_get_user_messages -multirow user_messages
+
+set csrf [security::csrf::new]
+
Index: openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head.adp	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,14 @@
+<master src="/www/blank-master">
+<if @doc@ defined><property name="&doc">doc</property></if>
+<if @streaming_head@ defined><property name="streaming_head">@streaming_head;noquote@</property></if>
+
+<div class="container-fluid">
+    <!-- START HEADER -->
+    <div class="row header">     
+        <widget src="header-bar" ds="0" subsite_logo="@subsite_logo;noquote@">
+        <widget src="search" ds="0">
+        <if @context_bar@ defined and @context_bar@ ne ""> <div class="col-xs-12 context"> @context_bar;noquote@ </div> </if>
+    </div>
+    <!-- END HEADER -->
+
+</div>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,118 @@
+
+set streaming_head 1
+
+if {![info exists subsite_link]} {
+    set subsite_link "/"
+}
+
+if {![info exists title]}     { set title     [ad_system_name]   }
+if {![info exists doc(title)]}     { set doc(title)     $title   }
+if {[info exists context]}      { set context_bar [ad_context_bar {*}$context]}
+
+
+
+###########################
+# dotLRN stuff            #
+###########################
+
+# $Id: dotlrn-streaming-head.tcl,v 1.1 2017/02/20 09:49:14 gustafn Exp $
+
+set user_id [ad_conn user_id] 
+set untrusted_user_id [ad_conn untrusted_user_id]
+set community_id [dotlrn_community::get_community_id]
+set dotlrn_url [dotlrn::get_url]
+
+set sitemap_url "$dotlrn_url/site-map"
+
+if {[dotlrn::user_p -user_id $user_id]} {
+    set portal_id [dotlrn::get_portal_id -user_id $user_id]
+}
+
+if {![info exists link_all]} {
+    set link_all 0
+}
+
+if {![info exists return_url]} {
+    set link [ad_conn -get extra_url]
+} else {
+    set link $return_url
+}
+
+if { [ad_conn package_key] ne [dotlrn::package_key] } {
+    # Peter M: We are in a package (an application) that may or may not be under a dotlrn instance 
+    # (i.e. in a news instance of a class)
+    # and we want all links in the navbar to be active so the user can return easily to the class homepage
+    # or to the My Space page
+    set link_all 1
+}
+
+set control_panel_text [_ acs-subsite.Admin]
+
+# Set dotlrn navbar
+if { !([info exists no_navbar_p] && $no_navbar_p ne "" && $no_navbar_p) && [info exists portal_id] && $portal_id ne "" } {
+    if { $community_id ne "" } {
+        set youarehere "[dotlrn_community::get_community_name $community_id]"
+    } else {
+        set youarehere "[_ theme-zen.MySpace]"
+    }
+
+    set extra_spaces "<img src=\"/resources/dotlrn/spacer.gif\" alt=\"\" border='0' width='15'>"    
+    set dotlrn_navbar [zen::portal_navbar]
+    set dotlrn_subnavbar [zen::portal_subnavbar \
+        -user_id $user_id \
+        -control_panel_text $control_panel_text \
+        -pre_html "$extra_spaces" \
+        -post_html $extra_spaces \
+        -link_all $link_all
+    ]
+} else {
+    set dotlrn_navbar ""
+    set dotlrn_subnavbar ""
+}
+
+
+
+###########################
+# END dotLRN stuff        #
+###########################
+
+template::head::add_meta \
+    -name "viewport" \
+    -content "width=device-width, initial-scale=1"
+template::head::add_meta \
+    -content "text/css" \
+    -http_equiv "content-style-type"
+
+if {[info exists context]}      { set context_bar [ad_context_bar {*}$context]}
+if {![info exists context_bar]} { set context_bar [ad_context_bar] }
+
+# clean out title and context bar for index page.
+if {[ad_conn url] eq "/" || [string match /index* [ad_conn url]] || [ad_conn url] eq "/community/"} { 
+    set context_bar {} 
+    set notitle 1
+}
+
+# stuff that is in the stock default-master
+
+template::multirow create attribute key value
+
+# Pull out the package_id of the subsite closest to our current node
+set pkg_id [site_node::closest_ancestor_package -package_key "acs-subsite"]
+
+template::multirow append \
+    attribute bgcolor [parameter::get -package_id $pkg_id -parameter bgcolor   -default "white"]
+template::multirow append \
+    attribute text    [parameter::get -package_id $pkg_id -parameter textcolor -default "black"]
+
+if { [info exists prefer_text_only_p]
+     && $prefer_text_only_p == "f"
+     && [ad_graphics_site_available_p] } {
+  template::multirow append attribute background \
+    [parameter::get -package_id $pkg_id -parameter background -default "/graphics/bg.gif"]
+}
+
+# User messages
+util_get_user_messages -multirow user_messages
+
+set csrf [security::csrf::new]
+
Index: openacs-4/packages/dotlrn-bootstrap3-theme/tcl/apm-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/tcl/apm-callback-procs.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/tcl/apm-callback-procs.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,155 @@
+namespace eval dotlrn_bootstrap3_theme {}
+namespace eval dotlrn_bootstrap3_theme::apm {}
+
+ad_proc dotlrn_bootstrap3_theme::apm::after_install {} {
+    Package after installation callback proc.  Add a theme for dotlrn.
+    This Package depends on openacs-bootstrap3-theme
+} {
+
+    
+    ### 1-COLUMN LAYOUT ###
+    # Insert layout to portal_layouts
+    set var_list [list \
+        [list name "#dotlrn-bootstrap3-theme.bootstrap-1column#"] \
+        [list description "#dotlrn-bootstrap3-theme.bootstrap-1column#"] \
+        [list resource_dir /resources/dotlrn-bootstrap3-theme/css] \
+        [list filename ../../dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column]
+    ]
+    set layout_id [package_instantiate_object -var_list $var_list portal_layout]
+    
+    # Insert regions to portal_supported_regions
+    set var_list [list \
+        [list layout_id $layout_id] \
+        [list region 1]
+    ]
+    package_exec_plsql -var_list $var_list portal_layout add_region
+
+    ### 2-COLUMN LAYOUT ###
+    # Insert layout to portal_layouts
+    set var_list [list \
+        [list name "#dotlrn-bootstrap3-theme.bootstrap-2column#"] \
+        [list description "#dotlrn-bootstrap3-theme.bootstrap-2column#"] \
+        [list resource_dir /resources/dotlrn-bootstrap3-theme/css] \
+        [list filename ../../dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column]
+    ]
+    set layout_id [package_instantiate_object -var_list $var_list portal_layout]
+    
+    # Insert regions to portal_supported_regions
+    set var_list [list \
+        [list layout_id $layout_id] \
+        [list region 1]
+    ]
+    package_exec_plsql -var_list $var_list portal_layout add_region
+    set var_list [list \
+        [list layout_id $layout_id] \
+        [list region 2]
+    ]
+    package_exec_plsql -var_list $var_list portal_layout add_region
+    
+    ### 3-COLUMN LAYOUT ###
+    # Insert layout to portal_layouts
+    set var_list [list \
+        [list name "#dotlrn-bootstrap3-theme.bootstrap-3column#"] \
+        [list description "#dotlrn-bootstrap3-theme.bootstrap-3column#"] \
+        [list resource_dir /resources/dotlrn-bootstrap3-theme/css] \
+        [list filename ../../dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column]
+    ]
+    set layout_id [package_instantiate_object -var_list $var_list portal_layout]
+    
+    # Insert regions to portal_supported_regions
+    set var_list [list \
+        [list layout_id $layout_id] \
+        [list region 1]
+    ]
+    package_exec_plsql -var_list $var_list portal_layout add_region
+    set var_list [list \
+        [list layout_id $layout_id] \
+        [list region 2]
+    ]
+    package_exec_plsql -var_list $var_list portal_layout add_region
+    set var_list [list \
+        [list layout_id $layout_id] \
+        [list region 3]
+    ]
+    package_exec_plsql -var_list $var_list portal_layout add_region
+    
+    
+    # Insert these themes into portal_element_themes
+    set var_list [list \
+        [list name "#dotlrn-bootstrap3-theme.bootstrap3-theme#"] \
+        [list description "#dotlrn-bootstrap3-theme.bootstrap3-theme#"] \
+        [list filename ../../dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme] \
+        [list resource_dir ../../dotlrn-bootstrap3-theme/lib/themes/bootstrap3-theme]
+    ]
+    set theme_id [package_instantiate_object -var_list $var_list portal_element_theme]
+    
+    # Insert these themes to dotlrn_site_templates
+    set site_template_id [db_nextval acs_object_id_seq]
+    db_dml insert_theme_to_dotlrn_site_templates {}
+    
+    # Insert this package's themes to site_templates
+    db_transaction {
+            
+        subsite::new_subsite_theme \
+            -key dotlrn_bootstrap3 \
+            -name #dotlrn-bootstrap3-theme.bootstrap3-theme# \
+            -template /packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master \
+            -css {
+{-href /resources/acs-subsite/site-master.css -media all -order 0}
+{-href //netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css -media all -order 1}
+{-href /resources/openacs-bootstrap3-theme/css/main.css -media all -order 2}
+{-href /resources/dotlrn-bootstrap3-theme/css/dotlrn.css -media all -order 3}
+{-href /resources/dotlrn-bootstrap3-theme/css/color/green.css -media all -order 4}
+{-href /resources/acs-templating/forms.css -media all -order 5}
+{-href /resources/acs-templating/lists.css -media all -order 6}
+            } \
+            -js {
+{-src "/resources/openacs-bootstrap3-theme/js/jquery-1.11.3.min.js" -order 1}
+{-src "//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js" -order 2}
+            } \
+            -form_template standard \
+            -list_template table \
+            -list_filter_template filters \
+            -dimensional_template dimensional \
+            -resource_dir /packages/openacs-bootstrap3-theme/resources \
+            -streaming_head /packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-streaming-head \
+    }
+}
+
+ad_proc -public dotlrn_bootstrap3_theme::apm::before_uninstantiate {
+    {-package_id:required}
+} {
+    Uninstantiate the package. We set portal_pages to zen theme layout here, because parameter BootstrapToZenMap is not available anymore at before_uninstall.
+} { 
+    
+    # switch to zen-theme, set zen-theme-specific parameters, update portal_pages to zen-theme
+    if {[subsite::get_theme] in {dotlrn_bootstrap3}} {
+        subsite::set_theme -theme dotlrn_zen
+    }
+    # set default parameters to zen-theme; set portal_pages to zen-theme layout
+    dotlrn_bootstrap3_theme::portal_page_parameter_update -new_theme dotlrn_zen
+    
+}
+
+ad_proc -public dotlrn_bootstrap3_theme::apm::before_uninstall {} {
+    Uninstall the package
+} {
+    
+    db_transaction {
+        # delete dotlrn-bootstrap3 portal_layouts, portal_supported_regions, dotlrn_site_templates. portal_element_themes
+        db_dml delete_theme_from_portal_layouts1 {}
+        db_dml delete_theme_from_portal_layouts2 {}
+        db_dml delete_theme_from_portal_layouts3 {}
+        db_dml delete_theme_from_portal_supported_regions1 {}
+        db_dml delete_theme_from_portal_supported_regions2 {}
+        db_dml delete_theme_from_portal_supported_regions3 {}
+        db_dml delete_theme_from_dotlrn_site_templates {}
+        db_dml delete_theme_from_portal_element_themes {}
+    } on_error {
+        ns_log notice "$errmsg"
+    }
+    
+    # delete subsite_theme
+    subsite::delete_subsite_theme -key dotlrn_bootstrap3
+}
+
Index: openacs-4/packages/dotlrn-bootstrap3-theme/tcl/apm-callback-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/tcl/apm-callback-procs.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/tcl/apm-callback-procs.xql	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,73 @@
+
+<?xml version="1.0"?>
+
+<queryset>
+
+  <fullquery name="dotlrn_bootstrap3_theme::apm::after_install.insert_theme_to_dotlrn_site_templates">
+    <querytext>
+      insert into dotlrn_site_templates
+        (site_template_id, pretty_name, site_master, portal_theme_id ) 
+      values 
+        (:site_template_id, '#dotlrn-bootstrap3-theme.bootstrap3-theme#', '/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master',
+         :theme_id)
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_layouts1">
+    <querytext>
+        DELETE from portal_layouts WHERE name='#dotlrn-bootstrap3-theme.bootstrap-1column#';
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_layouts2">
+    <querytext>
+        DELETE from portal_layouts WHERE name='#dotlrn-bootstrap3-theme.bootstrap-2column#';
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_layouts3">
+    <querytext>
+        DELETE from portal_layouts WHERE name='#dotlrn-bootstrap3-theme.bootstrap-3column#'
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_supported_regions1">
+    <querytext>
+        DELETE 
+        FROM portal_supported_regions AS psr
+        USING portal_layouts AS pl
+        where (pl.layout_id = psr.layout_id) AND pl.filename='../../dotlrn-bootstrap3-theme/lib/layouts/bootstrap-1column'
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_supported_regions2">
+    <querytext>
+        DELETE 
+        FROM portal_supported_regions AS psr
+        USING portal_layouts AS pl
+        where (pl.layout_id = psr.layout_id) AND pl.filename='../../dotlrn-bootstrap3-theme/lib/layouts/bootstrap-2column'
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_supported_regions3">
+    <querytext>
+        DELETE 
+        FROM portal_supported_regions AS psr
+        USING portal_layouts AS pl
+        where (pl.layout_id = psr.layout_id) AND pl.filename='../../dotlrn-bootstrap3-theme/lib/layouts/bootstrap-3column'
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_dotlrn_site_templates">
+    <querytext>
+        DELETE from dotlrn_site_templates WHERE pretty_name='#dotlrn-bootstrap3-theme.bootstrap3-theme#'
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::apm::before_uninstall.delete_theme_from_portal_element_themes">
+    <querytext>
+        DELETE from portal_element_themes WHERE name='#dotlrn-bootstrap3-theme.bootstrap3-theme#'
+    </querytext>
+  </fullquery>
+    
+</queryset>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/tcl/theme-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/tcl/theme-procs.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/tcl/theme-procs.tcl	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,191 @@
+ad_library {
+
+    Provides a simple API theme interactions
+    
+    @author Gustaf Neumann
+    @creation-date 05 July 2015
+}
+
+ad_proc -public -callback subsite::theme_changed -impl dotlrn-bootstrap3-theme {
+    -subsite_id:required
+    -old_theme:required
+    -new_theme:required
+} {
+
+    Implementation of the theme_changed callback which is called, whenever a theme is changed
+    
+    @param subsite_id subsite, of which the theme was changed
+    @param old_theme the name of the old theme
+    @param new_theme the name of the new theme
+} { 
+    
+    dotlrn_bootstrap3_theme::portal_page_parameter_update -new_theme $new_theme
+    
+}
+
+ad_proc -public dotlrn_bootstrap3_theme::portal_page_parameter_update {
+    -new_theme:required
+} {
+    Set parameters depending on new activated theme
+} {
+    # ns_log notice "-----PROC CALLED"
+    
+    set package_id [site_node::get_element -url /dotlrn -element package_id]
+    
+    if {$new_theme eq "dotlrn_bootstrap3"} {
+        db_transaction {
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter class_instance_pages_csv \
+                    -value "#dotlrn.class_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.class_page_home_accesskey#;#dotlrn.class_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.class_page_calendar_accesskey#;#dotlrn.class_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.class_page_file_storage_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter club_pages_csv \
+                    -value "#dotlrn.club_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.club_page_home_accesskey#;#dotlrn.club_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.club_page_calendar_accesskey#;#dotlrn.club_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.club_page_file_storage_accesskey#;#dotlrn.club_page_people_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.club_page_people_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter subcomm_pages_csv \
+                    -value "#dotlrn.subcomm_page_home_title,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.subcomm_page_home_accesskey#;#dotlrn.subcomm_page_info_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.subcomm_page_info_accesskey#;#dotlrn.subcomm_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.subcomm_page_calendar_accesskey#;#dotlrn.subcomm_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.subcomm_page_file_storage_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter user_portal_pages_csv \
+                    -value "#dotlrn.user_portal_page_home_title#,#dotlrn-bootstrap3-theme.bootstrap-2column#,#dotlrn.user_portal_page_home_accesskey#;#dotlrn.user_portal_page_calendar_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.user_portal_page_calendar_accesskey#;#dotlrn.user_portal_page_file_storage_title#,#dotlrn-bootstrap3-theme.bootstrap-1column#,#dotlrn.user_portal_page_file_storage_accesskey#"
+                
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter admin_layout_name \
+                    -value "#dotlrn-bootstrap3-theme.bootstrap-2column#"                    
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter non_member_layout_name \
+                    -value "#dotlrn-bootstrap3-theme.bootstrap-2column#"                    
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter DefaultMaster_p \
+                    -value "/packages/dotlrn-bootstrap3-theme/resources/masters/dotlrn-master"                    
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter DefaultSiteTemplate \
+                    -value "#dotlrn-bootstrap3-theme.bootstrap3-theme#"                    
+                    
+                parameter::set_from_package_key \
+                    -package_key new-portal \
+                    -parameter default_theme_name \
+                    -value "#dotlrn-bootstrap3-theme.bootstrap3-theme#"                    
+                    
+                parameter::set_from_package_key \
+                    -package_key new-portal \
+                    -parameter default_layout \
+                    -value "#dotlrn-bootstrap3-theme.bootstrap-2column#"
+        }
+        
+    } elseif {$new_theme eq "dotlrn_zen"} {
+        db_transaction {
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter class_instance_pages_csv \
+                    -value "#dotlrn.class_page_home_title#,#theme-zen.Zen_thin_thick#,#dotlrn.class_page_home_accesskey#;#dotlrn.class_page_calendar_title#,#theme-zen.Zen_1_column#,#dotlrn.class_page_calendar_accesskey#;#dotlrn.class_page_file_storage_title#,#theme-zen.Zen_1_column#,#dotlrn.class_page_file_storage_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter club_pages_csv \
+                    -value "#dotlrn.club_page_home_title#,#theme-zen.Zen_thin_thick#,#dotlrn.club_page_home_accesskey#;#dotlrn.club_page_calendar_title#,#theme-zen.Zen_1_column#,#dotlrn.club_page_calendar_accesskey#;#dotlrn.club_page_file_storage_title#,#theme-zen.Zen_1_column#,#dotlrn.club_page_file_storage_accesskey#;#dotlrn.club_page_people_title#,#theme-zen.Zen_1_column#,#dotlrn.club_page_people_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter subcomm_pages_csv \
+                    -value "#dotlrn.subcomm_page_home_title,#theme-zen.Zen_thin_thick#,#dotlrn.subcomm_page_home_accesskey#;#dotlrn.subcomm_page_info_title#,#theme-zen.Zen_1_column#,#dotlrn.subcomm_page_info_accesskey#;#dotlrn.subcomm_page_calendar_title#,#theme-zen.Zen_1_column#,#dotlrn.subcomm_page_calendar_accesskey#;#dotlrn.subcomm_page_file_storage_title#,#theme-zen.Zen_1_column#,#dotlrn.subcomm_page_file_storage_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter user_portal_pages_csv \
+                    -value "#dotlrn.user_portal_page_home_title#,#theme-zen.Zen_thin_thick#,#dotlrn.user_portal_page_home_accesskey#;#dotlrn.user_portal_page_calendar_title#,#theme-zen.Zen_1_column#,#dotlrn.user_portal_page_calendar_accesskey#;#dotlrn.user_portal_page_file_storage_title#,#theme-zen.Zen_1_column#,#dotlrn.user_portal_page_file_storage_accesskey#"
+            
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter admin_layout_name \
+                    -value "#theme-zen.Zen_2_column#"
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter non_member_layout_name \
+                    -value "#theme-zen.Zen_2_column#"
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter DefaultMaster_p \
+                    -value "/packages/theme-zen/lib/lrn-master"
+                    
+                parameter::set_default \
+                    -package_key dotlrn \
+                    -parameter DefaultSiteTemplate \
+                    -value "#theme-zen.Zen_Theme#"
+                    
+                parameter::set_from_package_key \
+                    -package_key new-portal \
+                    -parameter default_theme_name \
+                    -value "#theme-zen.Zen_Theme#"
+                
+                parameter::set_from_package_key \
+                    -package_key new-portal \
+                    -parameter default_layout \
+                    -value "#theme-zen.Zen_2_column#"
+        }
+    }
+    
+    if {$new_theme eq "dotlrn_bootstrap3" || $new_theme eq "dotlrn_zen"} {
+        set site_template_name [db_string get_site_template_name {}]
+        set site_template_id [db_string select_st_id {}]
+        
+        # for communities
+        parameter::set_value -package_id $package_id \
+            -parameter  "CommDefaultSiteTemplate_p" \
+            -value $site_template_id
+               
+        # for users
+        parameter::set_value -package_id $package_id \
+            -parameter  "UserDefaultSiteTemplate_p" \
+            -value $site_template_id
+        
+        # Theme switching: theme of portlet design
+        # Note that dotlrn uses same name for theme name and subsite name !
+        db_1row get_theme {}
+        db_dml update_theme {}
+        # ns_log notice "---THEME: DONE"
+        
+        # Layout switching: Layout of portal page e.g. 2-column, 1-column etc
+        if {$new_theme eq "dotlrn_bootstrap3"} {
+            set layout_blueprint ZenToBootstrapMap
+        } elseif {$new_theme eq "dotlrn_zen"} {
+            set layout_blueprint BootstrapToZenMap
+        }
+
+        # ns_log notice "PARAMETER: <[parameter::get_from_package_key -package_key dotlrn-bootstrap3-theme -parameter $layout_blueprint]>"
+        
+        db_transaction {
+            foreach {old new} [parameter::get_from_package_key -package_key dotlrn-bootstrap3-theme -parameter $layout_blueprint] {
+                db_1row get_old {}
+                # ns_log notice "OLD: $old"
+                db_1row get_new {}
+                # ns_log notice "NEW: $new"
+                db_dml update_layouts {}
+                # ns_log notice "---LAYOUT: DONE"
+                
+            }
+        } on_error {
+            ns_log notice "$errmsg"
+        }
+    }
+            
+    # ns_log notice "---PROC FINISHED"
+    
+    }
+}
Index: openacs-4/packages/dotlrn-bootstrap3-theme/tcl/theme-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/tcl/theme-procs.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/tcl/theme-procs.xql	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+
+<queryset>
+
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.get_site_template_name">
+    <querytext>
+       select name
+       from subsite_themes
+       where key = :new_theme
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.select_st_id">
+    <querytext>
+       select site_template_id
+       from dotlrn_site_templates
+       where pretty_name = :site_template_name
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.get_theme">
+    <querytext>
+      select theme_id
+      from portal_element_themes
+      where name = :site_template_name
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.update_theme">
+    <querytext>
+      update portals
+      set theme_id = :theme_id
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.get_old">
+    <querytext>
+      select layout_id as old_id
+      from portal_layouts
+      where name = :old
+    </querytext>
+  </fullquery>
+
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.get_new">
+    <querytext>
+      select layout_id as new_id
+      from portal_layouts
+      where name = :new
+    </querytext>
+  </fullquery>
+  
+  <fullquery name="dotlrn_bootstrap3_theme::portal_page_parameter_update.update_layouts">
+    <querytext>
+      update portal_pages
+      set layout_id = :new_id
+      where layout_id = :old_id
+    </querytext>
+  </fullquery>
+  
+</queryset>
Index: openacs-4/packages/dotlrn-bootstrap3-theme/www/resources/css/dotlrn.css
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/www/resources/css/dotlrn.css,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/www/resources/css/dotlrn.css	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,112 @@
+
+/********   Navigation   ********/
+
+.dotlrn-navigation ul:before, .dotlrn-navigation ul:after {
+    content: " ";
+    display: table;
+}
+.dotlrn-navigation ul:after {
+    clear:both;
+}
+
+.dotlrn-navigation ul {
+    list-style: outside none none;
+    margin-bottom: 0;
+    padding-left: 0;
+}
+
+.dotlrn-navigation ul > li {
+    float: left;
+    margin-bottom: -1px;
+    display: block;
+    position: relative;
+}
+.dotlrn-navigation > ul {
+    border-bottom: 1px solid #bbb;
+}
+.dotlrn-navigation > ul > li > a {
+    border:1px solid #ddd;
+    border-bottom-color:transparent;
+    border-radius: 4px 4px 0 0;
+    line-height: 1.42857;
+    margin-right: 2px;
+}
+.dotlrn-navigation > ul > li > a {
+    display: block;
+    padding: 10px 15px;
+    position: relative;
+}
+div.dotlrn-navigation > ul > li#main-navigation-active > a,
+div.dotlrn-navigation > ul > li#main-navigation-active > a:hover,
+div.dotlrn-navigation > ul > li#main-navigation-active > a:focus
+{
+    color:#555;
+    background-color:#fff;
+    border:1px solid #bbb;
+    border-bottom-color:transparent;
+    cursor:default;
+}
+.dotlrn-sub-navigation {
+    margin: 5px;
+    border-bottom: 1px solid #bbb;
+}
+.dotlrn-sub-navigation ul {
+    list-style: outside none none;
+    margin-left: -5px;
+    margin-bottom:5px;
+    padding-left: 0;
+}
+.dotlrn-sub-navigation ul > li {
+    display: inline-block;
+    padding-left: 5px;
+    padding-right: 5px;
+}
+.dotlrn-sub-navigation ul > li#sub-navigation-active a, 
+.dotlrn-sub-navigation ul > li#sub-navigation-active a:hover,
+.dotlrn-sub-navigation ul > li#sub-navigation-active a:active
+{
+    color:#555;
+    cursor:default;
+}
+
+/********   Portlets   ********/
+
+div.panel .panel-body > h1 {
+    font-size:16px;
+}
+
+/********   Portal Page Config   ********/
+/* now solved in css; should be solved theme-wide in new-portal */
+
+table.portal-page-config td.leftColumn, table.portal-page-config td.rightColumn {
+    width:50%;
+    padding:10px;
+} 
+table.portal-page-config .portlet-header {
+    background-color: #f8f8f8;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+    padding:10px;
+}
+table.portal-page-config .portlet-title {
+    float:left;
+    display:inline; 
+}
+table.portal-page-config .portlet-title h1, table.portal-page-config .portlet-title-no-controls h1 {
+    font-size:17px;
+    color:#000;
+    margin:0;
+    padding-right:10px;
+}
+table.portal-page-config .portlet-controls {
+    display:block;
+}
+table.portal-page-config .portlet {
+    clear:both;
+    background-color: #fff;
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
+    margin: 0 0 20px 0;
+}
Index: openacs-4/packages/dotlrn-bootstrap3-theme/www/resources/css/color/green.css
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bootstrap3-theme/www/resources/css/color/green.css,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn-bootstrap3-theme/www/resources/css/color/green.css	20 Feb 2017 09:49:14 -0000	1.1
@@ -0,0 +1,19 @@
+.main-nav,
+div.logo-wrapper {
+    background-color: #07A8B0;
+}
+span.invisible {
+    color:#07A8B0;
+}
+a:link,
+a:visited,
+a:hover {
+    color:#07A8B0;    
+}
+.main-nav .navbar-nav > li.active > a, 
+.main-nav .navbar-nav > .active > a, 
+.main-nav .navbar-nav > .active > a:hover, 
+.main-nav .navbar-nav > .active > a:focus {
+    color:#07A8B0;
+}
+