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

0001 <?php
0002 $filterScore = $this->ls ? 'laplace_score:['.$this->ls.' TO '.($this->ls+9).']':null;
0003 $filterCat = $this->pci ? 'project_category_id:('.$this->pci.')' : null;
0004 $filterTags = $this->t ? 'tags:('.$this->t.')' : null;
0005 $filterPkg = $this->pkg ? 'package_names:('.$this->pkg.')' : null;
0006 $filterArch = $this->arch ? 'arch_names:('.$this->arch.')' : null;
0007 $filterLic = $this->lic ? 'license_names:('.$this->lic.')' : null;
0008 $store = $this->store;
0009 $param = array('q' => $this->searchText ,'store'=>$store,'page' => $this->page, 'count' => 10, 'qf' => $this->searchField, 'fq' => array($filterCat, $filterScore, $filterTags,$filterPkg,$filterArch,$filterLic));
0010 
0011 $modelSearch = new Default_Model_Solr();
0012 try {
0013     $this->result = $modelSearch->search($param);
0014 } catch (Exception $e) {
0015     Zend_Registry::get('logger')->err(__FILE__.'('.__LINE__.') -- params: '.print_r($param, true)."\n".' message: '."\n".$e->getMessage());
0016 
0017     $this->result = array('hits' => array(), 'highlighting' =>array(),'response' => array('numFound' => 0));
0018 }
0019 $this->pagination = $pagination = $modelSearch->getPagination();
0020 $this->products = $this->result['hits'];
0021 
0022 $this->highlighting = $this->result['highlighting'];
0023 
0024 $this->headTitle('Search: '.$this->searchText, 'SET');
0025 
0026 $helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
0027 $modelInfo = new Default_Model_Info();
0028 $this->headLink()->appendStylesheet('/theme/flatui/css/explore_index.css');
0029 $this->countSupporters = $modelInfo->getCountAllSupporters();
0030 $this->supporters = $modelInfo->getNewActiveSupporters(18);
0031 
0032 ?>
0033 <main id="explore-content" class="searchresults">
0034     <section class="wrapper" id="products-wrapper">
0035         <span class="glyphicon  togglesidebar" id="btnTogglesidebar" ></span>
0036         <div class="GridFlex">
0037             <div class="GridFlex-cell sidebar-left" >
0038                 <?php  $time_start = microtime(true);echo $this->render('product/partials/searchFilter.phtml'); $time_elapsed = microtime(true) - $time_start; ?>
0039                 <?php if(Zend_Auth::getInstance()->hasIdentity() AND Zend_Auth::getInstance()->getIdentity()->roleName == 'admin') {
0040                     echo '<div class="alert alert-warning" role="alert"><strong>Rendering Time: </strong>'.$time_elapsed.' s</div>';
0041                 }?>
0042             </div>
0043             <div class="GridFlex-cell content">
0044                 <section class="explore-products" id="explore-products">
0045 
0046                     <h1 class="search-heading">Search results for "<?= $this->searchText; ?>"</h1>
0047 
0048                     <ul id="sort" class="nav nav-tabs">
0049                         <li class="text-right" style="text-align: right; width: 50%; float: right;">
0050                             <small><?=$this->result['response']['numFound']?> hit(s)</small>
0051                         </li>
0052                     </ul>
0053 
0054                     <div class="product-list">
0055                         <?php
0056                         if (count($this->products) == 0) { ?>
0057                             <p>Your search - <?=$this->searchText?> - did not match any documents.</p>
0058 
0059                             <p>Suggestions:
0060                             <ul>
0061                             <li>Make sure all words are spelled correctly.</li>
0062                             <li>Try keywords which are min 3 characters long.</li>
0063                             <li>Try different keywords.</li>
0064                             <li>Try more general keywords.</li>
0065                             <li>Try fewer keywords.</li>
0066                             <li>Use key words which start without wildcard symbols like "*" or "?".</li>
0067                             </ul>
0068                         <?php
0069                         } else {
0070                             $time_start = microtime(true);
0071                             echo $this->render('product/partials/listProducts.phtml');
0072                             $time_elapsed = microtime(true) - $time_start;
0073                         }
0074                         ?>
0075                         <?php if(Zend_Auth::getInstance()->hasIdentity() AND Zend_Auth::getInstance()->getIdentity()->roleName == 'admin') {
0076                             echo '<div class="explore-product col-lg-12 col-md-12 col-sm-12 col-xs-12">';
0077                             echo '<div class="alert alert-warning" role="alert"><strong>Rendering Time: </strong>'.$time_elapsed.' s</div>';
0078                             echo '</div>';
0079                         }?>
0080                     </div>
0081 
0082 
0083                     <section class="explore-footer">
0084                         <?php echo $this->paginationControl($this->pagination, 'Sliding', 'partials/paginationControl.phtml', array('params' => array('projectSearchText' => $this->searchText,'domain_store_id'=>$this->store), 'dom_target' => 'section.explore-products')); ?>
0085                     </section>
0086                 </section>
0087             </div>
0088 
0089         
0090             
0091         </div>
0092     </section>
0093     <div class="tooltip_templates" style="display: none">
0094     <span id="tooltip_content">
0095         <i class="fa fa-spinner"></i>
0096     </span>
0097 </div>
0098 </main>
0099 
0100 <?php $this->inlineScript()->appendScript(
0101     '    $(document).ready(function(){                               
0102               
0103                 TooltipUser.setup("tooltipuser","right");
0104                 TooltipUser.setup("tooltipuserleft","left");             
0105             });
0106         ');