]> git.mjollnir.org Git - moodle.git/commitdiff
Preparation for MDL-11430 - whitespace.
authornfreear <nfreear>
Mon, 15 Oct 2007 12:26:54 +0000 (12:26 +0000)
committernfreear <nfreear>
Mon, 15 Oct 2007 12:26:54 +0000 (12:26 +0000)
blocks/tag_flickr/block_tag_flickr.php
blocks/tag_youtube/block_tag_youtube.php

index 7ad3a4cf68639c24bb5da77e7d84dd048ab67ff1..a035a16322905f013822a0f288f160d60b60efe7 100644 (file)
@@ -33,7 +33,7 @@ class block_tag_flickr extends block_base {
         if ($this->content !== NULL) {
             return $this->content;
         }
-       
+
         $tagid       = optional_param('id',     0,      PARAM_INT);   // tag id
 
         //include related tags in the photo query ?
@@ -42,7 +42,7 @@ class block_tag_flickr extends block_base {
             $tags_csv .= ',' . tag_names_csv( get_item_tags('tag',$tagid));
         }
         $tags_csv = urlencode($tags_csv);
-        
+
         //number of photos to display
         $numberofphotos = DEFAULT_NUMBER_OF_PHOTOS;
         if( !empty($this->config->numberofphotos)) {
@@ -55,7 +55,6 @@ class block_tag_flickr extends block_base {
             $sortby = $this->config->sortby;
         }
 
-
         //pull photos from a specific photoset
         if(!empty($this->config->photoset)){
 
@@ -64,17 +63,17 @@ class block_tag_flickr extends block_base {
             $request .= '&photoset_id='.$this->config->photoset;
             $request .= '&per_page='.$numberofphotos;
             $request .= '&format=php_serial';
-            
+
             $response = $this->fetch_request($request);
-            
+
             $search = unserialize($response);
 
             foreach ($search['photoset']['photo'] as $p){
                 $p['owner'] = $search['photoset']['owner'];
             }
-            
+
             $photos = array_values($search['photoset']['photo']);
-            
+
         }
         //search for photos tagged with $tags_csv
         else{
@@ -85,15 +84,13 @@ class block_tag_flickr extends block_base {
             $request .= '&per_page='.$numberofphotos;
             $request .= '&sort='.$sortby;
             $request .= '&format=php_serial';
-            
+
             $response = $this->fetch_request($request);
-            
+
             $search = unserialize($response);
-            $photos = array_values($search['photos']['photo']);   
-                
-                
+            $photos = array_values($search['photos']['photo']);  
         }
-        
+
 
         if(strcmp($search['stat'], 'ok') != 0) return; //if no results were returned, exit...
 
@@ -110,15 +107,13 @@ class block_tag_flickr extends block_base {
         $this->content->footer = '';
 
         return $this->content;
-
     }
-    
-   function fetch_request($request){
-        
+
+    function fetch_request($request){
         global $CFG;
 
         make_upload_directory('/cache/flickr');
-        
+
         $cache = new RSSCache($CFG->dataroot . '/cache/flickr', FLICKR_CACHE_EXPIRATION);
         $cache_status = $cache->check_cache( $request);
 
@@ -143,7 +138,7 @@ class block_tag_flickr extends block_base {
 
         return $response;        
     }
-        
+
     function build_photo_url ($photo, $size='medium') {
         //receives an array (can use the individual photo data returned
         //from an API call) and returns a URL (doesn't mean that the
@@ -156,12 +151,12 @@ class block_tag_flickr extends block_base {
             'large' => '_b',
             'original' => '_o'
         );
-        
+
         $size = strtolower($size);
         if (!array_key_exists($size, $sizes)) {
             $size = 'medium';
         }
-        
+
         if ($size == 'original') {
             $url = 'http://farm' . $photo['farm'] . '.static.flickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['originalsecret'] . '_o' . '.' . $photo['originalformat'];
         } else {
@@ -170,4 +165,5 @@ class block_tag_flickr extends block_base {
         return $url;
     }    
 }
+
 ?>
index 0d366e53e7006d3f61c17bca47b6710f0f5970da..856f5d532a58963197417fc206635187bb59d0f2 100644 (file)
@@ -29,12 +29,10 @@ class block_tag_youtube extends block_base {
 
     function get_content() {
 
-
         if ($this->content !== NULL) {
             return $this->content;
         }
 
-
         if(!empty($this->config->playlist)){
             //videos from a playlist
             $text = $this->get_videos_by_playlist();
@@ -55,7 +53,6 @@ class block_tag_youtube extends block_base {
         $this->content->footer = '';
 
         return $this->content;
-
     }
 
     function get_videos_by_playlist(){
@@ -72,7 +69,6 @@ class block_tag_youtube extends block_base {
         $request .= "&per_page={$numberofvideos}";
 
         return $this->fetch_request($request);
-
     }
 
     function get_videos_by_tag(){
@@ -94,7 +90,6 @@ class block_tag_youtube extends block_base {
         $request .= "&per_page={$numberofvideos}";
 
         return $this->fetch_request($request);
-
     }
 
     function get_videos_by_tag_and_category(){
@@ -133,7 +128,6 @@ class block_tag_youtube extends block_base {
 
             $xmlobj = XML_unserialize($cached_response);
             return $this->render_video_list($xmlobj);
-
         }
 
         if ( $cache_status == 'STALE' ) {