Index: openacs-4/packages/acs-admin/www/auth/authority.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/auth/authority.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/acs-admin/www/auth/authority.tcl 30 Oct 2003 18:00:09 -0000 1.17 +++ openacs-4/packages/acs-admin/www/auth/authority.tcl 7 Nov 2003 17:35:41 -0000 1.18 @@ -268,7 +268,7 @@ set interactive_pretty [ad_decode $interactive_p "t" "Yes" "No"] - set short_message [string_truncate -len 30 $message] + set short_message [string_truncate -len 30 -- $message] set actions_per_minute {} if { $run_time_seconds > 0 && $num_actions > 0 } { Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 7 Nov 2003 13:03:46 -0000 1.27 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 7 Nov 2003 17:35:42 -0000 1.28 @@ -1401,7 +1401,7 @@ # ##### -ad_proc string_truncate { +ad_proc -public string_truncate { {-len 200} {-format html} {-no_format:boolean} @@ -1414,6 +1414,9 @@ HTML tags are closed. Otherwise, it's converted to text using ad_html_to_text. + Should always be called as string_truncate [-flags ...] -- string + since otherwise strings which start with a - will treated as missing arguments. + @param len The lenght to truncate to. Defaults to parameter TruncateDescriptionLength. @param format html or text. @param no_format causes hyperlink tags not to get listed at the end of the output. Index: openacs-4/packages/bookshelf/www/bookshelf-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookshelf/www/bookshelf-include.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bookshelf/www/bookshelf-include.tcl 30 Sep 2002 18:10:56 -0000 1.1 +++ openacs-4/packages/bookshelf/www/bookshelf-include.tcl 7 Nov 2003 17:35:42 -0000 1.2 @@ -34,7 +34,7 @@ order by bookshelf_book__read_status_sort_order(b.read_status) desc, o.creation_date desc } { if { [empty_string_p $excerpt] } { - set excerpt [string_truncate -len 300 $main_entry] + set excerpt [string_truncate -len 300 -- $main_entry] } set read_status_pretty [string totitle $read_status_pretty] set view_url "book-view?[export_vars { book_no }]" Index: openacs-4/packages/bookshelf/www/bookshelf-titles-include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookshelf/www/bookshelf-titles-include.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bookshelf/www/bookshelf-titles-include.tcl 30 Sep 2002 18:10:56 -0000 1.1 +++ openacs-4/packages/bookshelf/www/bookshelf-titles-include.tcl 7 Nov 2003 17:35:42 -0000 1.2 @@ -32,7 +32,7 @@ order by bookshelf_book__read_status_sort_order(b.read_status), o.creation_date desc } { if { [empty_string_p $excerpt] } { - set excerpt [string_truncate -len 300 $main_entry] + set excerpt [string_truncate -len 300 -- $main_entry] } set read_status_pretty [string totitle $read_status_pretty] set view_url "book-view?[export_vars { book_no }]" Index: openacs-4/packages/bookshelf/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookshelf/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bookshelf/www/index.tcl 30 Sep 2002 18:10:56 -0000 1.1 +++ openacs-4/packages/bookshelf/www/index.tcl 7 Nov 2003 17:35:42 -0000 1.2 @@ -97,7 +97,7 @@ db_multirow -extend { view_url edit_url } book books $sql { if { [empty_string_p $excerpt] } { - set excerpt [string_truncate -len 300 $main_entry] + set excerpt [string_truncate -len 300 -- $main_entry] } set read_status_pretty [string totitle $read_status_pretty] set view_url "book-view?[export_vars { book_no }]" Index: openacs-4/packages/lars-blogger/www/drafts.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/drafts.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lars-blogger/www/drafts.tcl 16 Oct 2003 23:10:45 -0000 1.3 +++ openacs-4/packages/lars-blogger/www/drafts.tcl 7 Nov 2003 17:35:42 -0000 1.4 @@ -69,7 +69,7 @@ db_multirow -extend { entry_date_pretty edit_url publish_url delete_url preview_url } entries $statement {} { set entry_date_pretty [lc_time_fmt $entry_date_ansi "%q"] - set content [string_truncate -len 80 $content] + set content [string_truncate -len 80 -- $content] } set entry_add_url "entry-edit" Index: openacs-4/packages/logger/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/index.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/logger/www/admin/index.tcl 28 Aug 2003 09:45:31 -0000 1.7 +++ openacs-4/packages/logger/www/admin/index.tcl 7 Nov 2003 17:35:42 -0000 1.8 @@ -25,7 +25,7 @@ edit_url display_url permissions_url delete_url unmap_url project_lead_chunk make_active_url make_inactive_url } projects select_projects {} { - set description [string_truncate -len 50 $description] + set description [string_truncate -len 50 -- $description] set edit_url "project?[export_vars { project_id {formbutton\:formbuilder\:\:edit Edit} {form\:id project_form} {form\:mode display}}]" set display_url "project?[export_vars { project_id }]" Index: openacs-4/packages/logger/www/lib/entries-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/lib/Attic/entries-table.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/logger/www/lib/entries-table.tcl 28 Aug 2003 09:45:31 -0000 1.6 +++ openacs-4/packages/logger/www/lib/entries-table.tcl 7 Nov 2003 17:35:42 -0000 1.7 @@ -71,8 +71,8 @@ set value_subtotal 0 db_multirow -extend { subtotal subaverage view_url edit_url delete_url delete_onclick user_chunk selected_p } entries select_entries {} { - set description [string_truncate -len 50 $description] - set project_name [string_truncate -len 20 $project_name] + set description [string_truncate -len 50 -- $description] + set project_name [string_truncate -len 20 -- $project_name] set selected_p [string equal $id $selected_entry_id] set action_links_list [list] set view_url "log?[export_vars { { entry_id $id } }]" Index: openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 1 Nov 2003 08:45:38 -0000 1.3 +++ openacs-4/packages/news-aggregator/tcl/news-aggregator-procs.tcl 7 Nov 2003 17:35:42 -0000 1.4 @@ -208,9 +208,9 @@ if { ![string equal 0 $result] } { set channel [lindex $result 0] - set title [string_truncate -len 245 -no_format [lindex $channel 0]] - set link [string_truncate -len 245 -no_format [lindex $channel 1]] - set description [string_truncate -len 245 -no_format [lindex $channel 2]] + set title [string_truncate -len 245 -no_format -- [lindex $channel 0]] + set link [string_truncate -len 245 -no_format -- [lindex $channel 1]] + set description [string_truncate -len 245 -no_format -- [lindex $channel 2]] set source_id [db_nextval "acs_object_id_seq"] set creation_ip [ns_conn peeraddr] set last_modified [lindex $f 2] @@ -220,8 +220,8 @@ db_exec_plsql add_source { *SQL* } set items [lrange $result 1 end] foreach item $items { - set title [string_truncate -len 245 -no_format [lindex $item 0]] - set link [string_truncate -len 245 -no_format [lindex $item 1]] + set title [string_truncate -len 245 -no_format -- [lindex $item 0]] + set link [string_truncate -len 245 -no_format -- [lindex $item 1]] set description [lindex $item 2] db_exec_plsql add_item { *SQL* } } @@ -252,8 +252,8 @@ set host [lindex [lindex $result 0] 1] set items [lrange $result 1 end] foreach item $items { - set title [string_truncate -len 245 -no_format [lindex $item 0]] - set link [string_truncate -len 245 -no_format [lindex $item 1]] + set title [string_truncate -len 245 -no_format -- [lindex $item 0]] + set link [string_truncate -len 245 -no_format -- [lindex $item 1]] set description [lindex $item 2] # check whether link and description have been set as we @@ -287,9 +287,9 @@ # let's update the rss metadata as well set channel [lindex $result 0] set last_modified [lindex $f 2] - set title [string_truncate -len 245 -no_format [lindex $channel 0]] - set link [string_truncate -len 245 -no_format [lindex $channel 1]] - set description [string_truncate -len 245 -no_format [lindex $channel 2]] + set title [string_truncate -len 245 -no_format -- [lindex $channel 0]] + set link [string_truncate -len 245 -no_format -- [lindex $channel 1]] + set description [string_truncate -len 245 -no_format -- [lindex $channel 2]] db_dml update_source { *SQL* } } Index: openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.tcl 28 Aug 2003 09:41:58 -0000 1.2 +++ openacs-4/packages/news-aggregator-portlet/www/news-aggregator-portlet.tcl 7 Nov 2003 17:35:42 -0000 1.3 @@ -17,7 +17,7 @@ set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0] db_multirow -extend content items select_items {} { - set text_only [string_truncate -len 300 $item_description] + set text_only [string_truncate -len 300 -- $item_description] if {[exists_and_not_null item_title] && ![string equal -nocase $item_title $text_only] } { set content "$item_title. $text_only" } else { Index: openacs-4/packages/notifications/tcl/notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/notifications/tcl/notification-procs.tcl 28 Aug 2003 09:41:58 -0000 1.8 +++ openacs-4/packages/notifications/tcl/notification-procs.tcl 7 Nov 2003 17:35:42 -0000 1.9 @@ -296,7 +296,7 @@ } # Truncate notif_subject to the max len of 100 - set notif_subject [string_truncate -len 100 $notif_subject] + set notif_subject [string_truncate -len 100 -- $notif_subject] # Set up the vars set extra_vars [ns_set create] Index: openacs-4/packages/weblogger-portlet/www/weblogger-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/weblogger-portlet/www/weblogger-portlet.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/weblogger-portlet/www/weblogger-portlet.tcl 17 Oct 2003 00:39:56 -0000 1.3 +++ openacs-4/packages/weblogger-portlet/www/weblogger-portlet.tcl 7 Nov 2003 17:35:42 -0000 1.4 @@ -39,7 +39,7 @@ if { !$package_read_p($package_id) } { continue } - set content [string_truncate -len 100 $content] + set content [string_truncate -len 100 -- $content] set view_url "${base_url}one-entry?[export_vars { entry_id }]" if { $package_create_p($package_id) } { set add_url "${base_url}entry-edit"