Пример #1
0
 /**
  * function to provide the upload-View
  */
 function sync()
 {
     JSession::checkToken();
     $app = JFactory::getApplication();
     $username = JRequest::getString('username');
     $key = JRequest::getString('key');
     $albums = EventgalleryHelpersImageHelper::picasaweb_ListAlbums($username, $key);
     /**
      * @var EventgalleryModelPicasasync $model
      */
     $model = $this->getModel();
     $albumsAdded = 0;
     foreach ($albums as $album) {
         if (!$model->eventExists($album->folder)) {
             $model->addEvent($album);
             $albumsAdded++;
         }
     }
     $app->enqueueMessage(JText::sprintf('COM_EVENTGALLERY_PICASASYNC_DONE', $albumsAdded));
     $this->display();
 }