/** * Adicionar un nuevo album. * * @param string $name name the new album * @return Zend_Gdata_Photos_AlbumEntry */ public function addAlbum($name) { $entry = new Zend_Gdata_Photos_AlbumEntry(); $entry->setTitle($this->_photos->newTitle($name)); $result = $this->_photos->insertAlbumEntry($entry); return $result; }
/** * Adds a new album to the specified user's album * * @param Zend_Http_Client $client The authenticated client * @param string $name The name of the new album * @return void */ function addAlbum($client, $name) { $photos = new Zend_Gdata_Photos($client); $entry = new Zend_Gdata_Photos_AlbumEntry(); $entry->setTitle($photos->newTitle($name)); $result = $photos->insertAlbumEntry($entry); if ($result) { return $result; } else { echo "There was an issue with the album creation."; } }
public function insertAlbumEntry($title) { // Get plugin info $plugin =& JPluginHelper::getPlugin('system', 'gdata'); $params = new JParameter($plugin->params); plgSystemGdata::gimport('Zend.Gdata.ClientLogin'); plgSystemGdata::gimport('Zend.Gdata.Photos'); plgSystemGdata::gimport('Zend.Gdata.AuthSub'); $username = $params->get('domain_admin_email'); $pass = $params->get('domain_admin_password'); $serviceName = Zend_Gdata_Photos::AUTH_SERVICE_NAME; $client = Zend_Gdata_ClientLogin::getHttpClient($username, $pass, $serviceName); // update the second argument to be CompanyName-ProductName-Version $gp = new Zend_Gdata_Photos($client, "Google-DevelopersGuide-1.0"); $entry = new Zend_Gdata_Photos_AlbumEntry(); $entry->setTitle($gp->newTitle($title)); $entry->setGphotoAccess($gp->newAccess("public")); $createdEntry = $gp->insertAlbumEntry($entry); return true; }