From: dhawes Date: Sat, 29 Jan 2005 04:45:57 +0000 (+0000) Subject: fix bug reported by Martin D. - now when you edit a feed you are returned to a page... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cc370f3587e4d81b66784f047cee5810d068c80e;p=moodle.git fix bug reported by Martin D. - now when you edit a feed you are returned to a page with the full feed listings rather than just the edited feed. As an added bonus when editing a feed you will see that feed's data on the edit page instead of simply the edit form. --- diff --git a/blocks/rss_client/block_rss_client_action.php b/blocks/rss_client/block_rss_client_action.php index f8d54e85ef..36637a0290 100644 --- a/blocks/rss_client/block_rss_client_action.php +++ b/blocks/rss_client/block_rss_client_action.php @@ -20,7 +20,7 @@ optional_variable($rssid, 'none'); optional_variable($courseid, 'none'); optional_variable($url); - optional_variable($preferredtitle); + optional_variable($preferredtitle, ''); optional_variable($item); $straddedit = get_string('block_rss_feeds_add_edit', 'block_rss_client'); @@ -83,7 +83,8 @@ error('There was an error trying to update rss feed with id:'. $rssid); } - rss_display_feeds($rssid); +// rss_display_feeds($rssid); + rss_display_feeds(); print ''. get_string('block_rss_feed_updated', 'block_rss_client') .''; rss_get_form($act, $dataobject->url, $rssid, $dataobject->preferredtitle); @@ -131,9 +132,12 @@ } else if ( $act == 'rss_edit') { $rss_record = get_record('block_rss_client', 'id', $rssid); - $fname = stripslashes_safe($rss_record->title); - $url = stripslashes_safe($rss_record->url); $preferredtitle = stripslashes_safe($rss_record->preferredtitle); + if (empty($preferredtitle)) { + $preferredtitle = stripslashes_safe($rss_record->title); + } + $url = stripslashes_safe($rss_record->url); + rss_display_feeds($rssid); rss_get_form($act, $url, $rssid, $preferredtitle); } else if ($act == 'delfeed') { @@ -232,7 +236,7 @@ function rss_get_form($act, $url, $rssid, $preferredtitle, $printnow=true) { } else { $returnstring .= $straddfeed; } - $returnstring .= '