Index: openacs-4/contrib/packages/portal/tcl/element-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/element-procs.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/portal/tcl/element-procs.xql 8 Jan 2004 02:12:19 -0000 1.2
+++ openacs-4/contrib/packages/portal/tcl/element-procs.xql 13 Jan 2004 02:23:05 -0000 1.3
@@ -61,7 +61,7 @@
name = :name,
page_id = :page_id,
region = :region,
- sort_key = :sortkey,
+ sort_key = :sort_key,
state = :state
where element_id = :element_id
Index: openacs-4/contrib/packages/portal/tcl/portal-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/portal/tcl/portal-procs-oracle.xql 25 Oct 2002 21:29:17 -0000 1.1
+++ openacs-4/contrib/packages/portal/tcl/portal-procs-oracle.xql 13 Jan 2004 02:23:05 -0000 1.2
@@ -11,19 +11,4 @@
-
-
- update portal_elements
- set region = :region,
- page_id = :page_id,
- sort_key = (select nvl((select max(sort_key) + 1
- from portal_elements
- where page_id = :page_id
- and region = :region),
- 1)
- from dual)
- where element_id = :element_id
-
-
-
Index: openacs-4/contrib/packages/portal/tcl/portal-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs-postgresql.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/contrib/packages/portal/tcl/portal-procs-postgresql.xql 25 Oct 2002 21:29:17 -0000 1.1
+++ openacs-4/contrib/packages/portal/tcl/portal-procs-postgresql.xql 13 Jan 2004 02:23:05 -0000 1.2
@@ -9,19 +9,4 @@
-
-
- update portal_elements
- set region = :region,
- page_id = :page_id,
- sort_key = (select coalesce((select max(sort_key) + 1
- from portal_elements
- where page_id = :page_id
- and region = :region),
- 1)
- from dual)
- where element_id = :element_id
-
-
-
Index: openacs-4/contrib/packages/portal/tcl/portal-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 11 Jan 2004 01:08:00 -0000 1.5
+++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 13 Jan 2004 02:23:05 -0000 1.6
@@ -379,6 +379,14 @@
# Per-page template chunks
#
+ set show_avail_p 0
+ set show_html "\n"
+
set list_of_page_ids [get_page_list -portal_id $portal_id]
foreach page_id $list_of_page_ids {
@@ -406,6 +414,21 @@
"
append template "$page_name_chunk"
+ if { $show_avail_p } {
+ set show_html_form "
+
"
+ } else {
+ set show_html_form ""
+ }
+
if {[portal::page::has_visible_elements -page_id $page_id] || $first_page_p} {
#
@@ -438,10 +461,9 @@
return_url=\"@return_url@\" element_src=\"@element_src@\"
page_id=$page_id
layout_id=$portal(layout_id)
- edit_p=@edit_p@>
- "
-ns_log Notice "Huh? $template"
+ edit_p=@edit_p@>\n"
}
+ append template "$show_html_form\n"
# clear out the region array
array unset fake_element_ids
@@ -659,14 +681,14 @@
-direction [ns_set get $form direction]
}
"Show Here" {
- set region [ns_set get $form region]
- set element_id [ns_set get $form element_id]
- set page_id [ns_set get $form page_id]
-
db_transaction {
- # The new element's sk will be the last in the region
- db_dml show_here_update_sk {}
- db_dml show_here_update_state {}
+ portal::element::move_to_page \
+ -page_id [ns_set get $form page_id] \
+ -element_id [ns_set get $form element_id] \
+ -region 1
+ portal::element::set_state \
+ -element_id [ns_set get $form element_id] \
+ -state full
}
}
"Move to page" {
@@ -955,4 +977,14 @@
append html " \n\n"
}
+ ad_proc -private hidden_elements_list {
+ {-portal_id:required}
+ } {
+ Returns a list of "hidden" element avaliable to a portal. The new-portals code cached
+ this list for a second but there's not point in doing so, folks don't edit their
+ portals very often ...
+ } {
+ return [db_list_of_lists select_hidden_elements {}]
+ }
+
}
Index: openacs-4/contrib/packages/portal/tcl/portal-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/portal-procs.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/contrib/packages/portal/tcl/portal-procs.xql 3 Jan 2004 01:42:57 -0000 1.2
+++ openacs-4/contrib/packages/portal/tcl/portal-procs.xql 13 Jan 2004 02:23:05 -0000 1.3
@@ -87,14 +87,6 @@
-
-
- update portal_elements
- set state = 'full'
- where element_id = :element_id
-
-
-
update portal_elements
@@ -228,4 +220,16 @@
+
+
+ select element_id,
+ pe.name
+ from portal_elements pe, portal_pages pp
+ where pp.portal_id = :portal_id
+ and pp.page_id = pe.page_id
+ and pe.state = 'hidden'
+ order by pe.name
+
+
+
Index: openacs-4/contrib/packages/portal/www/configure-element.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/www/configure-element.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/portal/www/configure-element.tcl 13 Jan 2004 02:23:06 -0000 1.1
@@ -0,0 +1,36 @@
+#
+# 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 {
+
+ @author Don Baccus (dhogaza@pacifier.com)
+ @creation-date 1/12/2004
+ @cvs_id $Id: configure-element.tcl,v 1.1 2004/01/13 02:23:06 donb Exp $
+} {
+ element_id:integer
+ op:notnull
+}
+
+permission::require_permission \
+ -party_id [ad_conn user_id] \
+ -object_id [portal::page::get_portal_id \
+ -page_id [portal::element::get_page_id -element_id $element_id]] \
+ -privilege write
+
+portal::element::configure \
+ -element_id $element_id \
+ -op $op \
+ -return_url [get_referrer]