コード例 #1
0
ファイル: Controler.class.php プロジェクト: cmahneke/origin
 /**
  * @brief Méthode qui appelle la vue d'affichage de la page d'une oeuvre
  * @access private
  * @return void
  */
 private function oeuvre()
 {
     $oeuvre = new Oeuvre();
     $oeuvreAffichee = $oeuvre->getOeuvreById($_GET["o"]);
     $commentaire = new Commentaire();
     $commentairesOeuvre = $commentaire->getCommentairesByOeuvre($_GET["o"], $this->langueAffichage);
     $classement = $commentaire->getClassementOeuvre($_GET["o"]);
     $photo = new Photo();
     $photosOeuvre = $photo->getPhotosByOeuvre($_GET["o"], false);
     if (isset($_GET['action']) && $_GET['action'] == 'envoyerPhoto') {
         $msgInsertPhoto = $photo->ajouterPhoto($_GET["o"], false, "oeuvre");
     } else {
         $msgInsertPhoto = null;
     }
     if (isset($_GET['action']) && $_GET['action'] == 'envoyerCommentaire') {
         if (isset($_SESSION["idUsager"])) {
             $usager = $_SESSION["idUsager"];
         } else {
             $usager = 1;
             //id usager anonyme
         }
         $msgInsertCommentaire = $commentaire->ajoutCommentairesByOeuvre($_POST['idOeuvreencours'], $this->langueAffichage, $_POST['commentaireAjout'], $_POST['vote'], $usager, false);
     } else {
         $msgInsertCommentaire = null;
     }
     $artiste = new Artiste();
     $artistesOeuvre = $artiste->getArtistesbyOeuvreId($_GET["o"]);
     $this->oVue = new VueOeuvre();
     $this->oVue->setDataGlobal('oeuvre', "page d'une oeuvre", $this->langueAffichage, $this->pOeuvre);
     $this->oVue->setData($oeuvreAffichee, $commentairesOeuvre, $photosOeuvre, $artistesOeuvre, $classement, $this->langueAffichage);
     $this->oVue->setMsgPhoto($msgInsertPhoto);
     $this->oVue->setMsgCommentaire($msgInsertCommentaire);
     $this->oVue->afficherMeta();
     $this->oVue->afficherEntete();
     $this->oVue->afficherBody();
     $this->oVue->afficherPiedPage();
 }