File indexing completed on 2024-12-29 05:24:39

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 $cntActive = 0;
0024  foreach ($this->ratings as $this->productRating) { 
0025   if($this->productRating['rating_active']==1) $cntActive =$cntActive+1;
0026  }
0027 ?>
0028 
0029 <button id="showRatingAll" class="pull-right bbtn btn-default btnRateFilter">Show all Reviews (<?=count($this->ratings) ?>)</button>
0030 <button id="showRatingActive" class="pull-right bbtn btn-default btnRateFilter activeRating">Show Active Reviews (<?=$cntActive ?>)</button>
0031 <button id="showRatingUpvotes" class="pull-right bbtn btn-default btnRateFilter">Show (<?=$this->product->count_likes ?>) <span class="glyphicon glyphicon-thumbs-up " style="color:green"> </span></button>
0032 <button id="showRatingDownvotes" class="pull-right bbtn btn-default btnRateFilter">Show (<?=$this->product->count_dislikes ?>)  <span class="glyphicon glyphicon-thumbs-down " style="color:red"> </span></button>
0033 <span class="glyphicon glyphicon-refresh spinning" style="float: right; display: none"></span>
0034 <?php  foreach ($this->ratings as $this->productRating) {
0035   ?>
0036 <div class="productRating-rows <?=$this->productRating['rating_active']==0?'productRating-rows-inactive':'productRating-rows-active'?>  <?=$this->productRating['user_like']==1?'clsUpvotes':'clsDownvotes' ?> "  >
0037   <h3 class="product-heading product-update-heading" >
0038   <a href="<?php echo $this->buildMemberUrl($this->productRating['username']); ?>"> 
0039   <img class="userimg"  
0040           src="<?= $this->Image(($this->productRating['profile_image_url']==null)?'hive/user-pics/nopic.png':$this->productRating['profile_image_url'],
0041                                                   array('width' => 40, 'height' => 40)) ?>"
0042                                                    alt="product-maker" 
0043                                                   />
0044     </a>
0045   <span>  
0046     <a href="<?php echo $this->buildMemberUrl($this->productRating['username']); ?>">
0047     <?=$this->productRating['username'] ?> 
0048     </a>
0049   </span>
0050     <span class="small light lightgrey product-update-date"> <?=$this->printDate($this->productRating['created_at']) ?> </span>
0051     <span> <?php 
0052       
0053       if($this->productRating['member_id']==0 ){
0054            // import from Hive sum vote
0055            if($this->productRating['user_dislike']>0) echo '<span class="glyphicon glyphicon-thumbs-down o-thumbs-down"> </span>'.$this->productRating['user_dislike'];
0056            if($this->productRating['user_like']>0) echo '<span class="glyphicon glyphicon-thumbs-up o-thumbs-up"> </span>'.$this->productRating['user_like'];
0057            
0058       }else{
0059         if($this->productRating['user_like']==1 ){
0060              echo '<span class="glyphicon glyphicon-thumbs-up o-thumbs-up"> </span>';
0061         }else{
0062              echo '<span class="glyphicon glyphicon-thumbs-down o-thumbs-down"> </span>';   
0063         }   
0064       }
0065 
0066     ?> </span>
0067   </h3>
0068   <span style="padding-left: 45px"> 
0069     <?=$this->productRating['comment_text'] ?> 
0070   </span>
0071 </div>
0072 <?php } ?>
0073 
0074 <?php
0075 $this->inlineScript()->appendScript(
0076     '    $(document).ready(function(){            
0077             productRatingToggle.setup();
0078         });
0079     ');