Index: openacs-4/packages/theme-selva/tcl/selva-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/tcl/selva-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/theme-selva/tcl/selva-procs.tcl 26 Jul 2005 14:28:29 -0000 1.1 +++ openacs-4/packages/theme-selva/tcl/selva-procs.tcl 27 Jul 2005 20:10:03 -0000 1.2 @@ -1,13 +1,18 @@ +# # 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. +# # tcl/portal-procs.tcl @@ -18,149 +23,128 @@ @author Jeremy Monnet (jmonnet@gmail.com) @creation-date June 2005 @version $Id$ + } namespace eval selva { - ad_proc -public portal_navbar { + ad_proc -public portal_navbar { {-user_id:required} - {-link_control_panel:required} + {-link_control_panel:required} {-control_panel_text:required} {-link_all 0} {-pre_html ""} {-post_html ""} } { - A helper procedure that generates the PORTAL navbar (the thing with the portal pages on it) for dotlrn. It is called from the + A helper procedure that generates the PORTAL navbar (the thing + with the portal pages on it) for dotlrn. It is called from the dotlrn-master template } { - - set dotlrn_url [dotlrn::get_url] + + set dotlrn_url [dotlrn::get_url] set community_id [dotlrn_community::get_community_id] set control_panel_name control-panel set control_panel_url "$dotlrn_url/$control_panel_name" - - if {[empty_string_p $community_id]} { - + + 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 - set link "[dotlrn::get_url]/" - - 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] + + 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 { - # not a dotlrn user, so no user portal to show - set portal_id {} set show_control_panel 0 } - } 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] + } 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 - - # link is important : it sets the options_set value, which - # will be used later to select the current page - + # link is important : it sets the options_set value, which will be used later to select the current page set link [dotlrn_community::get_community_url $community_id] set control_panel_url "$link/$control_panel_name" - # figure out what this privs this user has on the community - + # 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? - + -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_id] set show_control_panel 0 } else { - - # admins always get the control_panel_link, unless - # it's explictly turned off - + # admins always get the control_panel_link, unless it's + # explictly turned off set show_control_panel 1 } - - if {$admin_p - || $member_p} { - - set portal_id [dotlrn_community::get_portal_id \ - -community_id $community_id - ] + + 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 - ] + -community_id $community_id + ] } } - #AG: This code belongs in the portal package, near portal::navbar. - #AFor display reasons we need to do this s a ul instead of a table, - #Awhich portal::navbar returns. Obviously we shouldn't be letting - #Adisplay-level #stuff decide where we put our code, but first we'll - #Aneed to mod the portal package accordingly. + #AG: This code belongs in the portal package, near portal::navbar. For display reasons we need to do this + #as a ul instead of a table, which portal::navbar returns. Obviously we shouldn't be letting display-level + #stuff decide where we put our code, but first we'll need to mod the portal package accordingly. set page_num [ns_queryget page_num] - - #Strip out extra anchors and other crud. #page_num will be - #Sempty_string for special pages like #My Space and Control - #SPanel - + #Strip out extra anchors and other crud. + #page_num will be empty_string for special pages like + #My Space and Control Panel regsub -all {[^0-9]} $page_num {} page_num - + set navbar "<ul>\n" - + db_foreach list_page_nums_select {} { - if {("$dotlrn_url/" == [ad_conn url] - || "$dotlrn_url/index" == [ad_conn url]) && $sort_key == 0 && $page_num == ""} { - - # active tab is first tab and page_num may be "" - + if { ("$dotlrn_url/" == [ad_conn url] || "$dotlrn_url/index" == [ad_conn url]) && $sort_key == 0 && $page_num == ""} { + # active tab is first tab and page_num may be "" append navbar "\n<li class=\"current\"><a href=\"#\">$pretty_name</a></li>" - } elseif {$page_num == $sort_key} { + } elseif {$page_num == $sort_key} { + # We are looking at the active tab + append navbar "\n<li class=\"current\"><a href=\"#\">$pretty_name</a></li>" + } else { + append navbar "\n<li><a href=\"$link?page_num=$sort_key\">$pretty_name</a> </li>" + } + } - # We are looking at the active tab + # + # Common code for the the behavior of the control panel link (class administration + # or my account) + # - append navbar "\n<li class=\"current\"><a href=\"#\">$pretty_name</a></li>" - } else { - append navbar "\n<li><a href=\"$link?page_num=$sort_key\">$pretty_name</a> </li>" - } - } + if {$show_control_panel} { + if {$link_control_panel} { + append navbar "<li><a href=\"$control_panel_url\">$control_panel_text</a></li>" - # Common code for the the behavior of the control panel link - # (class administration or my account) + } else { + append navbar "<li class=\"current\"><a href=\"#\">$control_panel_text</a></li>" + } + } - if {$show_control_panel} { - if {$link_control_panel} { - append navbar "<li><a href=\"$control_panel_url\">$control_panel_text</a></li>" - } else { - append navbar "<li class=\"current\"><a href=\"#\">$control_panel_text</a></li>" - } - } - append navbar "</ul>" + } + } \ No newline at end of file Index: openacs-4/packages/theme-selva/www/selva-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/www/selva-master.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/theme-selva/www/selva-master.adp 26 Jul 2005 16:40:51 -0000 1.3 +++ openacs-4/packages/theme-selva/www/selva-master.adp 27 Jul 2005 20:10:03 -0000 1.4 @@ -1,29 +1,32 @@ -<master src="/packages/theme-selva/www/selva-site-master" /> +<master src="/packages/theme-selva/www/selva-site-master"> <property name="header_stuff"> - @header_stuff;noquote@ + @header_stuff;noquote@ </property> <if @context@ not nil><property name="context">@context;noquote@</property></if> <else><if @context_bar@ not nil><property name="context_bar">@context_bar;noquote@</property></if></else> <if @focus@ not nil><property name="focus">@focus;noquote@</property></if> - <if @title@ not nil><property name="title">@title;noquote@</property></if> <if @doc_type@ not nil><property name="doc_type">@doc_type;noquote@</property></if> - <br /> + <br> <div id="portal-navigation"> - <if @subnavbar@ not nil>@subnavbar;noquote@</if> +<if @subnavbar@ not nil>@subnavbar;noquote@</if> </div> <!-- end of portal-navigation--> -<if navbar ne ""> - <div id="portal-subnavigation"> + +<div id="portal-subnavigation"> <div id="portal-subnavigation-links"> - <if @navbar@ not nil>@navbar;noquote@</if> + <if @navbar@ not nil>@navbar;noquote@</if> </div> + </div> - </if> - <div id="portal"> -<if @in_dotlrn_p@ ne 1><h3 align="center">@title;noquote@</h3></if> -<slave> - <div style="clear: both;"></div> - </div> + +<div id="portal"> + + + <slave> + <div style="clear: both;"></div> +</div> + <div id="portal-bottom"></div> + <div id="footer"> <a href="http://www.dotlrn.org">.LRN Home</a> | <a href="http://www.openacs.org/projects/dotlrn">.LRN Project Central</a> Index: openacs-4/packages/theme-selva/www/selva-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/www/selva-master.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/theme-selva/www/selva-master.tcl 27 Jul 2005 11:54:04 -0000 1.4 +++ openacs-4/packages/theme-selva/www/selva-master.tcl 27 Jul 2005 20:10:03 -0000 1.5 @@ -41,6 +41,7 @@ # Author: Arjun Sanyal (arjun@openforce.net), yon@openforce.net # # $Id$ + set user_id [ad_get_user_id] set community_id [dotlrn_community::get_community_id] set dotlrn_url [dotlrn::get_url] @@ -49,8 +50,6 @@ set in_dotlrn_p [expr [string match "[dotlrn::get_url]/*" [ad_conn url]]] - - #Scope Related graphics/css parameters # Set everything for user level scope as default then modify it later as we refine the scope. set scope_name "user" @@ -312,6 +311,7 @@ } set extra_spaces "<img src=\"/resources/dotlrn/spacer.gif\" border=0 width=15>" #set subnavbar [selva::portal_navbar] + if {$in_dotlrn_p == 1} { set navbar "<ul>" set navbar [selva::portal_navbar \ @@ -340,31 +340,12 @@ } } - set subnavbar "<ul>" - - if {[exists_and_not_null community_id]} { - append subnavbar "<li><a href=\"\"><b>[dotlrn_community::get_community_name $community_id]</b></a></li>" - } - set untrusted_user_id [ad_conn untrusted_user_id] - if { $untrusted_user_id != 0 } { - set logout_url [ad_get_logout_url] - } else { - set login_url [ad_get_login_url -return] - } - - append subnavbar " <li><a href=\"/dotlrn/\">[_ dotlrn.My_Workspace]</a></li> - <li><a href=\"/contacts\">[_ contacts.Contacts]</a></li> - <li><a href=\"/pvt/home\">[_ dotlrn.Preferences]</a></li> - <li><a href=\"/dotlrn/control-panel\">[_ dotlrn.control_panel]</a></li> -" - - set system_name [ad_system_name] - if {[exists_and_not_null logout_url]} { - append subnavbar "<li><a href=\"$logout_url\" title=\"#acs-subsite.Logout_from_system#\">#acs-subsite.Logout#</a></li>" - } else { - append subnavbar "<li><a href=\"$login_url\" title=\"#acs-subsite.Log_in_to_system#\">#acs-subsite.Log_In#</a></li>" - } - append subnavbar "</ul>" + set subnavbar "<ul> + <li><a href=\"/dotlrn/\">My Workspace</a></li> + <li><a href=\"/dotlrn/?&page%5fnum=3\">Courses</a></li> + <li><a href=\"/pvt/home\">Preferences</a></li> + <li><a href=\"/dotlrn/control-panel\">Control Panel</a></li> +</ul>" } else { set navbar " " Index: openacs-4/packages/theme-selva/www/selva-site-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/www/selva-site-master.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/theme-selva/www/selva-site-master.adp 26 Jul 2005 16:37:51 -0000 1.3 +++ openacs-4/packages/theme-selva/www/selva-site-master.adp 27 Jul 2005 20:10:03 -0000 1.4 @@ -1,64 +1,123 @@ -<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="shortcut icon" href="/resources/theme-selva/Selva/default/images/myicon.ico"> +<master src="/packages/theme-selva/www/selva-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="shortcut icon" href="/resources/theme-selva/Selva/default/images/myicon.ico"> <link rel="stylesheet" type="text/css" href="@css_url@" media="all"> - @header_stuff;noquote@ + + @header_stuff;noquote@ </property> + + +<div id="wrapper"> + +<!-- header (contains logo) --> +<div id="header"> +<img src="/resources/theme-selva/Selva/default/images/logo.gif"> +</div> +<!-- Header --> + +<div id="site-header"> + +<div id="breadcrumbs"> +<!-- displays "you are here" --> +<div id="context-bar"> + <if @context_bar@ not nil> + <div id="breadcrumbs">@context_bar;noquote@</div> + </if> + <else> + <if @context:rowcount@ not nil> + <multiple name="context"> + <if @context.url@ not nil> + <a href="@context.url@">@context.label@</a> » + </if> + <else> + @context.label@ + </else> + </multiple> + </if> + </else> + <div id="navlinks">@subnavbar_link;noquote@</div> + <div style="clear: both;"></div> +</div> + +<div id="status"> +<!-- memebers online --> +<div class="action-list users-online"> + <a href="@whos_online_url@">@num_users_online@ <if @num_users_online@ eq 1>member</if><else>members</else> online</a> + </div> + +<!-- small menu --> + <div class="action-list permanent-navigation"> + <if @admin_url@ not nil> + <a href="@admin_url@" title="#acs-subsite.Site_wide_administration#">#acs-subsite.Admin#</a> + </if> + <if @pvt_home_url@ not nil> + <a href="@pvt_home_url@" title="#acs-subsite.Change_pass_email_por#">@pvt_home_name@</a> + </if> + <if @login_url@ not nil> + <a href="@login_url@" title="#acs-subsite.Log_in_to_system#">#acs-subsite.Log_In#</a> + </if> + <if @logout_url@ not nil> + <a href="@logout_url@" title="#acs-subsite.Logout_from_system#">#acs-subsite.Logout#</a> + </if> + </div> + +<!-- user greeting --> +<div class="user-greeting"> + <if @untrusted_user_id@ ne 0> + #acs-subsite.Welcome_user# + </if> + <else> + #acs-subsite.Not_logged_in# + </else> + </div> + + +</div> <!-- end of status --> + </div> <!-- end of breadcrumbs --> + + + + +</div> + <if @user_messages:rowcount@ gt 0> <div id="user-message"> <ul> <multiple name="user_messages"> - <li>@user_messages.message;noquote@</li> + <li>@user_messages.message;noquote@</li> </multiple> </ul> </div> </if> -<div id="breadcrumbs"> - <!-- displays "you are here" --> - <div id="context-bar"> - <if @context_bar@ not nil> - <div id="breadcrumbs">@context_bar;noquote@</div> - </if> - <else> - <if @context:rowcount@ not nil> - <multiple name="context"> - <if @context.url@ not nil> - <a href="@context.url@">@context.label@</a> » - </if> - <else> - @context.label@ - </else> - </multiple> + + + +<slave> + +<div id="footer"> + <div class="action-list"> + <if @num_of_locales@ gt 1> + <a href="@change_locale_url@">#acs-subsite.Change_locale_label#</a> </if> - </else> + <else> + <if @locale_admin_url@ not nil> + <a href="@locale_admin_url@">Install locales</a> + </if> + </else> + <a href="/doc/theme-selva/">Documentation on this theme</a> </div> - <slave> - <div id="footer"> - <div class="action-list"> - <if @num_of_locales@ gt 1> - <a href="@change_locale_url@">#acs-subsite.Change_locale_label#</a> - </if> - <else> - <if @locale_admin_url@ not nil> - <a href="@locale_admin_url@">Install locales</a> - </if> - </else> - <a href="/doc/theme-selva/">Documentation on this theme</a> - </div> - </div> - <if @curriculum_bar_p@ true> - <p> - <include - src="/packages/curriculum/lib/bar" /> - </if> - </div> - <!-- end of wrapper --> \ No newline at end of file +</div> + +<if @curriculum_bar_p@ true> + <p><include src="/packages/curriculum/lib/bar" /> +</if> +</div> <!-- end of wrapper --> \ No newline at end of file