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

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 $modelCategory = new Default_Model_DbTable_ProjectCategory();
0023 $this->dataCategory = $modelCategory->findSingleRow($this->cat_id);
0024 $store_config = Zend_Registry::get('store_config');
0025 $host = $store_config->host;
0026 $og_server = $this->serverUrl(true);
0027 $catTitle = '';
0028 if($this->dataCategory['project_category_id'])
0029 {
0030   $catTitle = $this->dataCategory['title'];
0031 }
0032 if($this->filters['order'] == 'latest'){
0033   $og_title = 'Browse '.$catTitle.' Latest | '.$host;
0034 }else if($this->filters['order'] == 'top'){
0035   $og_title = 'Browse '.$catTitle.' Top | '.$host;
0036 }else{
0037   $og_title='Browse '.$catTitle.' | '.$host;
0038 }
0039 $og_description = $og_title .'| A community for free and open source software and libre content';
0040 $this->templateConfigData = Zend_Registry::get('store_template');
0041 $og_image = 'https://' . $_SERVER['HTTP_HOST'] .$this->templateConfigData['logo'];
0042 $this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA);
0043 $this->headMeta()->appendProperty('og:type', 'website');
0044 $this->headMeta()->appendProperty('og:url', $og_server);
0045 $this->headMeta()->appendProperty('og:title', $og_title);
0046 $this->headMeta()->appendProperty('og:site_name',$host);
0047 $this->headMeta()->appendProperty('og:description',$og_description);
0048 $this->headMeta()->appendProperty('og:image',$og_image);
0049 
0050 
0051 $helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
0052 $modelInfo = new Default_Model_Info();
0053 
0054 $this->countSupporters = $modelInfo->getCountAllSupporters();
0055 $this->supporters = $modelInfo->getNewActiveSupporters(7);
0056 $this->headLink()->appendStylesheet('/theme/flatui/css/explore_index.css');
0057 
0058 
0059 if($this->inputFilterOriginal ==1)
0060 {
0061     $checkedOriginal = ' checked';
0062 }else
0063 {
0064    $checkedOriginal = '';
0065 }
0066 
0067 ?>
0068 
0069 <style>
0070 
0071   @media (max-width:720px){
0072 
0073     body > .panel.panel-default.pull-left {
0074       max-width: 100%;
0075       overflow-y: hidden;
0076     }
0077 
0078     #explore-content .GridFlex .content {
0079       padding-right: 15px;
0080       min-width: 400px;
0081     }
0082 
0083     #explore-content .GridFlex .sidebar-right {
0084       width: 400px;
0085       flex: none !important;
0086       margin: 0 auto;
0087     }
0088 
0089     #explore-content .GridFlex .content .explore-products {
0090       padding: 0 !important;
0091     }
0092 
0093     .explore-products .product-list .explore-product {
0094       position: relative;
0095       padding-left: 20px;
0096       padding-right: 50px;
0097     }
0098 
0099     .explore-products .product-list .explore-product > .col-xs-1 {
0100       position: absolute;
0101       top: 10px;
0102       left: 10px;
0103       padding: 0;
0104     }
0105 
0106     .explore-products .product-list .explore-product .explore-product-imgcolumn {
0107       width: 20%;
0108     }
0109 
0110     .explore-products .product-list .explore-product .explore-product-details {
0111       width: 80%;
0112     }
0113 
0114     .explore-products .product-list .explore-product .explore-product-plings {
0115       position: absolute;
0116       top: 10px;
0117       right: 0;
0118       width: 50px;
0119     }
0120 
0121     .explore-products .product-list .explore-product .explore-product-plings .rating {
0122       width: 100%;
0123     }
0124 
0125     .pling-nav-tabs ul.nav-tabs>li:last-child {
0126       float: right;
0127       padding: 10px;
0128       font-size: 12px;
0129     }
0130 
0131     #explore-content .sidebar-right-info .prod-widget-box {
0132       width: 100%;
0133     }
0134 
0135   }
0136 
0137   @media (max-width:611px){
0138     #explore-content .GridFlex .content {
0139       padding-right: 0;
0140       min-width: 100%;
0141     }
0142 
0143     #explore-content .GridFlex .sidebar-left {
0144       flex: none !important;
0145       width: 100%;
0146     }
0147 
0148     #explore-content .GridFlex .sidebar-right {
0149       flex: none !important;
0150       width: 100%;
0151       padding: 0;
0152     }
0153   }
0154 
0155   .filter_browse_tag_group {
0156       margin-right: 5px;
0157   }
0158 
0159 </style>
0160 <link href="/theme/react/product-browse/style/music-player.css" rel="stylesheet" type="text/css"/>
0161 <link href="/theme/react/assets/css/product-browse.css" rel="stylesheet" type="text/css"/>
0162 <main id="explore-content">
0163     <section class="wrapper" id="products-wrapper">
0164     <span class="glyphicon  togglesidebar" id="btnTogglesidebar" ></span>
0165     <div class="GridFlex">
0166       <div class="GridFlex-cell sidebar-left" >
0167           <?php  $time_start = microtime(true);echo $this->render('explore/partials/filter.phtml'); $time_elapsed = microtime(true) - $time_start; ?>
0168           <?php if(Zend_Auth::getInstance()->hasIdentity() AND Zend_Auth::getInstance()->getIdentity()->roleName == 'admin') {
0169              echo '<div class="alert alert-warning" role="alert"><strong>Rendering Time: </strong>'.$time_elapsed.' s</div>';
0170           }?>
0171       </div>
0172       <div class="GridFlex-cell content">
0173         <div id="product-browse-container"></div>
0174       </div>
0175         <?php
0176         $time_start = microtime(true);
0177             $this->comments = $modelInfo->getLatestComments(5, $this->cat_id, $this->tags);
0178             //$donations = $modelInfo->getLatestPlings(5, $this->cat_id);
0179             $topprods = $modelInfo->getMostDownloaded(100, $this->cat_id, $this->tags);
0180             $asidehide = '';
0181             if(!$this->catabout && count($this->comments)==0  && count($topprods)==0 )
0182             {
0183                 $asidehide = 'hide';
0184             }
0185             $this->show_git = false;
0186         ?>
0187         <div class="GridFlex-cell sidebar-right">
0188             <aside  id="explore-sidebar <?=$asidehide?>" >
0189               <?php
0190                   echo $this->render('/home/partials/common_rightsidebar.phtml');
0191               ?>
0192 
0193               <div  class="row sidebar-right-info" >
0194                 <?php
0195                 if (count($topprods) > 0) {
0196                     ?>
0197                     <span class="commentTitle"> Popularity <span class="small light"> (based on plings, downloads, etc.)</span></span>
0198 
0199                     <div class="prod-widget-box right bgwhite" id="mostdownloaded">
0200                         <?php
0201                         $this->rownum = 1;
0202                         foreach ($topprods as $this->product) {
0203                             echo $this->render('explore/partials/productTop.phtml');
0204                             $this->rownum++;
0205                         }
0206                         ?>
0207                     </div>
0208                 <?php } ?>
0209 
0210               </div>
0211           </aside>
0212             <?php
0213             $time_elapsed = microtime(true) - $time_start;
0214             if(Zend_Auth::getInstance()->hasIdentity() AND Zend_Auth::getInstance()->getIdentity()->roleName == 'admin') {
0215                 echo '<div class="alert alert-warning" role="alert"><strong>Rendering Time: </strong>'.$time_elapsed.' s</div>';
0216             }?>
0217         </div>
0218       </div>
0219       </section>
0220 
0221       <div class="tooltip_templates" style="display: none">
0222       <span id="tooltip_content">
0223           <i class="fa fa-spinner"></i>
0224       </span>
0225   </div>
0226 </main>
0227 <script type="text/javascript">
0228   var categories = <?php echo $this->categoriesJson ?>;
0229   var catId = <?php echo $this->cat_idJson ?>;
0230   var filters = <?php echo $this->filtersJson ?>;
0231   var products = <?php echo $this->productsJson ?>;
0232   var topProducts = <?php echo $this->topprodsJson ?>;
0233   var comments = <?php echo $this->commentsJson ?>;
0234   var supporters = <?php echo json_encode($this->supporters) ?>;
0235   var pagination = {
0236     totalcount:<?php echo $this->totalcount ?>,
0237     page:<?php echo $this->page ?>,
0238     pagelimit:<?php echo $this->pageLimit ?>
0239   }
0240   var view = "explore";
0241   
0242   var browseListType = "<?php echo $this->browseListType ?>";
0243 
0244 </script>
0245 <script type="text/javascript" src="/theme/react/product-browse/product-browse.js"></script>
0246 <?php $this->inlineScript()->appendScript(
0247     '    $(document).ready(function(){
0248             TooltipUser.setup("tooltipuserleft","left");
0249             TooltipUser.setup("tooltipuser","right");
0250             FilterBrowseOriginalFn.setup();
0251             FilterBrowseTagGroupFn.setup();
0252         });
0253     ');