Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v
diff -u -r1.140 -r1.141
--- openacs-4/packages/dotlrn/tcl/community-procs.tcl 31 May 2002 21:56:49 -0000 1.140
+++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 3 Jun 2002 20:59:48 -0000 1.141
@@ -1945,6 +1945,48 @@
util_memoize_flush "dotlrn_community::get_attributes_not_cached -community_id $community_id"
}
+ ad_proc -public unset_attribute {
+ {-community_id ""}
+ {-attribute_name:required}
+ } {
+ ussets an attribute of this community
+ } {
+ # this is serious, we are trying to unset an attribute that doesn't
+ # exist
+ set attribute_id [get_attribute_id -attribute_name $attribute_name]
+ if {[empty_string_p $attribute_id]} {
+ error "dotlrn_community::set_attribute: invalid attribute $attribute_name"
+ }
+
+ # we don't accept empty values (essentially, we are making the
+ # acs_attribute_values.attr_value not null, which it is not in the db).
+ if {[empty_string_p $attribute_value]} {
+ return
+ }
+
+ if {[empty_string_p $community_id]} {
+ set community_id [get_community_id]
+ }
+
+ # remove the row
+ db_dml delete_attribute_value {}
+
+ util_memoize_flush \
+ "dotlrn_community::get_attributes_not_cached -community_id $community_id"
+ }
+
+ ad_proc -public unset_attributes {
+ {-community_id ""}
+ {-attribute_name:required}
+ } {
+ ussets all the attributes of this community
+ } {
+ db_dml delete_attributes {}
+
+ util_memoize_flush \
+ "dotlrn_community::get_attributes_not_cached -community_id $community_id"
+ }
+
ad_proc -public get_attribute_id {
{-attribute_name:required}
} {
Index: openacs-4/packages/dotlrn/tcl/community-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v
diff -u -r1.67 -r1.68
--- openacs-4/packages/dotlrn/tcl/community-procs.xql 31 May 2002 21:56:49 -0000 1.67
+++ openacs-4/packages/dotlrn/tcl/community-procs.xql 3 Jun 2002 20:59:48 -0000 1.68
@@ -553,4 +553,19 @@
+
+
+ delete from acs_attribute_values
+ where attribute_id = :attribute_id
+ and object_id = :community_id
+
+
+
+
+
+ delete from acs_attribute_values
+ where object_id = :community_id
+
+
+
Index: openacs-4/packages/dotlrn/www/community-edit-revert.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-revert.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/community-edit-revert.tcl 3 Jun 2002 21:00:19 -0000 1.1
@@ -0,0 +1,34 @@
+#
+# 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 {
+
+ Revert the properties for a community
+
+ @author arjun@openforce.net
+ @version $Id: community-edit-revert.tcl,v 1.1 2002/06/03 21:00:19 arjun Exp $
+
+} -query {
+ {referer "community-edit"}
+}
+
+set user_id [ad_conn user_id]
+set community_id [dotlrn_community::get_community_id]
+dotlrn::require_user_admin_community -user_id $user_id $community_id
+
+# blow way all the attributes
+dotlrn_community::unset_attributes \
+ -community_id $community_id
Index: openacs-4/packages/dotlrn/www/community-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn/www/community-edit.adp 3 Jun 2002 07:39:00 -0000 1.2
+++ openacs-4/packages/dotlrn/www/community-edit.adp 3 Jun 2002 20:59:48 -0000 1.3
@@ -72,3 +72,5 @@
+
+[Revert all properties to defaults
Index: openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/dotlrn-default-master.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl 3 Jun 2002 07:39:00 -0000 1.10
+++ openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl 3 Jun 2002 20:59:48 -0000 1.11
@@ -158,7 +158,6 @@
} else {
# we could be anywhere (maybe under /dotlrn, maybe not)
set link "[dotlrn::get_url]/"
- set link_all 0
set community_id ""
set text ""
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.3 -r1.4
--- openacs-4/packages/dotlrn/www/dotlrn-master.adp 16 Apr 2002 13:53:52 -0000 1.3
+++ openacs-4/packages/dotlrn/www/dotlrn-master.adp 3 Jun 2002 20:59:48 -0000 1.4
@@ -19,4 +19,37 @@
%>
+
+
+
+
+
+ @title@
+
+
+
+ @link_all@
+
+
+
+ @return_url@
+
+
+
+ @show_control_panel@
+
+
+
+ @link_control_panel@
+
+
+
+ @no_navbar_p@
+
+
+
+ @portal_id@
+
+
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.17 -r1.18
--- openacs-4/packages/dotlrn/www/one-community.adp 29 Mar 2002 19:14:46 -0000 1.17
+++ openacs-4/packages/dotlrn/www/one-community.adp 3 Jun 2002 20:59:48 -0000 1.18
@@ -19,7 +19,6 @@
%>
-@pretext@
@portal_id@
@admin_p@
Index: openacs-4/packages/dotlrn/www/one-community.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.tcl,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/dotlrn/www/one-community.tcl 21 May 2002 17:30:02 -0000 1.27
+++ openacs-4/packages/dotlrn/www/one-community.tcl 3 Jun 2002 20:59:48 -0000 1.28
@@ -40,16 +40,6 @@
$community_id
]
-# are we in a subcomm? if so, we need to set up the text and navbar
-set pretext ""
-set parent_id [dotlrn_community::get_parent_id \
- -community_id $community_id]
-
-if {![empty_string_p $parent_id]} {
- set parent_name [dotlrn_community::get_community_name $parent_id]
- set pretext "$parent_name : "
-}
-
# Check that this user is a member
if {![dotlrn_community::member_p $community_id $user_id] && !$admin_p} {
set context_bar [list "Not a member"]