Пример #1
0
 public function galleryRssFeed()
 {
     checkUnauthorizedAccess();
     $galleryID = getIdFromURL();
     checkIntValueOfId($galleryID);
     $gallery = GalleryRepository::getByID($galleryID);
     if ($gallery == null) {
         redirect(\route\Route::get("errorPage")->generate());
     }
     $photos = PhotoRepository::getPhotosByGalleryID($galleryID);
     $title = $gallery['title'];
     $link = "http://192.168.56.101/TwitterApp/gallery/" . $galleryID;
     $description = "Images in selected gallery.";
     generateGalleryRss($title, $link, $description, $photos);
 }
Пример #2
0
 public function action()
 {
     $id = getIdFromURL();
     $user = UserRepository::getUserByID($id);
     checkRequestURL($id, $user);
     $tweets = TweetRepository::getMyTweets($id);
     $userGalleries = GalleryRepository::getUserGalleries($id);
     $userPhotos = array();
     foreach ($userGalleries as $gallery) {
         $photos = PhotoRepository::getPhotosByGalleryID($gallery['galleryid']);
         foreach ($photos as $photo) {
             array_push($userPhotos, $photo);
         }
     }
     $main = new Main();
     $body = new \templates\TwitterWall();
     $body->setTweets($tweets)->setUserPhotos($userPhotos);
     echo $main->setPageTitle("TwitterApp")->setBody($body);
 }
Пример #3
0
 /**
  * Opens selected gallery, shows gallery icon, title and date of creation.
  * Also provides option of adding a new photo to gallery.
  */
 public function action()
 {
     checkUnauthorizedAccess();
     $id = \dispatcher\DefaultDispatcher::instance()->getMatched()->getParam("id");
     if (null === $id) {
         redirect(\route\Route::get("errorPage")->generate());
     }
     if (intval($id) < 1) {
         redirect(\route\Route::get("errorPage")->generate());
     }
     $gallery = GalleryRepository::getByID($id);
     if ($gallery == null) {
         redirect(\route\Route::get("errorPage")->generate());
     }
     $main = new Main();
     $body = new \templates\ViewGallery();
     $photos = PhotoRepository::getPhotosByGalleryID($id);
     $gallery = GalleryRepository::getByID($id);
     $body->setGalleryID($id)->setPhotos($photos)->setGallery($gallery);
     $main->setBody($body)->setPageTitle("View gallery");
     echo $main;
 }