Index: openacs-4/packages/acs-subsite/www/resources/site-master.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/resources/site-master.css,v diff -u -N -r1.27.2.2 -r1.27.2.3 --- openacs-4/packages/acs-subsite/www/resources/site-master.css 14 Jan 2007 03:14:21 -0000 1.27.2.2 +++ openacs-4/packages/acs-subsite/www/resources/site-master.css 2 Mar 2007 16:12:35 -0000 1.27.2.3 @@ -11,10 +11,17 @@ margin: 0px; } +#skiptocontent { + display: none; +} +.block-marker { + display: none; +} + /* Site Header */ -#site-header { +#header { background-color: #313063; color: white; font-family: tahoma, verdana, helvetica, sans-serif; @@ -26,36 +33,31 @@ text-align: center; } -#site-header .system-name { +#system-name { font-size: 120%; font-weight: bold; float: left; } -#site-header .system-name a { +#system-name a { color: white; text-decoration: none; } -#site-header .system-name a:hover { +#system-name a:hover { color: white; text-decoration: none; } -#site-header .users-online { - display: inline; - float: right; - padding-right: 4em; +#header-navigation { + float: right; + display:inline; + padding-right: 0.4em; } -#site-header .user-greeting { +#header-navigation li { display: inline; } -#site-header .permanent-navigation { - display: inline; - float: right; -} - -#site-header .action-list a { +#header-navigation a { border: solid 1px #313063; text-align: center; padding: 1px; @@ -64,7 +66,7 @@ color: white; text-decoration: none; } -#site-header .action-list a:hover { +#header-navigation a:hover { text-decoration: none; background-color: #666666; border: solid 1px #999999; @@ -74,25 +76,18 @@ /* User Messages */ -#user-message { +#alert-message { background-color: #ccff99; padding: 4px; padding-top: 6px; padding-bottom: 6px; font-size: 85%; } -#user-message ul { +#alert-message .alert { margin-left: 0; - padding-left: 0; - display: inline; - border: none; -} -#user-message ul li { - margin-left: 0; padding-left: 2px; border: none; - list-style: none; } @@ -120,39 +115,20 @@ /* Context Bar */ -#context-bar { - font-family: Arial, sans-serif; - font-size: 11px; - margin-bottom: 2px; - padding-left: 8px; -} -#context-bar .breadcrumbs { - clear: left; - float: left; - padding-top: 3px; -} -#context-bar .breadcrumbs ul { - display: inline; +#breadcrumb .compact { margin-left: 0; padding-left: 0; - display: inline; border: none; } -#context-bar .breadcrumbs ul li { - list-style: none; - display: inline; +#breadcrumb .compact li { margin-left: 0; padding-left: 2px; border: none; list-style: none; display: inline; } -#context-bar #navlinks { - float: right; -} - /* Subsite Name */ #subsite-name { @@ -170,26 +146,10 @@ text-decoration: none; } -/* This wraps everything except site-header and site-footer, and is used to ensure proper margins */ -/* Only used on non-tabbed (navbar and subnavbar) pages */ -#page-body { - margin-left: 8px; - margin-right: 8px; -} - - - - -/* Title of page, typically used on an H1 tag */ - -.page-title { -} - - /* Site Footer */ -#site-footer { +#footer { clear: both; border-top: 1px solid #ccc; font-family: tahoma, verdana, helvetica, sans-serif; @@ -202,30 +162,25 @@ text-align: center; } -#site-footer ul { +#footer ul { display: inline; margin-left: 0; padding-left: 0; border: none; } -#site-footer ul li { +#footer ul li { margin-left: 0; padding-left: 10px; border: none; list-style: none; display: inline; } -#site-footer .action-list { +#footer .action-list { float: left; } - - - - - /********************************************************************** /* General navigation /**********************************************************************/ Index: openacs-4/www/blank-compat.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/blank-compat.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/www/blank-compat.adp 2 Mar 2007 16:12:35 -0000 1.1.2.1 @@ -0,0 +1,8 @@ + +meta +link +script +doc +body +@head;noquote@ + Index: openacs-4/www/blank-compat.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/blank-compat.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/www/blank-compat.tcl 2 Mar 2007 16:12:35 -0000 1.1.2.1 @@ -0,0 +1,62 @@ +ad_page_contract { + Accepts and translates deprecated master template variables. + Writes a warning message to the log in each case. + + @author Lee Denison (lee@xarg.co.uk) + @creation-date: 2007-02-18 + + $Id: blank-compat.tcl,v 1.1.2.1 2007/03/02 16:12:35 leed Exp $ +} + +if {![array exists doc]} { + array set doc [list] +} + +set translations [list \ + doc_type doc(type) \ + title doc(title) \ + header_stuff head \ + on_load body(onload) \ +] + +foreach {from to} $translations { + if {[info exists $from]} { + ns_log warning "blank-compat: [ad_conn file] uses deprecated property $from instead of $to." + set $to [set $from] + } +} + +if { ![template::util::is_nil focus] } { + ns_log warning "blank-compat: property focus is deprecated in blank-master - focus should be handled in site-master." + + # Handle elements where the name contains a dot + if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { + lappend body(onload) "acs_Focus('${form_name}', '${element_name}');" + } +} + +if {[exists_and_not_null body_attributes]} { + foreach body_attribute $body_attributes { + if {[lsearch { + id + class + onload + onunload + onclick + ondblclick + onmousedown + onmouseup + onmouseover + onmousemove + onmouseout + onkeypress + onkeydown + onkeyup + } [lindex $body_attribute 0] >= 0]} { + ns_log warning "blank-compat: [ad_conn file] uses deprecated property body_attribute for [lindex $body_attribute 0] instead of body([lindex $body_attribute 0])." + set body([lindex $body_attribute 0]) [lindex $body_attribute 1] + } else { + ns_log error "blank-compat: [ad_conn file] uses deprecated property body_attribute for [lindex $body_attribute 0] which is no longer supported!" + } + } +} Index: openacs-4/www/blank-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/blank-master.adp,v diff -u -N -r1.19.2.2 -r1.19.2.3 --- openacs-4/www/blank-master.adp 19 Feb 2007 23:44:32 -0000 1.19.2.2 +++ openacs-4/www/blank-master.adp 2 Mar 2007 16:12:35 -0000 1.19.2.3 @@ -1,93 +1,17 @@ -@doc_type;noquote@ - - @head_attribute.key@="@head_attribute.value@"> - @title;noquote@ - - - - - - - +@doc.type;noquote@ + lang="@doc.lang;noquote@" xml:lang="@doc.lang;noquote@" xmlns="@doc.xmlns;noquote@"> + + lang="@doc.title_lang;noquote@" xml:lang="@doc.title_lang;noquote@">@doc.title;noquote@ - - - - - - - - - - - - - - - - @header_stuff;noquote@ - - @attribute.key@="@attribute.value@"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + http-equiv="@meta.http_equiv;noquote" name="@meta.name;noquote@" name="@meta.scheme;noquote@" lang="@meta.lang;noquote@" xml:lang="@meta.lang;noquote@" content="@meta.content@" /> + + lang="@link.lang;noquote@" xml:lang="@link.lang;noquote@" title="@link.title;noquote@" type="@link.type;noquote@" media="@link.media@" /> + + + +@head;noquote@ + + class="@body.class;noquote@" id="@body.id;noquote@"@event_handlers;noquote@> + + Index: openacs-4/www/blank-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/blank-master.tcl,v diff -u -N -r1.20.2.1 -r1.20.2.2 --- openacs-4/www/blank-master.tcl 19 Feb 2007 23:44:32 -0000 1.20.2.1 +++ openacs-4/www/blank-master.tcl 2 Mar 2007 16:12:35 -0000 1.20.2.2 @@ -1,134 +1,95 @@ -# /www/master-default.tcl -# -# Set basic attributes and provide the logical defaults for variables that -# aren't provided by the slave page. -# -# Author: Kevin Scaldeferri (kevin@arsdigita.com) -# Creation Date: 14 Sept 2000 -# $Id$ -# +ad_page_contract { + This is the top level master template. It allows the basic parts of an XHTML + document to be set through convenient data structures without introducing + anything site specific. -# fall back on defaults + You MUST supply the following variables: -if { [template::util::is_nil doc_type] } { - set doc_type {} -} + @property doc(title) The document title, ie. tag. + @property doc(title_lang) The language of the document title, if different + from the document language. -if { [template::util::is_nil title] } { - set title [ad_conn instance_name] -} + The document output can be customised by supplying the following variables: -#AG: Markup in <title> tags doesn't render well. -set title [ns_striphtml $title] + @property doc(type) The declared xml DOCTYPE. + @property doc(xmlns) The declared xml namespace. + @property doc(charset) The document character set. + @property body(id) The id attribute of the body tag. + @property body(class) The class of the body tag. + @property meta:multirow A multirow of <meta /> tags to render. + @property link:multirow A multirow of <link /> tags to render. + @property script:multirow A multirow of <script /> tags to render. + ad_conn -set language Must be used to override the document language + if necessary. -if { ![info exists header_stuff] } { - set header_stuff {} -} + The following event handlers can be customised by supplying the appropriate + variable. Each variable is a list of valid javascript code fragments to be + executed in order. -if { ![info exists on_load] } { - set on_load {} -} + @property body(onload) + @property body(onunload) + @property body(onclick) + @property body(ondblclick) + @property body(onmousedown) + @property body(onmouseup) + @property body(onmouseover) + @property body(onmousemove) + @property body(onmouseout) + @property body(onkeypress) + @property body(onkeydown) + @property body(onkeyup) + @author Kevin Scaldeferri (kevin@arsdigita.com) + Lee Denison (lee@xarg.co.uk) + @creation-date 14 Sept 2000 -# Attributes - -multirow create head_attribute key value -multirow append head_attribute lang [ad_conn language] -multirow append head_attribute xml:lang [ad_conn language] -multirow append head_attribute xmlns http://www.w3.org/1999/xhtml - -multirow create attribute key value -set onload $on_load - -# Handle richtext widgets, which needs special javascript and css -# in the page header - -multirow create htmlarea_support id -global acs_blank_master__htmlareas acs_blank_master - -if {[info exists acs_blank_master__htmlareas] } { - - if {[info exists acs_blank_master(rte)]} { - foreach htmlarea_id [lsort -unique $acs_blank_master__htmlareas] { - lappend onload "acs_rteInit('${htmlarea_id}');" - }} - - if {[info exists acs_blank_master(xinha)]} { - set xinha_dir /resources/acs-templating/xinha-nightly/ - set xinha_plugins $acs_blank_master(xinha.plugins) - set xinha_params "" - set xinha_options $acs_blank_master(xinha.options) - # setting language - set lang [lang::conn::language] - # if there are problems with the language definitions, set lang to "en" - if {$lang ne "en" && $lang ne "de"} {set lang en} - foreach element_id $acs_blank_master__htmlareas { - multirow append htmlarea_support $element_id - } - } + $Id$ } -if { ![template::util::is_nil focus] } { - # Handle elements where the name contains a dot - if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { - lappend onload "acs_Focus('${form_name}', '${element_name}');" - } +if {[template::util::is_nil doc(type)]} { + set doc(type) {<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">} } -if {![empty_string_p $onload]} { - multirow append attribute onload [join $onload " "] +if {[template::util::is_nil doc(xmlns)]} { + set doc(xmlns) {http://www.w3.org/1999/xhtml} } -# Additional Body Attributes - -if {[exists_and_not_null body_attributes]} { - foreach body_attribute $body_attributes { - multirow append attribute [lindex $body_attribute 0] [lindex $body_attribute 1] - } -} else { - set body_attributes "" +if {[template::util::is_nil doc(charset)]} { + set doc(charset) [ad_conn charset] } -# Header links (stylesheets, javascript) -multirow create header_links rel type href media -multirow append header_links "stylesheet" "text/css" "/resources/acs-templating/lists.css" "all" -multirow append header_links "stylesheet" "text/css" "/resources/acs-templating/forms.css" "all" -multirow append header_links "stylesheet" "text/css" "/resources/acs-subsite/default-master.css" "all" +# The document language is always set from [ad_conn lang] which by default +# returns the language setting for the current user. This is probably +# not a bad guess, but the rest of OpenACS must override this setting when +# appropriate and set the lang attribute of tags which differ from the language +# of the page. Otherwise we are lying to the browser. +set doc(lang) [ad_conn language] -# Developer-support: We include that here, so that master template authors don't have to worry about it +# AG: Markup in <title> tags doesn't render well. +set doc(title) [ns_striphtml $doc(title)] -if { [llength [info procs ::ds_show_p]] == 1 - && [ds_show_p] - } { - set developer_support_p 1 -} else { - set developer_support_p 0 +if {![template::multirow exists meta]} { + template::multirow create meta name content http_equiv scheme lang } -# dotlrn toolbar : We include that here, so that master template authors don't have to worry about it +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} -if { [llength [namespace eval :: info procs dotlrn_toolbar::show_p]] == 1 } { - multirow append header_links "stylesheet" "text/css" "/resources/dotlrn/dotlrn-toolbar.css" "all" - set dotlrn_toolbar_p 1 -} else { - set dotlrn_toolbar_p 0 +if {![template::multirow exists script]} { + template::multirow create script type src charset defer content } -set translator_mode_p [lang::util::translator_mode_p] +# Concatenate the javascript event handlers for the body tag +if {[array exists body]} { + foreach name [array names body -glob "on*"] { + append event_handlers " ${name}=\"" -set openacs_version [ad_acs_version] + foreach javascript $body($name) { + append event_handlers "[string trimright $javascript "; "]; " + } -# Toggle translator mode link - -set acs_lang_url [apm_package_url_from_key "acs-lang"] -if { [empty_string_p $acs_lang_url] } { - set lang_admin_p 0 -} else { - set lang_admin_p [permission::permission_p \ - -object_id [site_node::get_element -url $acs_lang_url -element object_id] \ - -privilege admin \ - -party_id [ad_conn untrusted_user_id]] + append event_handlers "\"" + } } -set toggle_translator_mode_url [export_vars -base "${acs_lang_url}admin/translator-mode-toggle" { { return_url [ad_return_url] } }] - Index: openacs-4/www/default-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/default-master.adp,v diff -u -N -r1.25 -r1.25.6.1 --- openacs-4/www/default-master.adp 25 Mar 2004 10:03:46 -0000 1.25 +++ openacs-4/www/default-master.adp 2 Mar 2007 16:12:35 -0000 1.25.6.1 @@ -1,15 +1,120 @@ <master src="site-master"> - <property name="title">@title;noquote@</property> - <if @header_stuff@ not nil><property name="header_stuff">@header_stuff;noquote@</property></if> - <if @context@ not nil><property name="context">@context;noquote@</property></if> - <if @context_bar@ not nil><property name="context_bar">@context_bar;noquote@</property></if> - <if @focus@ not nil><property name="focus">@focus;noquote@</property></if> - <if @doc_type@ not nil><property name="doc_type">@doc_type;noquote@</property></if> - <if @displayed_object_id@ not nil><property name="displayed_object_id">@displayed_object_id;noquote@</property></if> -<div id="page-body"> - <if @title@ not nil> - <h1 class="page-title">@title;noquote@</h1> - </if> - <slave> - <div style="clear: both;"></div> -</div> +<if @meta:rowcount@ not nil><property name="&meta">meta</property></if> +<if @link:rowcount@ not nil><property name="&link">link</property></if> +<if @script:rowcount@ not nil><property name="&script">script</property></if> +<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> +<property name="skip_link">#content-wrapper</property> + +<div id="wrapper"> + + <div id="header"> + <div class="block-marker">Begin header</div> + <div id="system-name"> + <if @system_url@ not nil><a href="@system_url@">@system_name@</a></if> + <else>@system_name@</else> + </div> + <div id="header-navigation"> + <ul class="compact"> + <li> + <if @untrusted_user_id@ ne 0>#acs-subsite.Welcome_user#</if> + <else>#acs-subsite.Not_logged_in#</else> | + </li> + <li><a href="@whos_online_url@" title="#acs-subsite.view_all_online_members#">@num_users_online@ <if @num_users_online@ eq 1>#acs-subsite.Member#</if><else>#acs-subsite.Members#</else> #acs-subsite.Online#</a></li> + <if @pvt_home_url@ not nil> + <li><a href="@pvt_home_url@" title="#acs-subsite.Change_pass_email_por#">@pvt_home_name@</a></li> + </if> + <if @login_url@ not nil> + <li><a href="@login_url@" title="#acs-subsite.Log_in_to_system#">#acs-subsite.Log_In#</a></li> + </if> + <if @logout_url@ not nil> + <li><a href="@logout_url@" title="#acs-subsite.Logout_from_system#">#acs-subsite.Logout#</a></li> + </if> + </ul> + </div> + <div id="breadcrumb"> + <if @context_bar@ not nil> + @context_bar;noquote@ + </if> + <else> + <if @context:rowcount@ not nil> + <ul class="compact"> + <multiple name="context"> + <if @context.url@ not nil> + <li><a href="@context.url@">@context.label@</a> :</li> + </if> + <else> + <li>@context.label@</li> + </else> + </multiple> + </ul> + </if> + </else> + </div> + </div> <!-- /header --> + + <div id="content-wrapper"> + <div class="block-marker">Begin main content</div> + <div id="inner-wrapper"> + + <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> + + <list name="navigation_groups"> + <div id="@navigation_groups:item@-navigation"> + <div class="block-marker">Begin @navigation_groups:item@ navigation</div> + <ul> + <multiple name="navigation"> + <if @navigation.group@ eq @navigation_groups:item@> + <li<if @navigation.id@ not nil> id="@navigation.id"</if>><a href="@navigation.href@"<if @navigation.target@ not nil> target="@navigation.target;noquote@"</if><if @navigation.class@ not nil> class="@navigation.class;noquote@"</if><if @navigation.title@ not nil> title="@navigation.title;noquote@"</if><if @navigation.lang@ not nil> lang="@navigation.lang;noquote@" xmlns:lang="@navigation.lang;noquote@"</if><if @navigation.accesskey@ not nil> accesskey="@navigation.accesskey;noquote@"</if><if @navigation.tabindex@ not nil> tabindex="@navigation.tabindex;noquote@"</if>>@navigation.label@</a></li> + </if> + </multiple> + </ul> + </div> + </list> + + <div id="main"> + <div id="main-content"> + <div class="main-content-padding"> + <h1>@title;noquote@</h1> + <slave /> + </div> + </div> + </div> + + </div> + </div> <!-- /content-wrapper --> + + <comment> + TODO: remove this and add a more systematic / package independent way + TODO of getting this content here + </comment> + <if @curriculum_bar_p@ true><include src="/packages/curriculum/lib/bar" /></if> + + <div id="footer"> + <div class="block-marker">Begin footer</div> + <div id="footer-links"> + <ul class="compact"> + <if @num_of_locales@ gt 1> + <li><a href="@change_locale_url@">#acs-subsite.Change_locale_label#</a></li> + </if> + <else> + <if @locale_admin_url@ not nil> + <li><a href="@locale_admin_url@">Install locales</a></li> + </if> + </else> + </ul> + </div> + </div> <!-- /footer --> + +</div> <!-- /wrapper --> + Index: openacs-4/www/default-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/default-master.tcl,v diff -u -N -r1.19 -r1.19.10.1 --- openacs-4/www/default-master.tcl 16 Feb 2004 14:47:41 -0000 1.19 +++ openacs-4/www/default-master.tcl 2 Mar 2007 16:12:35 -0000 1.19.10.1 @@ -1,18 +1,166 @@ -# /www/master-default.tcl +ad_page_contract { + This is the highest level site specific master template. + + @author Lee Denison (lee@xarg.co.uk) + + $Id$ +} + # -# Set basic attributes and provide the logical defaults for variables that -# aren't provided by the slave page. +# Set some basic variables # -# Author: Kevin Scaldeferri (kevin@arsdigita.com) -# Creation Date: 14 Sept 2000 -# $Id$ -# +set system_name [ad_system_name] -# fall back on defaults +if { [string equal [ad_conn url] "/"] } { + set system_url "" +} else { + set system_url [ad_url] +} -if { [template::util::is_nil title] } { +if {[template::util::is_nil title]} { + # TODO: decide how best to set the lang attribute for the title set title [ad_conn instance_name] } +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} +# +# Create standard top level navigation +# +if {![info exists navigation_groups]} { + set navigation_groups [list main sub] +} +if {![template::multirow exists navigation]} { + template::multirow create navigation \ + group \ + label \ + href \ + target \ + title \ + lang \ + accesskey \ + class \ + id \ + tabindex +} + +# +# Add standard css +# +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/acs-subsite/default-master.css" \ + "Standard OpenACS Styles" \ + en \ + "all" + +# +# User information and top level navigation links +# +set user_id [ad_conn user_id] +set untrusted_user_id [ad_conn untrusted_user_id] +set sw_admin_p 0 + +if { $untrusted_user_id == 0 } { + # The browser does NOT claim to represent a user that we know about + set login_url [ad_get_login_url -return] +} else { + # The browser claims to represent a user that we know about + set user_name [person::name -person_id $untrusted_user_id] + set pvt_home_url [ad_pvt_home] + set pvt_home_name [_ acs-subsite.Your_Account] + set logout_url [ad_get_logout_url] + + # Site-wide admin link + set admin_url {} + + set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id] + + if { $sw_admin_p } { + set admin_url "/acs-admin/" + set devhome_url "/acs-admin/developer" + set locale_admin_url "/acs-lang/admin" + } else { + set subsite_admin_p [permission::permission_p \ + -object_id [subsite::get_element -element object_id] \ + -privilege admin \ + -party_id $untrusted_user_id] + + if { $subsite_admin_p } { + set admin_url "[subsite::get_element -element url]admin/" + } + } +} + +# +# User messages +# +util_get_user_messages -multirow user_messages + +# +# Set acs-lang urls +# +set acs_lang_url [apm_package_url_from_key "acs-lang"] +set num_of_locales [llength [lang::system::get_locales]] + +if {[empty_string_p $acs_lang_url]} { + set lang_admin_p 0 +} else { + set lang_admin_p [permission::permission_p \ + -object_id [site_node::get_element \ + -url $acs_lang_url \ + -element object_id] \ + -privilege admin \ + -party_id [ad_conn untrusted_user_id]] +} + +set toggle_translator_mode_url [export_vars \ + -base ${acs_lang_url}admin/translator-mode-toggle \ + {{return_url [ad_return_url]}}] + +if { $num_of_locales > 1 } { + set change_locale_url [export_vars \ + -base $acs_lang_url \ + {{package_id [ad_conn package_id]}}] +} + +# +# Change locale link +# +if {[llength [lang::system::get_locales]] > 1} { + set change_locale_url [export_vars \ + -base "/acs-lang/" \ + [list [list package_id [ad_conn package_id]]]] +} + +# +# Who's Online +# +set num_users_online [lc_numeric [whos_online::num_users]] +set whos_online_url "[subsite::get_element -element url]shared/whos-online" + +# +# Context bar +# +if {[info exists context]} { + set context_tmp $context + unset context +} else { + set context_tmp {} +} + +ad_context_bar_multirow -- $context_tmp + +# +# Curriculum specific bar +# TODO: remove this and add a more systematic / package independent way +# TODO of getting this content here +# +set curriculum_bar_p [expr { + [site_node::get_package_url -package_key curriculum] ne "" +}] + Index: openacs-4/www/site-compat.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/site-compat.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/www/site-compat.adp 2 Mar 2007 16:12:35 -0000 1.1.2.1 @@ -0,0 +1,8 @@ +<master src="/www/site-master"> +<if @meta:rowcount@ not nil><property name="&meta">meta</property></if> +<if @link:rowcount@ not nil><property name="&link">link</property></if> +<if @script:rowcount@ not nil><property name="&script">script</property></if> +<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> +<slave /> Index: openacs-4/www/site-compat.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/site-compat.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/www/site-compat.tcl 2 Mar 2007 16:12:35 -0000 1.1.2.1 @@ -0,0 +1,26 @@ +ad_page_contract { + Accepts and translates deprecated master template variables. + Writes a warning message to the log in each case. + + @author Lee Denison (lee@xarg.co.uk) + @creation-date: 2007-02-18 + + $Id: site-compat.tcl,v 1.1.2.1 2007/03/02 16:12:35 leed Exp $ +} + +if {![array exists doc]} { + array set doc [list] +} + +set translations [list \ + doc_type doc(type) \ + header_stuff head \ + on_load body(onload) \ +] + +foreach {from to} $translations { + if {[info exists $from]} { + ns_log warning "site-compat: [ad_conn file] uses deprecated property $from instead of $to." + set $to [set $from] + } +} Index: openacs-4/www/site-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/site-master.adp,v diff -u -N -r1.26 -r1.26.2.1 --- openacs-4/www/site-master.adp 6 Aug 2006 20:57:31 -0000 1.26 +++ openacs-4/www/site-master.adp 2 Mar 2007 16:12:35 -0000 1.26.2.1 @@ -1,119 +1,69 @@ <master src="/www/blank-master"> - <if @title@ not nil> - <property name="title">@title;noquote@</property> - </if> - <if @signatory@ not nil> - <property name="signatory">@signatory;noquote@</property> - </if> - <if @focus@ not nil> - <property name="focus">@focus;noquote@</property> - </if> - <property name="header_stuff"> - <link rel="stylesheet" type="text/css" href="@css_url@" media="all"> - @header_stuff;noquote@ - @extra_headers;noquote@ - </property> - <property name="on_load"> - @on_load;noquote@@callback_on_load;noquote@ - </property> +<if @meta:rowcount@ not nil><property name="&meta">meta</property></if> +<if @link:rowcount@ not nil><property name="&link">link</property></if> +<if @script:rowcount@ not nil><property name="&script">script</property></if> +<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 @acs_blank_master.rte@ not nil and @acs_blank_master__htmlareas@ not nil> +<script language="JavaScript" type="text/javascript"> +<!-- + initRTE("/resources/acs-templating/rte/images/", + "/resources/acs-templating/rte/", + "/resources/acs-templating/rte/rte.css"); +// --> +</script> +</if> +<if @acs_blank_master.xinha@ not nil and @acs_blank_master__htmlareas@ not nil> +<script type="text/javascript"> +<!-- + xinha_editors = null; + xinha_init = null; + xinha_config = null; + xinha_plugins = null; + xinha_init = xinha_init ? xinha_init : function() { + xinha_plugins = xinha_plugins ? xinha_plugins : [@xinha_plugins;noquote@]; + // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING :) + if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return; + xinha_editors = xinha_editors ? xinha_editors : + [ + <list name="acs_blank_master__htmlareas"> + '@htmlarea_support.id@'<if @acs_blank_master__htmlareas:rownum@ ne @acs_blank_master__htmlareas:rowcount@>,</if> + </list> + ]; + xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config(); + @xinha_params;noquote@ + @xinha_options;noquote@ + xinha_editors = + HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins); + HTMLArea.startEditors(xinha_editors); + } + window.onload = xinha_init; +// --> +</script> +</if> -<!-- Header --> +<if @skip_link@ not nil><div id="skiptocontent"><a href="@skip_link;noquote@" title="#acs-subsite.skip_to_content#" accesskey="#acs-subsite.skiptocontent_accesskey#">#acs-subsite.skip_to_content#</a></div></if> +<if @acs_blank_master__htmlareas@ not nil><textarea id="holdtext" style="display: none;" rows="1" cols="1"></textarea></if> -<div id="site-header"> - <div class="system-name"> - <if @system_url@ not nil><a href="@system_url@">@system_name@</a></if> - <else>@system_name@</else> - </div> +<comment> + TODO: remove this and add a more systematic / package independent way + TODO of getting this content here +</comment> +<if @dotlrn_toolbar_p@ true><include src="/packages/dotlrn/lib/toolbar"></if> - <div class="action-list permanent-navigation"> - <ul> - <if @admin_url@ not nil> - <span id="oacs-admin-url"><li><a href="@admin_url@" title="#acs-subsite.Site_wide_administration#">#acs-subsite.Admin#</a></li></span> - </if> - <if @pvt_home_url@ not nil> - <li><a href="@pvt_home_url@" title="#acs-subsite.Change_pass_email_por#">@pvt_home_name@</a></li> - </if> - <if @login_url@ not nil> - <li><a href="@login_url@" title="#acs-subsite.Log_in_to_system#">#acs-subsite.Log_In#</a></li> - </if> - <if @logout_url@ not nil> - <li><a href="@logout_url@" title="#acs-subsite.Logout_from_system#">#acs-subsite.Logout#</a></li> - </if> - </ul> - </div> +<if @developer_support_p@ true> + <include src="/packages/acs-developer-support/lib/toolbar"> +</if> - <div class="action-list users-online"> - <ul> - <li><a href="@whos_online_url@">@num_users_online@ <if @num_users_online@ eq 1>#acs-subsite.Member#</if><else>#acs-subsite.Members#</else> #acs-subsite.Online#</a></li> - </ul> - </div> +<slave /> - <div class="user-greeting"> - <if @untrusted_user_id@ ne 0> - #acs-subsite.Welcome_user# - </if> - <else> - #acs-subsite.Not_logged_in# - </else> - </div> - -</div> - -<if @user_messages:rowcount@ gt 0> - <div id="user-message"> - <ul> - <multiple name="user_messages"> - <li>@user_messages.message;noquote@</li> - </multiple> - </ul> - </div> +<if @developer_support_p@ true> + <include src="/packages/acs-developer-support/lib/footer"> </if> -<div id="context-bar"> - <if @context_bar@ not nil> - <div class="breadcrumbs">@context_bar;noquote@</div> - </if> - <else> - <if @context:rowcount@ not nil> - <div class="breadcrumbs"> - <ul> - <multiple name="context"> - <if @context.url@ not nil> - <li><a href="@context.url@">@context.label@</a> »</li> - </if> - <else> - <li>@context.label@</li> - </else> - </multiple> - </ul> - </div> - </if> - </else> - <div id="navlinks">@subnavbar_link;noquote@</div> - <div style="clear: both;"></div> -</div> - -<slave> - -<div id="site-footer"> - <div class="action-list"> - <if @num_of_locales@ gt 1> - <ul> - <li><a href="@change_locale_url@">#acs-subsite.Change_locale_label#</a></li> - </ul> - </if> - <else> - <if @locale_admin_url@ not nil> - <ul> - <li><a href="@locale_admin_url@">Install locales</a></li> - </ul> - </if> - </else> - </div> -</div> - -<if @curriculum_bar_p@ true> - <p><include src="/packages/curriculum/lib/bar" /> +<if @translator_mode_p@ true> + <include src="/packages/acs-lang/lib/messages-to-translate"> </if> Index: openacs-4/www/site-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/site-master.tcl,v diff -u -N -r1.22 -r1.22.2.1 --- openacs-4/www/site-master.tcl 13 Jul 2006 04:06:42 -0000 1.22 +++ openacs-4/www/site-master.tcl 2 Mar 2007 16:12:35 -0000 1.22.2.1 @@ -1,108 +1,183 @@ -# Expects properties: -# title -# focus -# header_stuff -# section -# on_load (expects funtion_name(params);) +ad_page_contract { + This is the highest level site specific master template. -if { ![info exists section] } { - set section {} + @author Lee Denison (lee@xarg.co.uk) + + $Id$ } -if { ![info exists header_stuff] } { - set header_stuff {} +if {![info exists doc(title)] || $doc(title) eq ""} { + set doc(title) [ad_conn instance_name] + + # There is no way to determine the language of instance_name so we guess + # that it is the same as the site wide locale setting - if not this must + # be overridden + set doc(title_lang) [lindex [split [lang::system::site_wide_locale] _] 0] } -if { ![info exists on_load] } { - set on_load {} +if {![info exists body(onload)]} { + set body(onload) [list] } -if { [template::util::is_nil subnavbar_link] } { - set subnavbar_link "" +if {![template::multirow exists meta]} { + template::multirow create meta name content http_equiv scheme lang } -# Where to find the stylesheet -set css_url "/resources/acs-subsite/site-master.css" +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} -# Get system name -set system_name [ad_system_name] -set system_url [ad_url] -if { [string equal [ad_conn url] "/"] } { - set system_url "" +if {![template::multirow exists script]} { + template::multirow create script type src charset defer content } -# Get user information -set sw_admin_p 0 -set user_id [ad_conn user_id] -set untrusted_user_id [ad_conn untrusted_user_id] -if { $untrusted_user_id != 0 } { - set user_name [person::name -person_id $untrusted_user_id] - set pvt_home_url [ad_pvt_home] - set pvt_home_name [_ acs-subsite.Your_Account] - set logout_url [ad_get_logout_url] +# +# Add standard meta tags +# +template::multirow append meta \ + generator \ + "OpenACS version [ad_acs_version]" \ + {} \ + {} \ + en + +# +# Add standard css +# +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/acs-templating/lists.css" \ + "Standard List Styles" \ + en \ + "all" - # Site-wide admin link - set admin_url {} +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/acs-templating/forms.css" \ + "Standard Form Styles" \ + en \ + "all" - set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id] +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/acs-subsite/site-master.css" \ + "Standard OpenACS Styles" \ + en \ + "all" - if { $sw_admin_p } { - set admin_url "/acs-admin/" - set devhome_url "/acs-admin/developer" - set locale_admin_url "/acs-lang/admin" - } else { - set subsite_admin_p [permission::permission_p \ - -object_id [subsite::get_element -element object_id] \ - -privilege admin \ - -party_id $untrusted_user_id] +# +# Add standard javascript +# +template::multirow append script \ + "text/javascript" \ + "/resources/acs-subsite/core.js" - if { $subsite_admin_p } { - set admin_url "[subsite::get_element -element url]admin/" - } +# +# Process focus variable in onload +# +if { ![template::util::is_nil focus] } { + # Handle elements where the name contains a dot + if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { + lappend body(onload) "acs_Focus('${form_name}', '${element_name}');" } -} - -if { $untrusted_user_id == 0 } { - set login_url [ad_get_login_url -return] } -# Context bar -if { [info exists context] } { - set context_tmp $context - unset context -} else { - set context_tmp {} -} -ad_context_bar_multirow -- $context_tmp +# +# Fire subsite callbacks to get header content +# +# TODO: LJD - these callbacks should append to the relevant multirows to ensure +# TODO accessibility standards compliant output +# +append head [join [callback subsite::get_extra_headers] "\n"] +set body(onload) [concat $body(onload) [callback subsite::header_onload]] +# +# Add WYSIWYG editor content +# +global acs_blank_master__htmlareas acs_blank_master -# change locale -set num_of_locales [llength [lang::system::get_locales]] -if { $num_of_locales > 1 } { - set change_locale_url \ - "/acs-lang/?[export_vars { { package_id "[ad_conn package_id]" } }]" -} +if {[info exists acs_blank_master__htmlareas] + && [llength $acs_blank_master__htmlareas] > 0} { + + # + # Add RTE scripts if we are using RTE + # + if {[info exists acs_blank_master(rte)]} { + foreach htmlarea_id [lsort -unique $acs_blank_master__htmlareas] { + lappend body(onload) "acs_rteInit('${htmlarea_id}')" + } -# Curriculum bar -if { [empty_string_p [site_node::get_package_url -package_key curriculum]] } { - set curriculum_bar_p 0 -} else { - set curriculum_bar_p 1 -} + template::multirow append script \ + "text/javascript" \ + "/resources/acs-templating/rte/richtext.js" + } -# Who's Online -set num_users_online [lc_numeric [whos_online::num_users]] + # + # Add Xinha scripts if we are using Xinha + # + if {[info exists acs_blank_master(xinha)]} { + set xinha_dir /resources/acs-templating/xinha-nightly/ + set xinha_plugins $acs_blank_master(xinha.plugins) + set xinha_params "" + set xinha_options $acs_blank_master(xinha.options) + set xinha_lang [lang::conn::language] -set whos_online_url "[subsite::get_element -element url]shared/whos-online" + if {$xinha_lang ne "en" && $xinha_lang ne "de"} { + set xinha_lang en + } + template::multirow append script "text/javasctipt" {} {} {} " + __editor_url = \"$xinha_dir\"; + __editor_lang = \"$xinha_lang\"; + " -#---------------------------------------------------------------------- -# Display user messages -#---------------------------------------------------------------------- + template::multirow append script \ + "text/javascript" \ + "${xinha_dir}htmlarea.js" + } +} -util_get_user_messages -multirow "user_messages" +# +# Determine if we should be displaying the translation UI +# +set translator_mode_p [lang::util::translator_mode_p] -set extra_headers "" -set extra_headers [join [callback subsite::get_extra_headers] " \n "] -set callback_on_load [callback subsite::header_onload] +# +# Determine whether developer support is installed and enabled +# +set developer_support_p [expr { + [llength [info procs ::ds_show_p]] == 1 && [ds_show_p] +}] +if {$developer_support_p} { + template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/acs-developer-support/acs-developer-support.css" \ + "Developer Support Styles" \ + en \ + "all" +} + +# +# dotLRN specific toolbar +# TODO: remove this and add a more systematic / package independent way +# TODO of getting this content here +# +set dotlrn_toolbar_p [expr { + [llength [namespace eval :: info procs dotlrn_toolbar::show_p]] == 1 +}] + +if {$dotlrn_toolbar_p} { + template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/dotlrn/dotlrn-toolbar.css" \ + "dotLRN Toolbar Styles" \ + en \ + "all" +} +