]> git.mjollnir.org Git - moodle.git/commitdiff
Delete some trailing whitespaces...
authorstronk7 <stronk7>
Mon, 30 Jul 2007 19:13:19 +0000 (19:13 +0000)
committerstronk7 <stronk7>
Mon, 30 Jul 2007 19:13:19 +0000 (19:13 +0000)
lib/rsslib.php

index 532796005793db90e7ac6c53209a3ae6c0c67677..49886a5fe2d84a72ffd5a541afab52331b93807c 100644 (file)
@@ -47,7 +47,7 @@ function cron_rss_feeds () {
     global $CFG;
 
     $status = true;
-   
+
     mtrace('    Generating rssfeeds...');
 
     //Check for required functions...
@@ -97,9 +97,9 @@ function cron_rss_feeds () {
 
 //This function saves to file the rss feed specified in the parameters
 function rss_save_file ($modname, $mod, $result) {
+
     global $CFG;
-    
+
     $status = true;
 
     if (! $basedir = make_upload_directory ('rss/'. $modname)) {
@@ -207,7 +207,7 @@ function rss_standard_header($title = NULL, $link = NULL, $description = NULL) {
 function rss_add_items($items) {
 
     global $CFG;
-        
+
     $result = '';
 
     if (!empty($items)) {
@@ -268,7 +268,7 @@ function rss_geterrorxmlfile() {
     //XML Header
     $return = rss_standard_header();
 
-    //XML item 
+    //XML item
     if ($return) {
         $item->title = "RSS Error";
         $item->link = $CFG->wwwroot;
@@ -281,7 +281,7 @@ function rss_geterrorxmlfile() {
     if ($return) {
         $return .= rss_standard_footer();
     }
-    
+
     return $return;
 }
 
@@ -371,7 +371,7 @@ function rss_display_feeds($courseid, $userid, $rssid='', $context) {
     $select = '';
     $managesharedfeeds = has_capability('block/rss_client:manageanyfeeds', $context);
     $manageownfeeds = has_capability('block/rss_client:manageownfeeds', $context);
-    
+
     if ($rssid != '') {
         $select = 'id = '.$rssid.' AND ';
     }
@@ -407,10 +407,10 @@ function rss_display_feeds($courseid, $userid, $rssid='', $context) {
 
             if ( ($feed->userid == $USER->id && $manageownfeeds)
                     || ($feed->shared && $managesharedfeeds) ) {
-                
+
                 $feedicons = '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&amp;act=rssedit&amp;rssid='. $feed->id .'&amp;shared='.$feed->shared.'&amp;blogid='. $blogid .'">'.
                              '<img src="'. $CFG->pixpath .'/t/edit.gif" alt="'. get_string('edit').'" title="'. get_string('edit') .'" /></a>&nbsp;'.
-                             
+
                              '<a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?id='. $courseid .'&amp;act=delfeed&amp;rssid='. $feed->id.'&amp;shared='.$feed->shared.'blogid='. $blogid .'" 
                 onclick="return confirm(\''. get_string('deletefeedconfirm', 'block_rss_client') .'\');">'.
                              '<img src="'. $CFG->pixpath .'/t/delete.gif" alt="'. get_string('delete').'" title="'. get_string('delete') .'" /></a>';
@@ -428,7 +428,7 @@ function rss_display_feeds($courseid, $userid, $rssid='', $context) {
         <a href="'. $feed->url .'">'. $feed->url .'</a>
     </div>
     <div class="description">'.$feed->description.'</div>';
-            
+
             $table->add_data(array($feedinfo, $feedicons));
         }
     }
@@ -463,29 +463,29 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar
     $stradd = get_string('add');
     $strupdatefeed = get_string('updatefeed', 'block_rss_client');
     $straddfeed = get_string('addfeed', 'block_rss_client');
-   
+
     $returnstring = '';
 
     $returnstring .= '<form action="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php" method="post" id="block_rss">'."\n";
     print_location_comment(__FILE__,__LINE__);
-    $returnstring .= '<div id="rss_table">'."\n";    
+    $returnstring .= '<div id="rss_table">'."\n";
     if ($act == 'rssedit') {
-        $returnstring .= $strupdatefeed; 
-    } else { 
-        $returnstring .= $straddfeed; 
+        $returnstring .= $strupdatefeed;
+    } else {
+        $returnstring .= $straddfeed;
     }
 
     $returnstring .= "\n".'<br /><input type="text" size="60" maxlength="256" name="url" value="';
-    if ($act == 'rssedit') { 
-        $returnstring .= $url; 
+    if ($act == 'rssedit') {
+        $returnstring .= $url;
     }
 
     $returnstring .= '" />'."\n";
     $returnstring .= '<br />'. get_string('customtitlelabel', 'block_rss_client');
     $returnstring .= '<br /><input type="text" size="60" maxlength="128" name="preferredtitle" value="';
 
-    if ($act == 'rssedit') { 
-        $returnstring .= $preferredtitle; 
+    if ($act == 'rssedit') {
+        $returnstring .= $preferredtitle;
     }
 
     $returnstring .= '" />'."\n";
@@ -499,7 +499,7 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar
         $returnstring .= get_string('sharedfeed', 'block_rss_client');
         $returnstring .= '<br />'."\n";
     }
-    
+
     $returnstring .= '<input type="hidden" name="act" value="';
 
     if ($act == 'rssedit') {
@@ -509,16 +509,15 @@ function rss_get_form($act='none', $url='', $rssid='', $preferredtitle='', $shar
     }
 
     $returnstring .= '" />'."\n";
-    if ($act == 'rssedit') { 
-        $returnstring .= '<input type="hidden" name="rssid" value="'. $rssid .'" />'. "\n"; 
+    if ($act == 'rssedit') {
+        $returnstring .= '<input type="hidden" name="rssid" value="'. $rssid .'" />'. "\n";
     }
 
     $returnstring .= '<input type="hidden" name="id" value="'. $courseid .'" />'."\n";
     $returnstring .= '<input type="hidden" name="blogid" value="'. $blogid .'" />'."\n";
     $returnstring .= '<input type="hidden" name="user" value="'. $USER->id .'" />'."\n";
     $returnstring .= '<br /><input type="submit" value="';
-    $validatestring = "<a href=\"#\" 
-onclick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementId('block_rss').elements['url'].value,'validate','width=640,height=480,scrollbars=yes,status=yes,resizable=yes');return true;\">". get_string('validatefeed', 'block_rss_client')."</a>";
+    $validatestring = "<a href=\"#\" onclick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementId('block_rss').elements['url'].value,'validate','width=640,height=480,scrollbars=yes,status=yes,resizable=yes');return true;\">". get_string('validatefeed', 'block_rss_client')."</a>";
 
     if ($act == 'rssedit') {
         $returnstring .= $stredit;
@@ -534,17 +533,17 @@ onclick=\"window.open('http://feedvalidator.org/check.cgi?url='+getElementId('bl
 
 /**
 * Adds RSS Media Enclosures for "podcasting" by examining links to media files,
-* and attachments which are media files. Please note that the RSS that is 
+* and attachments which are media files. Please note that the RSS that is
 * produced cannot be strictly valid for the linked files, since we do not know
-* the files' sizes and cannot include them in the "length" attribute. At 
+* the files' sizes and cannot include them in the "length" attribute. At
 * present, the validity (and therefore the podcast working in most software)
 * can only be ensured for attachments, and not for links.
-* Note also that iTunes does some things very badly - one thing it does is 
+* Note also that iTunes does some things very badly - one thing it does is
 * refuse to download ANY of your files if you're using "file.php?file=blah"
-* and can't use the more elegant "file.php/blah" slasharguments setting. It 
-* stops after ".php" and assumes the files are not media files, despite what 
+* and can't use the more elegant "file.php/blah" slasharguments setting. It
+* stops after ".php" and assumes the files are not media files, despite what
 * is specified in the "type" attribute. Dodgy coding all round!
-* 
+*
 * @param    $item     object representing an RSS item
 * @return   string    RSS enclosure tags
 * @author   Hannes Gassert <hannes@mediagonal.ch>
@@ -556,7 +555,7 @@ function rss_add_enclosures($item){
 
     $returnstring = '';
     $rss_text = $item->description;
-    
+
     // list of media file extensions and their respective mime types
     include_once($CFG->libdir.'/filelib.php');
     $mediafiletypes = get_mimetypes_array();
@@ -576,12 +575,12 @@ function rss_add_enclosures($item){
             $returnstring .= "\n<enclosure url=\"$attachment->url\" length=\"$attachment->length\" type=\"$type\" />\n";
         }
     }
-    
+
     if (!preg_match_all($medialinkpattern, $rss_text, $matches)){
         return $returnstring;
     }
 
-    // loop over matches of regular expression 
+    // loop over matches of regular expression
     for ($i = 0; $i < count($matches[2]); $i++){
         $url = htmlspecialchars($matches[2][$i]);
         $extension = strtolower($matches[3][$i]);
@@ -594,7 +593,7 @@ function rss_add_enclosures($item){
         // the rss_*_tag functions can't deal with methods, unfortunately
         $returnstring .= "\n<enclosure url='$url' type='$type' />\n";
     }
-    
+
     return $returnstring;
 }
 ?>