File indexing completed on 2025-05-04 05:29:29

0001 <?php 
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 $pageCount = $this->comments->count();
0024 
0025 $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
0026 $helperFetchSubcategoriesForProduct = new Default_View_Helper_FetchCategoriesForProductAsString();
0027 $helperPrintDate = new Default_View_Helper_PrintDate();
0028 ?>
0029 <div  id="my-comments-tabs">
0030     <div id="my-comments-tabs-content">
0031     <div style="text-align:right">
0032     <small >        
0033         <?php
0034         if ($pageCount > 1) {
0035             echo $this->paginationControl($this->comments, 'Sliding', '/partials/paginationControlBootstrap.phtml', array('params' => array(), 'dom_target' => 'div#my-comments-tabs-content'));
0036         }
0037         ?>
0038     </small>        
0039     </div>
0040 
0041 
0042     <?php 
0043 
0044        $this->result = array();                                                
0045         foreach ($this->comments as $element) {
0046             $this->result[$element['project_id']][] = $element;
0047         }    
0048 
0049         foreach($this->result as $this->projects){                                                            
0050             $i = 0;
0051             foreach($this->projects as $file){  
0052                 $file=(object)$file; 
0053                 if($i==0){
0054         ?>
0055                 <div class="productrow">
0056 
0057                 <div class="row smaller " >
0058                   <div class="col-lg-5 col-md-5">
0059                       <figure>
0060                           <img src="<?php echo $this->Image($file->image_small, array('width' => 80, 'height' => 80)); ?>" class="project-image" />
0061                       </figure>   
0062                       <div>
0063                           <a href="<?= $this->buildProductUrl($file->project_id) ?>"><?=$file->title?></a>
0064                           <p><?=$file->cat_title?> 
0065                           
0066                           <span class="cntComments">
0067                           <?php               
0068                               $count_comments = $file->count_comments;                             
0069                               echo ($count_comments>0 ? $count_comments.' comment':'').($count_comments>1?'s':'');            
0070                           ?>
0071                           </span>
0072                          
0073                       </div>
0074                   </div>      
0075                               
0076                   <div class="col-lg-2 col-md-2" style="white-space: nowrap; padding-top: 15px">         
0077                        by <a  href="<?php echo $this->buildMemberUrl($file->username); ?>" class="tooltipuser" data-tooltip-content="#tooltip_content" data-user="<?=$file->project_member_id?>">
0078                        <?=$file->username?></a>
0079                   </div>
0080 
0081                   <div class="col-lg-2 col-md-2">             
0082                       <div class="rating text-center" >               
0083                           <?php                
0084                                   $this->widgetRating = new stdClass();
0085                                   $this->widgetRating->project_id =$file->project_id;
0086                                   $this->widgetRating->laplace_score = $file->laplace_score;
0087                                   $this->widgetRating->count_likes =$file->count_likes; 
0088                                   $this->widgetRating->count_dislikes =$file->count_dislikes;
0089                                   echo $this->render('partials/widgetRating.phtml'); 
0090                           ?>          
0091                          
0092                       </div>          
0093                        <span class="time"><?=$this->printDate($file->changed_at==null?$file->created_at:$file->changed_at)?>
0094                           </span>  
0095                   </div>
0096 
0097                 
0098                 </div>
0099 
0100 
0101 
0102                 <div class="row">
0103                                 <div class="col-lg-12 commenttext">                                 
0104                                     <?php 
0105                                         $comment_text = Default_Model_HtmlPurify::purify($file->comment_text);
0106                                     ?>
0107                                     <?= nl2br($file->comment_text,true) ?>                                    
0108                                   
0109                                     <span class="createat"> - <?= $helperPrintDate->printDate($file->comment_created_at); ?> </span>
0110                                     </div>
0111                                     
0112                 </div>
0113 
0114         <?php
0115                         }else{
0116             ?>
0117                     <div class="row">
0118                                 <div class="col-lg-12 commenttext">                                 
0119                                     <?php 
0120                                         $comment_text = Default_Model_HtmlPurify::purify($file->comment_text);
0121                                     ?>
0122                                     <?= nl2br($file->comment_text,true) ?>                                    
0123                                   
0124                                     <span class="createat"> - <?= $helperPrintDate->printDate($file->comment_created_at); ?> </span>
0125                                     </div>
0126                                     
0127                 </div>
0128         <?php
0129                 }   // end of else if                                                                                       
0130                 $i++;                                                                            
0131             }
0132 
0133             echo '</div> <!--productrow-->';
0134         }
0135 
0136         ?>
0137 
0138         <div style="text-align:right">
0139         <small >        
0140             <?php
0141             if ($pageCount > 1) {
0142                 echo $this->paginationControl($this->comments, 'Sliding', '/partials/paginationControlBootstrap.phtml', array('params' => array(), 'dom_target' => 'div#my-comments-tabs-content'));
0143             }
0144             ?>
0145         </small>        
0146         </div>
0147 
0148     </div>
0149 </div>