Esempio n. 1
0
 private static function PCWho($data)
 {
     //		echo "Chi Siamo";
     require_once 'post/PostManager.php';
     $p = PostManager::loadPost(self::$WHO_POST, false);
     if ($p !== false) {
         require_once 'post/PostPage.php';
         self::$post_options[PostPage::SHORT] = true;
         self::$post_options[PostPage::NO_COMMENTS] = true;
         self::$post_options[PostPage::NO_CATEGORIES] = true;
         self::$post_options[PostPage::NO_TAGS] = true;
         self::$post_options[PostPage::NO_MODIF_DATE] = true;
         PostPage::showPost($p, self::$post_options);
         self::$post_options[PostPage::SHORT] = false;
         self::$post_options[PostPage::NO_COMMENTS] = false;
         self::$post_options[PostPage::NO_TAGS] = false;
         self::$post_options[PostPage::NO_MODIF_DATE] = false;
     }
 }
Esempio n. 2
0
 static function loadCollection($id)
 {
     return PostManager::loadPost($id);
 }
Esempio n. 3
0
 /**
  * Crea un post;
  * Associa al post un voto (lo crea);
  * Cancella il voto dal database;
  * Carica il post e cerca di caricare il voto;
  * Controlla che il post non abbia quel voto e di non essere riuscito a caricare il voto;
  */
 function testDeleteVote()
 {
     $data = $this->post_data_all;
     $p = PostManager::createPost($data);
     $p1 = PostManager::votePost($this->author_id, $p, $this->vote_value);
     if (count($p1->getVotes()) == 0) {
         return "<br />Vote deleting test NOT PASSED: not added";
     }
     $votes = $p1->getVotes();
     $vote = PostManager::loadVote($votes[0]->getAuthor(), $votes[0]->getPost());
     $post = PostManager::loadPost($p1->getId());
     if ($vote !== false && $post !== false) {
         $vote = PostManager::removeVote($vote);
         $post = PostManager::loadPost($post->getID());
         $vote = PostManager::loadVote($vote->getAuthor(), $vote->getPost());
         if ($post !== false && $vote === false) {
             if (count($post->getVotes()) == 0) {
                 return "<br />Vote deleting test passed";
             }
         }
     }
     return "<br />Vote deleting test NOT PASSED: not deleted";
 }