]> git.mjollnir.org Git - moodle.git/commitdiff
now displays a link to the full error text if there is a problem loading a feed ...
authordhawes <dhawes>
Wed, 19 Jan 2005 23:59:21 +0000 (23:59 +0000)
committerdhawes <dhawes>
Wed, 19 Jan 2005 23:59:21 +0000 (23:59 +0000)
blocks/rss_client/block_rss_client.php

index 7f2f084639351f5a1031341a9f48e2026f8aae1a..4a443c4d30296f2dd779f80a0fe280b81d9abcd9 100644 (file)
@@ -104,13 +104,21 @@ class block_rss_client extends block_base {
         return true;
     }
 
+    /**
+     *
+     */
     function get_rss_by_id($rssid, $display_description, $shownumentries) {
+        global $CFG;
         $returnstring = '';
         $rss_record = get_record('block_rss_client', 'id', $rssid);
         if (isset($rss_record) && isset($rss_record->id)) {
             $rss = rss_get_feed($rss_record->id, $rss_record->url, $rss_record->type);
-            if (empty($rss)) {
-                // There was a failure in loading the rss feed
+
+            if ($CFG->debug && (empty($rss) || !empty($rss->ERROR))) {
+                // There was a failure in loading the rss feed, print link to full error text
+                if (!empty($rss) && !empty($rss->ERROR)) {
+                    print '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_error.php?error='. urlencode($rss->ERROR) .'">Error loading a feed.</a><br />';
+                }
                 return;
             }