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