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  // product detail pling single project button  
0024 $plings = new Default_Model_DbTable_ProjectPlings();            
0025 $cntplings = count($plings->getPlings($this->project_id));
0026 $isPlinged = false;
0027 $member_id = null;
0028 $isSupporter = false;
0029 if($this->authMember){
0030   $member_id = $this->authMember->member_id;
0031   $tmp = $plings->getPling($this->project_id,$member_id);
0032       if($tmp)
0033       {
0034             $isPlinged = true;
0035       }
0036       $isSupporter = $this->isSupporter($member_id);
0037 }
0038 
0039 $heartatt = '';     
0040 $urlUserFollows = $this->buildProductUrl($this->project_id, 'plingproject');
0041 
0042 $heartatt = $heartatt. 'role="button" data-fragment=""  '
0043         .' data-target="#container-pling'.$this->project_id.'"'
0044         .' data-href="'.$urlUserFollows.'"'
0045                          .' data-issupporter="'.$isSupporter.'"'                         
0046         .' data-auth="'.$member_id.'"';
0047 $out ='<div role="button" class="partialbuttonplingproject" '.$heartatt.' style="display:flex; align-items: center; justify-content: center;">';
0048  $out = $out. '<span class="plingtext  "  ><span class="plingnum"> '.$cntplings.'</span> Plings  </span>';
0049  if ($isPlinged){     
0050       $out = $out.'<span class="plingcircle active">p</span>';           
0051  }else{                  
0052       $out = $out.'<span class="plingcircle ">p</span>';     
0053  }
0054 
0055 
0056  $out = $out.'</div>';
0057 echo $out;
0058 ?>
0059 
0060 
0061 <style type="text/css">
0062       div.projectdtailHeart{
0063             float: right;           
0064             z-index: 100;
0065             
0066           
0067            
0068         }
0069          .container-pling{
0070               position: relative;              
0071             }
0072         
0073          .partialbuttonplingproject
0074         {
0075           text-align: center;
0076 
0077         }
0078 
0079         span.plingcircle{
0080             width: 40px;
0081             height: 40px;
0082             background-color: #fff;
0083             border: 3px solid #C8C8C8;
0084             border-radius: 50%;
0085            
0086             font-size: 20px;
0087             text-align: center;
0088             color: #C8C8C8;
0089             font-weight: bold;
0090             transform: rotate(345deg);
0091             display: block;
0092             float: right;
0093           
0094         }
0095         span.active{
0096             border: 3px solid #EE6E09;
0097              color: #EE6E09;
0098         }
0099 
0100         span.plingtext{
0101         
0102           padding-right: 15px;
0103         }
0104 
0105 </style>