Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
SearchResultWidget.php
1 <?php
2  /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  */
11 ?>
12 <a name="searchResults" /></a>
13 <h4><?php echo SearchModule::t('Search results for').' "<strong>'.htmlspecialchars($this->phrase).'</strong>"' ?></h4>
14 
15 <?php
16 
17  /* if nothing found or any error */
18  if ($this->status=='error' || empty($this->searchResult)) {
19 ?>
20  <?php echo SearchModule::t('Nothing found...'); ?>
21 <?php
22  } else if ($this->status=='ok') {
23  foreach ($this->searchResult as $resultItem) {
24 ?>
25  <div class="search-result-item">
26  <a href="<?php echo Yii::app()->CreateUrl($resultItem['attributes']['url']);?>" class="search-result-name"><?php echo $resultItem['attributes']['name'];?></a>
27  <br/>
28  <a href="<?php echo Yii::app()->CreateUrl($resultItem['attributes']['url']);?>" class="search-result-href"><?php echo $resultItem['attributes']['url'];?></a>
29  <br/>
30  <span class="search-result-preview-text"><?php echo $resultItem['attributes']['content'];?></span>
31  </div>
32 <?php
33  }
34 ?>
35 <?php if($this->pageNumber > 1): ?>
36  <a href="<?php echo $this->paginationUrl($this->pageNumber - 1)?>">&lt; <?php echo SearchModule::t('Previous')?></a>
37 <?php endif?>
38 
39 <?php if($this->existsMore): ?>
40  | <a href="<?php echo $this->paginationUrl($this->pageNumber + 1)?>"><?php echo SearchModule::t('Next')?> &gt;</a>
41 <?php endif?>
42 
43 <?php
44  }
45 ?>