示例#1
0
 /**
  * setFormData 
  * 
  * Saves all the data passed in from the form upload.
  * 
  * @param array $formData
  * 
  * @return void
  */
 public function setFormData($formData)
 {
     $this->formData = $formData;
     $token = getUserPicasaSessionToken($this->fcmsUser->id);
     $albumId = $formData['albums'];
     $user = $formData['picasa_user'];
     $httpClient = Zend_Gdata_AuthSub::getHttpClient($token);
     $picasaService = new Zend_Gdata_Photos($httpClient, "Google-DevelopersGuide-1.0");
     $thumbSizes = '150c,600';
     if ($this->usingFullSizePhotos) {
         $thumbSizes .= ',d';
     }
     try {
         $query = new Zend_Gdata_Photos_AlbumQuery();
         $query->setUser($user);
         $query->setAlbumId($albumId);
         $query->setParam('thumbsize', $thumbSizes);
         $albumFeed = $picasaService->getAlbumFeed($query);
     } catch (Zend_Gdata_App_Exception $e) {
         $this->fcmsError->add(array('type' => 'operation', 'message' => T_('Could not get Picasa data.'), 'error' => $e->getMessage(), 'file' => __FILE__, 'line' => __LINE__));
         return false;
     }
     $this->albumFeed = $albumFeed;
 }