Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix bug reported by Martin D. - now when you edit a feed you are retu…

…rned 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.
  • Loading branch information...
commit cc370f3587e4d81b66784f047cee5810d068c80e 1 parent abea38d
dhawes authored
Showing with 9 additions and 5 deletions.
  1. +9 −5 blocks/rss_client/block_rss_client_action.php
View
14 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 '<strong>'. get_string('block_rss_feed_updated', 'block_rss_client') .'</strong>';
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 .= '<br /><input type="text" size="60" maxlength="256" name="url" value="';
+ $returnstring .= "\n".'<br /><input type="text" size="60" maxlength="256" name="url" value="';
if ($act == 'rss_edit') {
$returnstring .= $url;
}
Please sign in to comment.
Something went wrong with that request. Please try again.