Index: openacs-4/contrib/packages/portal/lib/page-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/page-configure.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/portal/lib/page-configure.adp 27 Feb 2004 01:13:14 -0000 1.1 @@ -0,0 +1,52 @@ + +
+
Page: + + + + + +
+ + + + + + + + + + + + +
+
+ No Elements on this page +
+ + + + +
+
+ + + + + Change page layout:
+
+ +
+
+
+ +
+ Index: openacs-4/contrib/packages/portal/lib/page-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/page-configure.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/portal/lib/page-configure.tcl 27 Feb 2004 01:13:14 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + + Configure a portal page + + @author Don Baccus (dhogaza@pacifier.com) + +} + +# We'll pass the array set format page info to the region configure template +set page_list [portal::page::get_not_cached -page_id $page_id] + +# But need the info locally, too. +array set page $page_list + +# Query needs this as a bindvar... +set page_layout_id $page(layout_id) + +# Get the layouts for the change layout widget +db_multirow layouts select_layouts {} + +# Get the per-region (column) data +db_multirow regions select_regions {} + +# Compute the column widths for the region table + +db_1row region_count {} +set region_width [expr {100/$region_count}]% + +set has_visible_elements_p [portal::page::has_visible_elements -page_id $page_id] Index: openacs-4/contrib/packages/portal/lib/page-configure.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/page-configure.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/portal/lib/page-configure.xql 27 Feb 2004 01:13:14 -0000 1.1 @@ -0,0 +1,30 @@ + + + + + + + select layout_id, description + from portal_layouts + order by layout_id + + + + + + select count(*) as region_count + from portal_layout_regions + where layout_id = :page_layout_id + + + + + + select region + from portal_layout_regions + where layout_id = :page_layout_id + order by region + + + + Index: openacs-4/contrib/packages/portal/lib/region-configure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/region-configure.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/portal/lib/region-configure.adp 27 Feb 2004 01:13:14 -0000 1.1 @@ -0,0 +1,41 @@ + + + + + + + +
+ @elements.name@ + + + + remove portlet + + + + + move up + + + + + + move down + + + + + + move right + + + + + + move left + + + +
+
Index: openacs-4/contrib/packages/portal/lib/region-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/region-configure.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/portal/lib/region-configure.tcl 27 Feb 2004 01:13:14 -0000 1.1 @@ -0,0 +1,79 @@ +array set page $page_list + +# queries need these as a bindvar ... +set page_id $page(page_id) +set portal_id $page(portal_id) + +# See if there's a page before this one +if { $page(sort_key) > 0 } { + db_1row select_prev_page_id {} +} else { + set prev_page_id "" +} + +# See if there's a page after this one (sort_key starts at zero) +if { $page(sort_key) + 1 < [portal::get_page_count -portal_id $portal_id] } { + db_1row select_next_page_id {} +} else { + set next_page_id "" +} + +# Grab all the element information and compute the various motion options + +set element_num 1 +db_1row select_element_count {} +db_multirow -extend {hide_url up_url down_url left_url right_url} elements select_elements {} { + + set up_url "" + set down_url "" + set left_url "" + set right_url "" + + # Set up the "hide" option + if { [string is true $hideable_p] } { + set hide_url \ + [export_vars -base portal-configure-2 {{op hide} portal_id page_id element_id}] + } else { + set hide_url "" + } + + # Set up the "move up" option if possible + if { $element_num > 1} { + set up_url \ + [export_vars -base portal-configure-2 {{op move_up} portal_id element_id page_id}] + } elseif { ![string equal $prev_page_id ""] } { + set up_url \ + [export_vars -base portal-configure-2 \ + {{op move_to_page} portal_id element_id {page_id $prev_page_id}}] + } + + # Set up the "move down" option if possible + if { $element_num < $element_count } { + set down_url \ + [export_vars -base portal-configure-2 {{op move_down} portal_id element_id page_id}] + } elseif { ![string equal $next_page_id ""] } { + set down_url \ + [export_vars -base portal-configure-2 \ + {{op move_to_page} portal_id element_id {page_id $next_page_id}}] + } + + # If there's more than one region, let the user move the portlet to the right or left + if { $region_count > 1 } { + + # if there's space to the right, let them move the portlet right + if { $region < $region_count } { + set right_url \ + [export_vars -base portal-configure-2 \ + {{op move_right} portal_id element_id region}] + } + + # If there's space to the left, let them move the portlet left + if { $region > 1 } { + set left_url \ + [export_vars -base portal-configure-2 \ + {{op move_left} portal_id element_id region}] + } + } + + incr element_num +} Index: openacs-4/contrib/packages/portal/lib/region-configure.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/lib/region-configure.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/portal/lib/region-configure.xql 27 Feb 2004 01:13:14 -0000 1.1 @@ -0,0 +1,48 @@ + + + + + + + select page_id as prev_page_id + from portal_pages + where portal_id = :portal_id + and sort_key = (select sort_key - 1 + from portal_pages + where page_id = :page_id) + + + + + + select page_id as next_page_id + from portal_pages + where portal_id = :portal_id + and sort_key = (select sort_key + 1 + from portal_pages + where page_id = :page_id) + + + + + + select count(*) as element_count + from portal_elements + where page_id = :page_id + and region = :region + and state <> 'hidden' + + + + + + select element_id, name, sort_key, state, hideable_p + from portal_elements + where page_id = :page_id + and region = :region + and state <> 'hidden' + order by sort_key + + + + Index: openacs-4/contrib/packages/portal/sql/oracle/portal-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/sql/oracle/portal-core-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/sql/oracle/portal-core-create.sql 3 Jan 2004 01:42:57 -0000 1.2 +++ openacs-4/contrib/packages/portal/sql/oracle/portal-core-create.sql 27 Feb 2004 01:13:15 -0000 1.3 @@ -287,9 +287,7 @@ not null, sort_key integer constraint p_elements_sort_key_nn - not null - constraint p_elements_sort_key_ck - check (sort_key > 0), + not null, state varchar(6) default 'full' constraint p_elements_state_ck Index: openacs-4/contrib/packages/portal/sql/postgresql/portal-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/sql/postgresql/portal-core-create.sql,v diff -u -r1.7 -r1.8 --- openacs-4/contrib/packages/portal/sql/postgresql/portal-core-create.sql 1 Feb 2004 03:08:10 -0000 1.7 +++ openacs-4/contrib/packages/portal/sql/postgresql/portal-core-create.sql 27 Feb 2004 01:13:15 -0000 1.8 @@ -390,9 +390,7 @@ not null, sort_key integer constraint p_elements_sort_key_nn - not null - constraint p_elements_sort_key_ck - check (sort_key > 0), + not null, state varchar(6) default 'full' constraint p_elements_state_ck 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.15 -r1.16 --- openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 17 Feb 2004 01:33:57 -0000 1.15 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.tcl 27 Feb 2004 01:13:15 -0000 1.16 @@ -298,311 +298,7 @@ } } - ad_proc -public configure { - {-referer ""} - {-template_p f} - package_id - portal_id - return_url - } { - Return a portal or portal template configuration page. - All form targets point to file_stub-2. - FIXME REFACTOR ME - - DRB: AND MAKE ME A *BLEEPING* PROPER TEMPLATE!!! - - @param portal_id - @return_url - } { - set edit_p [permission::permission_p -object_id $portal_id -privilege write] - - if {!$edit_p} { - permission::require_permission -privilege admin -object_id $portal_id - set edit_p 1 - } - - # - # Set up some whole page stuff - # - - set master_template [ad_parameter master_template] - set action_string [generate_action_string] - set element_src "[portal::www_path]/place-element" - - if {[empty_string_p $referer]} { - set return_text "Go back" - } else { - set return_text "" - set return_url $referer - } - - # - # Begin creating the template - # - - set template " - -

- $return_text -

" - - # - # Theme selection chunk - # - - set theme_chunk " -

- - - - -
\n" - - set page_ids [get_page_list -portal_id $portal_id] - - set show_avail_p 0 - set show_html "\n" - - if { $show_avail_p } { - append template " -
-
- - - - - $show_html - \n -
-
\n" - } - - # - # Per-page template chunks - # - set page_id "" - - for { set page_num 0 } { $page_num < [llength $page_ids] } {incr page_num} { - set prev_page_id $page_id - set page_id [lindex $page_ids $page_num] - if { $page_num == [llength $page_ids] - 1 } { - set next_page_id "" - } else { - set next_page_id [lindex $page_ids [expr {$page_num + 1}]] - } - - set first_page_p [portal::page::first_page_p -portal_id $portal_id -page_id $page_id] - set page_name [portal::page::get_name -page_id $page_id] - set page_layout_id [portal::page::get_layout_id -page_id $page_id] - - append template "" - - # - # Page rename chunk - # - - set page_name_chunk " - - - - - - -
Page: - - - " - append template "$page_name_chunk" - - if {[portal::page::has_visible_elements -page_id $page_id] || $first_page_p} { - - # - # Page with non-hidden elements OR the first page of the portal - # - - db_1row portal_and_page_info_select {} -column_array portal - - set element_list [array get fake_element_ids] - - append template " -
- " - - if { ![portal::page::has_visible_elements -page_id $page_id] } { - append template " - " - } - append template "\n" - - if {![portal::page::has_visible_elements -page_id $page_id]} { - - # - # Non first page with all hidden elements - # - - # - # Remove page chunk - don't allow removal of the first page - # - - if {!$first_page_p} { - append template " - - " - } - - # - # Layout change chunk - only shown when there are no visible elements on the page - # - - set layout_chunk "" - - foreach layout [portal::layout::get_layout_list] { - set layout_id [ns_set get $layout layout_id] - set layout_name [ns_set get $layout layout_name] - set layout_description [ns_set get $layout layout_description] - set one_layout_chunk " $layout_name - $layout_description" - append layout_chunk "
\n" - } - - - append template " - - " - - } - - - # close the page's table - append template "
-
- No Elements on this page -
" - } else { - set regions [portal::layout::get_region_list -layout_id $portal(layout_id)] - set num_regions [llength $regions] - set region_width [expr {int(100/$num_regions)}] - foreach region $regions { - append template " -
- \n" - } - } - append template "
-
- No Elements on this page -
- - - - -
-
-
-
-
- - Change page layout: -
- - - - $layout_chunk - -
-
-
" - - } - - # - # New page chunk - # - - set new_page_num [expr [get_page_count -portal_id $portal_id] + 1] - - append template " - -
- - - - Add a new page: - - -
- " - - # - # Revert page chunk - # - - if {![empty_string_p [get_template_id -portal_id $portal_id]]} { - append template " -
-
- - - Revert to the default arrangement: - -
" - } - - # - # Templating system hacks - # - - set __adp_stub "[get_server_root][www_path]/." - set {master_template} \"master\" - - set code [template::adp_compile -string $template] - set output [template::adp_eval code] - - return $output - } - ad_proc -public configure_dispatch { {-template_p f} {-portal_id:required} @@ -708,7 +404,8 @@ "Move to page" { portal::element::move_to_page \ -page_id [ns_set get $form page_id] \ - -element_id [ns_set get $form element_id] + -element_id [ns_set get $form element_id] \ + -region 1 } hide { set element_id_list [list] @@ -960,16 +657,6 @@ 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 {}] - } - ad_proc datasource_list { -package_id:required } { 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.7 -r1.8 --- openacs-4/contrib/packages/portal/tcl/portal-procs.xql 12 Feb 2004 21:31:20 -0000 1.7 +++ openacs-4/contrib/packages/portal/tcl/portal-procs.xql 27 Feb 2004 01:13:15 -0000 1.8 @@ -219,18 +219,6 @@ - - - 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 - - - select pd.datasource_id, pd.name Index: openacs-4/contrib/packages/portal/tcl/theme-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/theme-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/portal/tcl/theme-procs.tcl 8 Jan 2004 02:12:19 -0000 1.2 +++ openacs-4/contrib/packages/portal/tcl/theme-procs.tcl 27 Feb 2004 01:13:15 -0000 1.3 @@ -42,11 +42,4 @@ return [array get theme] } - ad_proc -public get_list {} { - returns a list of all the themes in the system as ns_sets with - keys being: theme_id, name, description - } { - return [db_list_of_ns_sets select_theme_list {}] - } - } Index: openacs-4/contrib/packages/portal/tcl/theme-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/tcl/theme-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/portal/tcl/theme-procs.xql 10 Jan 2004 01:01:01 -0000 1.3 +++ openacs-4/contrib/packages/portal/tcl/theme-procs.xql 27 Feb 2004 01:13:15 -0000 1.4 @@ -10,14 +10,4 @@ - - - select theme_id, - name, - description - from portal_themes - order by name - - - Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/place-element-other-page.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/place-element-other-page.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/place-element-other-page.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/place-element.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/place-element.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/place-element.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/contrib/packages/portal/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/portal/www/admin/index.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/portal/www/admin/index.tcl 12 Feb 2004 21:31:21 -0000 1.5 +++ openacs-4/contrib/packages/portal/www/admin/index.tcl 27 Feb 2004 01:13:17 -0000 1.6 @@ -40,7 +40,7 @@ } set edit_portal_template_url \ - [export_vars -base portal-config {{referer index} {portal_id $master_template_id}}] + [export_vars -base ../portal-configure {{referer index} {portal_id $master_template_id}}] db_1row count_uninstalled_applications {} ad_return_template Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/admin/portal-config-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/admin/portal-config.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/contrib/packages/portal/www/admin/portal-config.tcl'. Fisheye: No comparison available. Pass `N' to diff?