Example #1
0
 public function get()
 {
     $tpl = new Template("pushedChronicle");
     $chronicleAdpater = new ChronicleAdapter($this->chronicle);
     $tpl->setVariables(array("chronicle" => $chronicleAdpater->getAsChronicleViewModel()));
     return $tpl->output();
 }
Example #2
0
 public function get()
 {
     $tplBook = new Template("wishedUserBook");
     // Prepare variables
     $viewBookLink = HTTPHelper::Link($this->book->getLink());
     $img = BookHelper::getSmallImageTag($this->book, $this->defImg);
     $bookTitle = $this->book->getTitle();
     $bookAuthors = "";
     if ($this->book->getContributors()) {
         $bookAuthors = sprintf("Auteur(s) : %s", $this->book->getOrderableContributors());
     }
     $isOffered = $this->userbook->getActiveGiftRelated() != null;
     $offerer = null;
     $deactivateGiftOptionLink = "";
     if ($isOffered) {
         $deactivateGiftOptionLink = HTTPHelper::Link(Urls::USERBOOK_GIFT_DISABLE, array("ubgid" => $this->userbook->getActiveGiftRelated()->getId()));
         $offerer = $this->userbook->getActiveGiftRelated()->getOfferer();
     }
     $bookDescription = $this->book->getDescription();
     $buyOnAmazonLink = $this->book->getAmazonUrl();
     $buyOnFnacLink = null;
     if ($this->book->getISBN13()) {
         $buyOnFnacLink = 'http://clic.reussissonsensemble.fr/click.asp?ref=751772&site=14485&type=text&tnb=3&diurl=http%3A%2F%2Feultech.fnac.com%2Fdynclick%2Ffnac%2F%3Feseg-name%3DaffilieID%26eseg-item%3D%24ref%24%26eaf-publisher%3DAFFILINET%26eaf-name%3Dg%3Fn%3Frique%26eaf-creative%3D%24affmt%24%26eaf-creativetype%3D%24affmn%24%26eurl%3Dhttp%253A%252F%252Frecherche.fnac.com%252FSearchResult%252FResultList.aspx%253FSCat%253D0%2525211%2526Search%253D' . $this->book->getISBN13() . '%2526Origin%253Daffilinet%2524ref%2524';
     }
     $setAsOfferedLink = HTTPHelper::Link(Urls::WISHED_USERBOOK_SET_AS_OFFERED, array("ubid" => $this->userbook->getId()));
     $subscribeLink = HTTPHelper::Link(Urls::SUBSCRIBE);
     // Set variables
     $tplBook->setVariables(array("bookTitle" => $bookTitle, "bookAuthors" => $bookAuthors, "viewBookLink" => $viewBookLink, "image" => $img, "isOffered" => $isOffered, "buyOnAmazonLink" => $buyOnAmazonLink, "buyOnFnacLink" => $buyOnFnacLink, "offerer" => $offerer, "setAsOfferedLink" => $setAsOfferedLink, "subscribeLink" => $subscribeLink, "deactivateGiftOptionLink" => $deactivateGiftOptionLink, "isConnected" => $this->getContext()->getConnectedUser()));
     return $tplBook->output();
 }
Example #3
0
 public function get()
 {
     $tpl = new Template("bookCoverFlip");
     // Set variables
     $tpl->setVariables(array("books" => $this->books, "title" => $this->title, "defaultImage" => $this->getContext()->getDefaultImage(), "coverFlipId" => $this->coverFlipId, "css" => $this->css));
     return $tpl->output();
 }
Example #4
0
 public function get()
 {
     $tpl = new Template("bookShelf");
     // Set variables
     $tpl->setVariables(array("books" => $this->books, "title" => $this->title, "defaultImage" => $this->getContext()->getDefaultImage()));
     return $tpl->output();
 }
 public function get()
 {
     $server = $this->request->getServer();
     $currentPage = "http://" . $server['HTTP_HOST'] . $server['REQUEST_URI'];
     $tpl = new Template("socialNetworksBar");
     $tpl->setVariables(array("imageUrlToPin" => $this->imageUrlToPin, "textToPin" => $this->textToPin, 'currentPage' => $currentPage));
     return $tpl->output();
 }
 public function get()
 {
     $baseTpl = "components/pressReviewsSubscriptionWidget";
     $tpl = new Template($baseTpl);
     $form = new PressReviewsSusbcriptionForm();
     $params = array("form" => $form);
     $tpl->setVariables($params);
     return $tpl->output();
 }
 public function get()
 {
     $baseTpl = "components/createChroniclesLinks";
     $tpl = new Template($baseTpl);
     $params = array();
     $params["groupUsers"] = $this->groupUsers;
     $tpl->setVariables($params);
     return $tpl->output();
 }
 public function get()
 {
     $baseTpl = "components/wishListSearchWidget";
     $tpl = new Template($baseTpl);
     $form = new WishListSearchForm();
     $params = array("form" => $form);
     $tpl->setVariables($params);
     return $tpl->output();
 }
 public function get()
 {
     $baseTpl = "components/autoPromoWishlistWidget";
     $tpl = new Template($baseTpl);
     $autoPromoWishListLink = HTTPHelper::Link(Urls::USER_FRIENDS_WISHLIST);
     $autoPromoWishListImage = $this->getContext()->getBaseUrl() . "Resources/images/homepage/auto-promo-wishlist.png";
     $autoPromoWishListTitle = __("Offrez un livre à vos amis", "s1b");
     $tpl->setVariables(array("autoPromoWishListTitle" => $autoPromoWishListTitle, "autoPromoWishListLink" => $autoPromoWishListLink, "autoPromoWishListImage" => $autoPromoWishListImage));
     return $tpl->output();
 }
Example #10
0
 public function get()
 {
     $baseTpl = "components/userLastEvents";
     $tpl = new Template($baseTpl);
     $params = array();
     $params["events"] = $this->events;
     $params["user"] = $this->user;
     $tpl->setVariables($params);
     return $tpl->output();
 }
Example #11
0
 public function get()
 {
     $tpl = new Template("chronicleDetail");
     // Get Social networks bar
     $imageUrlToPin = null;
     $textToPin = $this->chronicleViewModel->getTitle();
     if ($this->chronicleViewModel->getChronicleHasBook()) {
         $imageUrlToPin = $this->chronicleViewModel->getBook()->getLargeImageUrl();
     }
     $socialNetworksBar = new SocialNetworksBar($imageUrlToPin, $textToPin, $this->request);
     $tpl->setVariables(array("chronicle" => $this->chronicleViewModel, "socialNetworksBar" => $socialNetworksBar->get()));
     return $tpl->output();
 }
Example #12
0
 public function get()
 {
     $tpl = new Template("components/searchForm");
     $formAction = HTTPHelper::Link(Urls::BOOK_SEARCH_SUBMIT);
     $searchTermDef = "Titre, auteur, ISBN";
     $searchTerm = ArrayHelper::getSafeFromArray($_REQUEST, "searchTerm", $searchTermDef);
     $isConnected = false;
     if ($this->getContext()->getConnectedUser()) {
         $isConnected = true;
     }
     $tpl->setVariables(array("formAction" => $formAction, "searchTerm" => $searchTerm, "searchTermDef" => $searchTermDef, "isConnected" => $isConnected, "showSearchTermDef" => $this->showSearchTermDef));
     return $tpl->output();
 }
 public function get()
 {
     $baseTpl = "components/userWishedBooksWidget";
     $tpl = new Template($baseTpl);
     $params = array();
     $wishedBooks = UserBookDao::getInstance()->getListWishedBooks($this->user->getId(), -1, false);
     $params["wishedBooks"] = $wishedBooks;
     $params["isCurrentConnectedUser"] = $this->isCurrentConnectedUser;
     $params["user"] = $this->user;
     $params["defImage"] = $this->defImg;
     $tpl->setVariables($params);
     return $tpl->output();
 }
Example #14
0
 public function get()
 {
     $globalContext = \Sb\Context\Model\Context::getInstance();
     $tplHeader = new Template("header");
     $baseUrl = Urls::USER_LIBRARY;
     if ($globalContext->getIsShowingFriendLibrary()) {
         $baseUrl = Urls::FRIEND_LIBRARY;
     }
     $variables = array("allBooksUrl" => HTTPHelper::Link($baseUrl, array("key" => LibraryListKeys::ALL_BOOKS_KEY, "reset" => 1)), "borrowedBooksUrl" => HTTPHelper::Link($baseUrl, array("key" => LibraryListKeys::BORROWED_BOOKS_KEY, "reset" => 1)), "lendedBooksUrl" => HTTPHelper::Link($baseUrl, array("key" => LibraryListKeys::LENDED_BOOKS_KEY, "reset" => 1)), "wishedBooksUrl" => HTTPHelper::Link($baseUrl, array("key" => LibraryListKeys::WISHED_BOOKS_KEY, "reset" => 1)), "myBooksUrl" => HTTPHelper::Link($baseUrl, array("key" => LibraryListKeys::MY_BOOKS_KEY, "reset" => 1)), "friendLibrary" => false);
     if ($globalContext->getIsShowingFriendLibrary()) {
         $friend = UserDao::getInstance()->get($this->friendUserId);
         $variables["friendLibrary"] = true;
         $variables["friendUserName"] = $friend->getFirstName();
     }
     $tplHeader->setVariables($variables);
     $this->setActiveTab($tplHeader, $this->key);
     return $tplHeader->output();
 }
Example #15
0
 public function get()
 {
     $tpl = new Template("pushedChronicles");
     $tpl->setVariables(array("title" => $this->title, "chronicles" => $this->chronicles, "typeCSS" => $this->typeCSS, "link" => $this->link, "textLink" => $this->textLink));
     return $tpl->output();
 }
Example #16
0
 /**
  * @return mixed|string
  */
 public function get()
 {
     $lineIdx = 0;
     foreach (array_values($this->shownResults) as $book) {
         $lineIdx++;
         $addSep = true;
         if ($lineIdx == 1) {
             $addSep = false;
         }
         $bk = $book;
         $language = urlencode($bk->getLanguage());
         if ($bk->getImageUrl()) {
             $imgSrc = $bk->getImageUrl();
         } else {
             $imgSrc = $this->defImg;
         }
         // Utilisation de urlencode à la place htmlspecialchars car ce dernier pose des pbs qd la valeur est ensuite passée en post
         $title = $bk->getTitle();
         $titleEsc = urlencode($bk->getTitle());
         // encodé
         $author = $bk->getOrderableContributors();
         $authorEsc = urlencode($bk->getOrderableContributors());
         // encodé
         $id = $bk->getId();
         $isbn10 = $bk->getISBN10();
         $isbn13 = $bk->getISBN13();
         $asin = $bk->getASIN();
         $desc = StringHelper::tronque($bk->getDescription(), 350);
         $descEsc = urlencode($bk->getDescription());
         // encodé
         $smallImg = $bk->getSmallImageUrl();
         $img = $bk->getImageUrl();
         $largeImg = $bk->getLargeImageUrl();
         $pubEsc = "";
         $pubInfo = "";
         if ($bk->getPublisher()) {
             $pubEsc = urlencode($bk->getPublisher()->getName());
             // encodé
             $pubInfo = $bk->getPublicationInfo();
         }
         $pubDtStr = "";
         if ($book->getPublishingDate()) {
             $pubDtStr = $book->getPublishingDate()->format("Y-m-d H:i:s");
         }
         $amazonUrl = $book->getAmazonUrl();
         $nbOfPages = $book->getNb_of_pages();
         $cssClass = $lineIdx % 2 ? "lineA" : "lineB";
         $viewBookLink = null;
         $bookInDB = false;
         if ($bk->getId()) {
             $viewBookLink = HTTPHelper::Link($bk->getLink());
             $bookInDB = true;
         }
         $resultTpl = new Template('searchBook/resultRow');
         $resultTpl->setVariables(array('addSep' => $addSep, 'viewBookLink' => $viewBookLink, 'bookInDB' => $bookInDB, 'cssClass' => $cssClass . ' ' . ($bookInDB ? 'indb' : ''), 'title' => $title, 'publisher' => $pubInfo, 'author' => $author, 'id' => $id, 'isbn10' => $isbn10, 'isbn13' => $isbn13, 'asin' => $asin, 'titleEsc' => $titleEsc, 'descEsc' => $descEsc, 'desc' => $desc, 'smallImg' => $smallImg, 'img' => $img, 'largeImg' => $largeImg, 'imgSrc' => $imgSrc, 'authorEsc' => $authorEsc, 'pubEsc' => $pubEsc, 'pubDtStr' => $pubDtStr, 'amazonUrl' => $amazonUrl, 'language' => $language, 'nbOfPages' => $nbOfPages));
         $resultTplArr[] = $resultTpl;
     }
     $results = Template::merge($resultTplArr);
     $resultsTpl = new Template('searchBook/results');
     $resultsTpl->set("resultRows", $results);
     $links = $this->pagerLinks;
     $resultsTpl->set("links", $links['all']);
     $resultsTpl->set("first", $this->firstItemIdx);
     $resultsTpl->set("last", $this->lastItemIdx);
     $resultsTpl->set("nbItemsTot", $this->nbItemsTot);
     return $resultsTpl->output();
 }
Example #17
0
 public function get()
 {
     $tpl = new Template("bookPressReviews");
     $tpl->setVariables(array("pressReviews" => $this->pressReviews));
     return $tpl->output();
 }
Example #18
0
 public function get()
 {
     $tpl = new Template("chroniclesBlock");
     $tpl->setVariables(array("chronicles" => $this->chronicles, "title" => $this->title));
     return $tpl->output();
 }
 public function get()
 {
     $tpl = new Template("otherChroniclesSameType");
     $tpl->setVariables(array("chronicles" => $this->chronicles, "title" => __("Chroniques similaires", "s1b")));
     return $tpl->output();
 }