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; }
function _insertAlbum($data) { $new_access = $this->_service->newAccess(); $new_access->text = 'public'; $entry = new Zend_Gdata_Photos_AlbumEntry(); $entry->setGphotoAccess($new_access); $entry->setGphotoTimestamp($this->_service->newTimestamp((string) strtotime($data['date']) . '000')); $entry->setTitle($this->_service->newTitle($data['title'])); $entry = $this->_service->insertAlbumEntry($entry); return $entry ? $entry->getGphotoId() : false; }