Index: openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 30 Jan 2007 11:36:07 -0000 1.13
+++ openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 21 Mar 2007 12:47:47 -0000 1.14
@@ -14,12 +14,13 @@
Name
Neue Seite
Verst�ndigungen
- Abschnitt
-
+ Abschnitt
Titel der Seite
Typ der Seite
H�ufig verwendete Schlagworte
h�ufige Schlagworte
+ Es gibt bereits ein Portlet mit dem Titel '%page_title%' in diesem Portal.
+ �ndern Sie entweder den Namen des existierenden Portlets oder den Titel der Xowiki-Seite, die Sie zum Portal hinzuf�gen wollen.
Freigegeben
Verweise auf diese Seite:
Verlauf
Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v
diff -u -r1.16 -r1.17
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 25 Feb 2007 09:57:09 -0000 1.16
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 21 Mar 2007 12:47:47 -0000 1.17
@@ -20,6 +20,8 @@
Page Type
Popular tags
popular tags
+ A portlet with the title '%page_title%' already exists in this portal.
+ Please either change the existing portlets' name or the title of the xowiki page you want to add to the portal.
Published
References to this Page:
Revisions
Index: openacs-4/packages/xowiki/www/admin/portal-element-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/portal-element-add.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/xowiki/www/admin/portal-element-add.tcl 21 Mar 2007 12:12:00 -0000 1.2
+++ openacs-4/packages/xowiki/www/admin/portal-element-add.tcl 21 Mar 2007 12:47:46 -0000 1.3
@@ -15,29 +15,31 @@
set page_id [$package_id resolve_request -path $page_name method]
set page_id [::Generic::CrItem lookup -name $page_name -parent_id [$package_id folder_id]]
+set page_title [$page_id title]
-ns_log notice "we have page=$page_id\n::Generic::CrItem lookup -name $page_name -parent_id [$package_id folder_id]"
-db_transaction {
-ns_log notice "portal::add_element \
- -portal_id $portal_id \
- -portlet_name [xowiki_portlet::get_my_name] \
- -pretty_name [$page_id title] \
- -force_region [parameter::get_from_package_key \
- -parameter xowiki_portal_content_force_region \
- -package_key xowiki-portlet]"
+# for the time being, we add the portlet on the first page (page 0)
+set portal_page_id [portal::get_page_id -portal_id $portal_id -sort_key 0]
- set element_id [portal::add_element \
- -portal_id $portal_id \
- -portlet_name [xowiki_portlet::get_my_name] \
- -pretty_name [$page_id title] \
- -force_region [parameter::get_from_package_key \
- -parameter "xowiki_portal_content_force_region" \
- -package_key "xowiki-portlet"]
- ]
- portal::set_element_param $element_id package_id $package_id
- portal::set_element_param $element_id page_name [$page_id name]
+if {[db_string check_unique_name_on_page {
+ select 1 from portal_element_map
+ where portal_id = :portal_page_id
+ and pretty_name = :page_title
+}] eq "1"} {
+ ad_return_error [_ xowiki.portlet_title_exists_error_short] [_ xowiki.portlet_title_exists_error_long]
+} else {
+ db_transaction {
+ set element_id [portal::add_element \
+ -portal_id $portal_id \
+ -portlet_name [xowiki_portlet::get_my_name] \
+ -pretty_name $page_title \
+ -force_region [parameter::get_from_package_key \
+ -parameter "xowiki_portal_content_force_region" \
+ -package_key "xowiki-portlet"]
+ ]
+ portal::set_element_param $element_id package_id $package_id
+ portal::set_element_param $element_id page_name [$page_id name]
+ }
+ ad_returnredirect $referer
}
-
-ad_returnredirect $referer
ad_script_abort