Index: openacs-4/packages/dotlrn/www/applets-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets-chunk.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/applets-chunk.tcl 12 Jul 2002 21:34:17 -0000 1.6 +++ openacs-4/packages/dotlrn/www/applets-chunk.tcl 13 Jul 2002 17:49:25 -0000 1.7 @@ -24,10 +24,12 @@ } -query { } +set community_id [dotlrn_community::get_community_id] + # this chunk must be restricted to admins of the community only dotlrn::require_user_admin_community \ -user_id [ad_conn user_id] \ - -community_id [dotlrn_community::get_community_id] + -community_id $community_id # Get active applets set list_of_active_applets [dotlrn_community::list_active_applets -community_id $community_id] Index: openacs-4/packages/dotlrn/www/applets.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/applets.adp 29 Mar 2002 19:14:46 -0000 1.8 +++ openacs-4/packages/dotlrn/www/applets.adp 13 Jul 2002 17:49:25 -0000 1.9 @@ -20,11 +20,6 @@ Manage Applets -1 -one-community -1 -1 -@portal_id@ @context_bar@ Index: openacs-4/packages/dotlrn/www/clone.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/clone.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/clone.adp 29 May 2002 23:03:07 -0000 1.1 +++ openacs-4/packages/dotlrn/www/clone.adp 13 Jul 2002 17:49:25 -0000 1.2 @@ -20,9 +20,6 @@ @title@ -@portal_id@ -1 -1 Note: This may take some time. Please be patient. Index: openacs-4/packages/dotlrn/www/clone.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/clone.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/clone.tcl 5 Jun 2002 18:17:17 -0000 1.2 +++ openacs-4/packages/dotlrn/www/clone.tcl 13 Jul 2002 17:49:25 -0000 1.3 @@ -25,15 +25,20 @@ title:onevalue } -set class_instance_p 0 set user_id [ad_get_user_id] set community_id [dotlrn_community::get_community_id] + +# this page must be restricted to admins of the community only +dotlrn::require_user_admin_community \ + -user_id $user_id \ + -community_id $community_id + +set class_instance_p 0 set community_name [dotlrn_community::get_community_name $community_id] set title "Copy $community_name]" set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set top_community_type [dotlrn_community::get_toplevel_community_type_from_community_id $community_id] - if { $top_community_type != "dotlrn_club" && $top_community_type != "dotlrn_community" } { Index: openacs-4/packages/dotlrn/www/community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-type.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/community-type.adp 29 Mar 2002 19:14:46 -0000 1.7 +++ openacs-4/packages/dotlrn/www/community-type.adp 13 Jul 2002 17:49:25 -0000 1.8 @@ -21,7 +21,6 @@ @context_bar@ dotLRN: @pretty_name@ -@portal_id@

Fisheye: Tag 1.10 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.11 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/community.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/configure-element.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-element.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/configure-element.adp 29 Mar 2002 19:14:46 -0000 1.5 +++ openacs-4/packages/dotlrn/www/configure-element.adp 13 Jul 2002 17:49:25 -0000 1.6 @@ -20,8 +20,8 @@ Configure Element -@portal_id@ +

@rendered_page@ Index: openacs-4/packages/dotlrn/www/configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.adp,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/configure.adp 29 Mar 2002 19:14:46 -0000 1.8 +++ openacs-4/packages/dotlrn/www/configure.adp 13 Jul 2002 17:49:25 -0000 1.9 @@ -20,11 +20,10 @@ Configure @name@ -@portal_id@ + 1 1 0 -./

Index: openacs-4/packages/dotlrn/www/dotlrn-default-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/dotlrn-default-master.adp,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/dotlrn-default-master.adp 29 Jun 2002 21:44:47 -0000 1.9 +++ openacs-4/packages/dotlrn/www/dotlrn-default-master.adp 13 Jul 2002 17:49:25 -0000 1.10 @@ -34,71 +34,8 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
@text@
- MySloanSpace - Help - Logout -
- - - - -
-
- - - -@navbar@ - -

- - - - - - - - -

- -@navbar@ - - -


- - - Index: openacs-4/packages/dotlrn/www/dotlrn-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-master.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/dotlrn-master.adp 3 Jun 2002 20:59:48 -0000 1.4 +++ openacs-4/packages/dotlrn/www/dotlrn-master.adp 13 Jul 2002 17:49:25 -0000 1.5 @@ -18,38 +18,71 @@ %> - +@header_stuff@ +@title@ - + + + + + + + - - @title@ - + - - @link_all@ - + - - @return_url@ - + - - @show_control_panel@ - + + + + +
+ + + + + +
+
@text@
+ MySloanSpace + Help + Logout +
+ + + + +
+
- - @link_control_panel@ - + - - @no_navbar_p@ - +@navbar@ - - @portal_id@ - +

+ + + + + + + + +

+ +@navbar@ + + +


+ + + Index: openacs-4/packages/dotlrn/www/dotlrn-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/dotlrn-master.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/dotlrn-master.tcl 16 Apr 2002 13:53:52 -0000 1.3 +++ openacs-4/packages/dotlrn/www/dotlrn-master.tcl 13 Jul 2002 17:49:25 -0000 1.4 @@ -1 +1,366 @@ +# +# Copyright (C) 2001, 2002 OpenForce, Inc. +# +# 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 { + + Q: What is this file? + + A: This is the master template for dotlrn. It sets up the navbar and + dynamically generates a CSS file for the dotlrn banner color, font, header + image, and the portal themes. + + Q: How do I get the dotlrn banner and navigation everywhere on my site, + not just under /dotlrn? + + A: By default the dotlrn banner and navigation is NOT shown everywhere on + your site. If you would like the dotlrn banner and navigation everywhere, + Change the "Main Site"'s "DefaultMaster" parameter + from "/www/default-master" to "/packages/dotlrn/www/dotlrn-master" + at http://yoursite.com/admin/site-map + + Q: How do I customize the banner, images, CSS, etc? + + A: You can change the default banner and generated CSS by editing this file + and the associated ADP. + + WARNING: All current portlet themes (table, deco, nada, etc) depend on some + of the CSS generated below. Be careful when you edit the CSS below otherwise + these themes will most likely break. + + Q: I added some custom pages to /dotlrn. How do I control the navbar from + these pages? + + A: ADP pages can pass properties "up" to this script to alter it's behavior. + + The properties an ADP can set are: + title - the html title + no_navbar_p - if 1, hide navbar + link_all - if exists, make all page names in the navbar links + show_control_panel - if 1 show the "Control Panel" link in the navbar + link_control_panel - if 1 link the "Control Panel" link in the navbar + + + TODO: + 1. link_control_panel - are ADPs using this right? + + @author arjun (arjun@openforce.net) + @version $Id$ + +} { + {title "SloanSpace"} + {no_navbar_p 0} +} + +# {link_all 0} +# {show_control_panel 0} +# {link_control_panel 1} + +if {![info exists link_control_panel]} { + set link_control_panel 1 +} + +if {![info exists show_control_panel]} { + set show_control_panel 0 +} + +if {![info exists link_all]} { + set link_all 0 +} + +#ad_return_complaint 1 "foo $link_control_panel / $title" +#ad_script_abort + +# +# Set up some basic vars +# +set user_id [ad_get_user_id] +set portal_id "" +set full_name "[dotlrn::get_user_name $user_id]" +set control_panel_text "Control Panel" + +# properties for the adp +set dotlrn_url [dotlrn::get_url] +set dotlrn_graphics_url "/graphics" +set text $full_name +set navbar "
" + + +# +# navbar generation +# +# All this code does is get the correct values for portal_id and sets some +# navbar variables based on the user and location# +# + +if {!$no_navbar_p} { + + set community_id [dotlrn_community::get_community_id] + set control_panel_name preferences + + if {[empty_string_p $community_id]} { + # + # We are not under a dotlrn community. However we could be under /dotlrn + # (i.e. in the user's portal) or anywhere else on the site + # + if {[dotlrn::user_p -user_id $user_id]} { + # this user is a dotlrn user, show their personal portal + # navbar, including the control panel link + set portal_id [dotlrn::get_portal_id -user_id $user_id] + set show_control_panel 1 + } + } else { + # + # We are under a dotlrn community. Get the community's portal_id, etc. + # + + # some defaults + set text [dotlrn_community::get_community_header_name $community_id] + set control_panel_name one-community-admin + + # figure out what this privs this user has on the community + set admin_p [dotlrn::user_can_admin_community_p \ + -user_id $user_id \ + -community_id $community_id + ] + + if {!$admin_p} { + # the user can't admin this community, perhaps they are a + # humble member instead? + set member_p [dotlrn_community::member_p $community_id $user_i] + } else { + # admins always get the control_panel_link + set show_control_panel 1 + } + + if {$admin_p || $member_p} { + set portal_id [dotlrn_community::get_portal_id \ + -community_id $community_id + ] + } else { + # show this person the comm's non-member-portal + set portal_id [dotlrn_community::get_non_member_portal_id \ + -community_id $community_id + ] + } + } + + # Common code for the the behavior of the "control panel" link + # + if {![string equal [ad_conn url] "[dotlrn::get_url]/" ]} { + # if we are not under /dotlrn, link all of the pages in the navbar + set link_all 1 + } + + if {$show_control_panel} { + if {$link_control_panel} { + set extra_td_html \ + "   $control_panel_text" + } else { + set extra_td_html "   $control_panel_text" + } + } else { + set extra_td_html {} + } + + # Actually generate the navbar, if we got a valid portal_id + + if {![empty_string_p $portal_id]} { + set navbar [portal::navbar \ + -portal_id $portal_id \ + -link_all $link_all \ + -link "$dotlrn_url/" \ + -pre_html "" \ + -post_html "" \ + -extra_td_html $extra_td_html \ + -table_html_args "class=\"navbar\""] + } +} + + +# the ColorHack and FontHack and LogoHack! +set color_hack "#cc0000" +set color_hack_name "red" +set header_font "" +set header_font_size "medium" +set header_font_color "black" +set header_logo_item_id "" +set header_img_url "$dotlrn_graphics_url/logowhite.gif" +set header_img_alt_text "Header Logo" + + +# gets the package_id for the passed in dotlrn instace, +# if the community_id is invalid, returns the pacakge_id of the +# main dotlrn instance ??? +set package_id [dotlrn_community::get_package_id $community_id] + +if {[empty_string_p [dotlrn_community::get_parent_community_id -package_id $package_id]]} { + set parent_comm_p 0 +} else { + set parent_comm_p 1 +} + +# in a community or just under one in a mounted package like /calendar +if {[parameter::get -package_id $package_id -parameter community_level_p] == 1 || $parent_comm_p } { + set community_id [dotlrn_community::get_community_id] + + # color hack + if {[dotlrn_community::subcommunity_p -community_id $community_id]} { + set color_hack "#663366" + set color_hack_name "purple" + } else { + set comm_type \ + [dotlrn_community::get_community_type_from_community_id $community_id] + if {$comm_type == "dotlrn_club"} { + set color_hack "#006666" + set color_hack_name "green" + } else { + set color_hack "#6699cc" + set color_hack_name "blue" + } + } + + # font hack + set header_font [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_font + ] + append header_font ", " + + set header_font_size [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_font_size + ] + + set header_font_color [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_font_color + ] + + # logo hack + set header_logo_item_id [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_logo_item_id + ] + + if {![empty_string_p $header_logo_item_id]} { + + set header_img_url "community-image?revision_id=$header_logo_item_id" + } + + set header_logo_alt_text [dotlrn_community::get_attribute \ + -community_id $community_id \ + -attribute_name header_logo_alt_text + ] + + if {![empty_string_p $header_logo_alt_text]} { + set header_img_alt_text $header_logo_alt_text + } + + # The header text is the name of the community + set text [dotlrn_community::get_community_header_name $community_id] + +} elseif {[parameter::get -package_id $package_id -parameter community_type_level_p] == 1} { + # in a community type + set text \ + [dotlrn_community::get_community_type_name [dotlrn_community::get_community_type]] +} else { + # under /dotlrn + set text $full_name +} + +# +# WARNING: All current portlet themes (table, deco, nada, etc) depend on some +# of the CSS defined below. Be carefull when you edit the CSS below, +# and check how themes use it. +# + +set header_stuff " + + + +" + +ad_return_template Index: openacs-4/packages/dotlrn/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.adp,v diff -u -r1.20 -r1.21 --- openacs-4/packages/dotlrn/www/index.adp 28 Apr 2002 04:08:42 -0000 1.20 +++ openacs-4/packages/dotlrn/www/index.adp 13 Jul 2002 17:49:25 -0000 1.21 @@ -20,7 +20,6 @@ dotLRN -@portal_id@

Fisheye: Tag 1.8 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/master.adp,v diff -u -r1.14 -r1.15 --- openacs-4/packages/dotlrn/www/master.adp 29 May 2002 04:45:23 -0000 1.14 +++ openacs-4/packages/dotlrn/www/master.adp 13 Jul 2002 17:49:25 -0000 1.15 @@ -21,8 +21,8 @@ @title@ -@portal_id@ + <% set dotlrn_url [dotlrn::get_url] %> Index: openacs-4/packages/dotlrn/www/members.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/members.adp 28 Apr 2002 16:46:41 -0000 1.12 +++ openacs-4/packages/dotlrn/www/members.adp 13 Jul 2002 17:49:25 -0000 1.13 @@ -20,10 +20,8 @@ Manage Membership -1 -one-community @admin_p@ @admin_p@ -@portal_id@ + Index: openacs-4/packages/dotlrn/www/not-allowed.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/not-allowed.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/not-allowed.adp 29 Mar 2002 19:14:46 -0000 1.6 +++ openacs-4/packages/dotlrn/www/not-allowed.adp 13 Jul 2002 17:49:25 -0000 1.7 @@ -20,7 +20,6 @@ Not Allowed -

You are not allowed to perform that action. Index: openacs-4/packages/dotlrn/www/one-community-admin.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.adp,v diff -u -r1.20 -r1.21 --- openacs-4/packages/dotlrn/www/one-community-admin.adp 29 Mar 2002 19:14:46 -0000 1.20 +++ openacs-4/packages/dotlrn/www/one-community-admin.adp 13 Jul 2002 17:49:25 -0000 1.21 @@ -21,9 +21,6 @@ @context_bar@ @pretty_name@ Admin -@portal_id@ -1 -one-community 0 1 Index: openacs-4/packages/dotlrn/www/one-community-not-member.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-not-member.adp,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn/www/one-community-not-member.adp 31 May 2002 06:36:01 -0000 1.16 +++ openacs-4/packages/dotlrn/www/one-community-not-member.adp 13 Jul 2002 17:49:25 -0000 1.17 @@ -23,7 +23,7 @@ @context_bar@ @pretext@ -@portal_id@ + @admin_p@ Index: openacs-4/packages/dotlrn/www/one-community-portal-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-portal-configure.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community-portal-configure.adp 14 May 2002 22:00:43 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community-portal-configure.adp 13 Jul 2002 17:49:25 -0000 1.2 @@ -20,7 +20,7 @@ Configure this instance's template -@portal_id@ + t

Index: openacs-4/packages/dotlrn/www/one-community.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/dotlrn/www/one-community.adp 3 Jun 2002 20:59:48 -0000 1.18 +++ openacs-4/packages/dotlrn/www/one-community.adp 13 Jul 2002 17:49:25 -0000 1.19 @@ -19,7 +19,7 @@ %> -@portal_id@ + @admin_p@

Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/one-community.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/preferences.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/preferences.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/dotlrn/www/preferences.adp 29 May 2002 04:45:23 -0000 1.18 +++ openacs-4/packages/dotlrn/www/preferences.adp 13 Jul 2002 17:49:25 -0000 1.19 @@ -20,9 +20,8 @@ @title@ -@portal_id@ + 1 -./ 0 <% set dotlrn_url [dotlrn::get_url] %> Index: openacs-4/packages/dotlrn/www/spam-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam-2.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/spam-2.adp 4 Jun 2002 00:03:44 -0000 1.4 +++ openacs-4/packages/dotlrn/www/spam-2.adp 13 Jul 2002 17:49:25 -0000 1.5 @@ -19,11 +19,10 @@ @spam_name@ Community @context_bar@ -@portal_id@ + 1 -Group Admin -1 +

Are you sure you want to send the following @spam_name@ Message?

Index: openacs-4/packages/dotlrn/www/spam.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/spam.adp 16 May 2002 03:56:31 -0000 1.12 +++ openacs-4/packages/dotlrn/www/spam.adp 13 Jul 2002 17:49:25 -0000 1.13 @@ -21,11 +21,10 @@ @spam_name@ Community @context_bar@ -@portal_id@ + 1 -Group Admin -1 + Index: openacs-4/packages/dotlrn/www/subcommunity-archive.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-archive.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/subcommunity-archive.adp 31 May 2002 21:24:13 -0000 1.2 +++ openacs-4/packages/dotlrn/www/subcommunity-archive.adp 13 Jul 2002 17:49:25 -0000 1.3 @@ -21,8 +21,8 @@ @title@ 1 -1 + Are you sure you want to archive group @pretty_name@?

The group's data will not be modified, but the group will only be accessible to system administrators. Index: openacs-4/packages/dotlrn/www/subcommunity-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-new.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/subcommunity-new.adp 6 May 2002 23:55:02 -0000 1.5 +++ openacs-4/packages/dotlrn/www/subcommunity-new.adp 13 Jul 2002 17:49:25 -0000 1.6 @@ -20,8 +20,8 @@ @title@ -@portal_id@ + 1 -1 +