Index: openacs-4/packages/news-aggregator/www/opml-import-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/opml-import-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news-aggregator/www/opml-import-2.tcl 6 Apr 2021 13:33:26 -0000 1.4 +++ openacs-4/packages/news-aggregator/www/opml-import-2.tcl 6 Apr 2021 13:35:37 -0000 1.5 @@ -1,6 +1,6 @@ ad_page_contract { The -2 page for OPML import. - + @author Guan Yang (guan@unicast.org) @cvs-id $Id$ @creation-date 2003-08-14 @@ -9,9 +9,9 @@ url:notnull } -validate { url_is_valid -requires { url:notnull } { - if { ![util_url_valid_p $url] } { - ad_complain "The URL you have entered is not valid." - } + if { ![util_url_valid_p $url] } { + ad_complain "The URL you have entered is not valid." + } } } @@ -35,39 +35,45 @@ array set opml [news_aggregator::opml::parse -xml [dict get $f page]] if { $opml(status) eq "failure" } { - error "OPML parse error: $opml(errmsg)" + error "OPML parse error: $opml(errmsg)" } set sources $opml(elements) if { [llength $sources] == 0 } { - error "OPML file did not contain any valid sources" + error "OPML file did not contain any valid sources" } list::create \ - -name opml_feeds \ - -multirow opml_feeds \ - -key url \ - -row_pretty_plural "sources" \ - -bulk_actions { - Subscribe opml-import-3 - } -elements { - title { - label "Name" - display_template { - @opml_feeds.title@ - } - } - } + -name opml_feeds \ + -multirow opml_feeds \ + -key url \ + -row_pretty_plural "sources" \ + -bulk_actions { + Subscribe opml-import-3 + } -elements { + title { + label "Name" + display_template { + @opml_feeds.title@ + } + } + } multirow create opml_feeds title html_url url foreach source $sources { - array set s $source - multirow append opml_feeds $s(title) $s(html_url) $s(url) + array set s $source + multirow append opml_feeds $s(title) $s(html_url) $s(url) } - + } errmsg] } { ad_return_complaint 1 "OPML import error: $errmsg" ad_script_abort } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: