示例#1
0
 public static function getNewsStreamHtml($newsList, $module)
 {
     $html = '<div class="spine"></div><ul class="columns">';
     $count = 0;
     foreach ($newsList as $post) {
         //récupère les infos sur l'auteur du post / News
         $where = array('_id' => $post['author']);
         $author = PHDB::findOne(PHType::TYPE_CITOYEN, $where);
         $color = "white";
         $color = NEWS::get_GENRE_COLOR($post['genre']);
         //$html .=  "<div class='post'>";
         $html .= "<li>" . '<div class="timeline_element partition-white">';
         $html .= "<div class='info_author_post'>";
         //PHOTO PROFIL
         $html .= "<div class='pic_profil_author_post'>" . "<img class='img_profil_round'  src='" . Yii::app()->theme->baseUrl . "/assets/images/avatar-1.jpg' height=55>" . "</div>";
         //ICO TYPE ACCOUNT
         $html .= "<div class='ico_type_account_author_post'>" . "</div>";
         //PSEUDO AUTHOR
         if (isset($author['name'])) {
             $html .= "<a href='' class='pseudo_author_post'>" . $author['name'] . "</a>";
         }
         //CITY AUTHOR
         if (isset($author['cp'])) {
             $html .= "<a href class='city_author_post'>- " . $author['cp'] . "</a>";
         }
         $html .= "</div>";
         //info_author_post
         $html .= "<div class='header_post " . $color . "'>";
         //IL Y A
         $html .= "<div class='ilya' style='float:left; max-width:100%; min-width:100%;'>" . "<center><i class='fa fa-clock-o'></i>" . "</br>il y a 18 minutes<center>" . "</div>";
         //ILLUSTRATION POST
         //if(isset($post['id_illustration']))
         if ($count == 0) {
             $html .= "<div style='float:left; max-width:100%; min-width:100%;'>" . "<center><img src='" . $module . "/images/news/test_illu/illu_test.jpg' class='illustration_post'/></center>" . "</div>";
         }
         $count++;
         $html .= "</div>";
         //GENRE
         $html .= "<div class='nature_post'>" . "<img src='" . $module . "/images/news/natures/" . $post['genre'] . ".png' class='img_illu_publication_nature' style='margin-top:0px;' title='nature du message : " . News::get_NATURES_NAMES($post['genre']) . "' id='" . $post['genre'] . "' height=50>" . "</div>";
         //FAVORITES
         $html .= "<a href='' class='btn_circle_post' id='btn_circle_favorites' style='margin-left:12px; color:#23D1B9'>" . "<i class='fa fa-star' title='garder en favoris'></i>" . "</a>";
         //ARLERT MODERATION
         $html .= "<a href='' class='btn_circle_post' id='btn_circle_moderation' style='color:#E66B6B'>" . "<i class='fa fa-bell' title='signaler le contenu'></i>" . "</a>";
         //LIST THEMES
         $html .= "<div class='list_themes_post'>";
         if (isset($post['about'])) {
             foreach ($post['about'] as $theme) {
                 $html .= "<div class='theme_post'>" . "<img src='" . $module . "/images/news/themes/" . $theme . ".png' class='img_illu_publication_theme' title='thème : " . News::get_THEMES_NAMES($theme) . "' id='" . $theme . "' style='margin-top:0px;' height=30>" . "</div>";
             }
         }
         $html .= "</div>";
         $html .= "<div class='panel-title' style='float:left; min-width:100%;'>" . "<h4 style='font-size:15px; margin:0px; margin-left:10px; padding:0px;'><b>" . News::get_NATURES_NAMES($post['genre']) . "</b></h4>" . "</div>";
         //TITLE
         if (isset($post['name'])) {
             $html .= "<div class='panel-title' style='float:left; min-width:100%;'>" . "<h3 style='font-size:18px; margin:0px; margin-left:10px; padding:0px;'>" . $post['name'] . "</h3>" . "</div>";
         }
         //CONTENT
         if (isset($post['text'])) {
             $html .= "<div class='panel-body' style='float:left;  margin-bottom:10px;'><p>" . $post['text'] . "</p></div>";
         }
         //BAR TOOL
         $html .= "<div class='bar_tools_post'>" . "<ul>\t\n\t\t\t\t\t\t<li><a href=''>j'aime</a></li>\n\t\t\t\t\t\t<li><a href=''>partager</a></li>\t\t\t\t\t\t\n\t\t\t\t</ul>" . "<ul style='float:left;'>" . "<li style='float:left; margin-top:2px;'>10 <i class='fa fa-comment'></i></span></li>" . "<li style='float:left; margin-top:2px;'>10 <i class='fa fa-thumbs-up'></i></span></li>" . "<li style='float:left; margin-top:2px;'>10 <i class='fa fa-share-alt'></i></span></li>" . "<li style='float:left; margin-top:2px;'>10 <i class='fa fa-eye'></i></span></li>" . "</ul>" . "</div>";
         //$html .= "</div>"; //post
         $html .= "</li>";
         //post
     }
     $html .= '</ul>';
     return $html;
 }