PageRenderTime 54ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 1ms

/administrator/components/com_flexicontent/views/search/tmpl/default.php

http://flexicontent.googlecode.com/
PHP | 250 lines | 198 code | 29 blank | 23 comment | 11 complexity | 95d9d4505bae89111915cac9471fd8ae MD5 | raw file
Possible License(s): MIT, GPL-2.0, Apache-2.0
  1. <?php
  2. /**
  3. * @version 1.5 stable $Id: default.php 1803 2013-11-05 03:10:36Z ggppdk $
  4. * @package Joomla
  5. * @subpackage FLEXIcontent
  6. * @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr
  7. * @license GNU/GPL v2
  8. *
  9. * FLEXIcontent is a derivative work of the excellent QuickFAQ component
  10. * @copyright (C) 2008 Christoph Lukes
  11. * see www.schlu.net for more information
  12. *
  13. * FLEXIcontent is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. */
  18. defined('_JEXEC') or die('Restricted access');
  19. $items_task = FLEXI_J16GE ? 'task=items.' : 'controller=items&task=';
  20. ?>
  21. <script language="javascript" type="text/javascript">
  22. // the function overloads joomla standard event
  23. function submitform(pressbutton)
  24. {
  25. form = document.adminForm;
  26. // Store the button task into the form
  27. if (pressbutton) {
  28. form.task.value=pressbutton;
  29. }
  30. // Execute onsubmit
  31. if (typeof form.onsubmit == "function") {
  32. form.onsubmit();
  33. }
  34. // Submit the form
  35. form.submit();
  36. }
  37. // delete active filter
  38. function delFilter(name)
  39. {
  40. var myForm = $('adminForm');
  41. if ($(name).type=='checkbox')
  42. $(name).checked = '';
  43. else
  44. $(name).setProperty('value', '');
  45. }
  46. function delAllFilters() {
  47. delFilter('filter_fieldtype'); delFilter('filter_itemtype'); delFilter('filter_itemstate');
  48. delFilter('search_index'); delFilter('search_itemtitle'); delFilter('search_itemid');
  49. }
  50. </script>
  51. <div class="flexicontent">
  52. <form action="index.php?option=com_flexicontent&amp;view=search" method="post" name="adminForm" id="adminForm">
  53. <table class="adminlist" style="clear: both;">
  54. <thead>
  55. <tr>
  56. <th width="5">
  57. <?php echo JText::_('NUM'); ?>
  58. </th>
  59. <th width="5">
  60. <input type="checkbox" name="toggle" value="" onclick="<?php echo FLEXI_J30GE ? 'Joomla.checkAll(this);' : 'checkAll('.count( $this->data).');'; ?>" />
  61. </th>
  62. <th nowrap="nowrap" width="20%">
  63. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_ITEMS'), 'a.title', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  64. </th>
  65. <th nowrap="nowrap" width="10%">
  66. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_FIELD_INDEX').' '.JText::_('FLEXI_FIELD_LABEL'), 'f.label', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  67. </th>
  68. <th nowrap="nowrap" width="10%">
  69. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_FIELD_INDEX').' '.JText::_('FLEXI_FIELD_NAME'), 'f.name', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  70. </th>
  71. <th nowrap="nowrap" width="10%">
  72. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_FIELD_TYPE'), 'f.field_type', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  73. </th>
  74. <th nowrap="nowrap" width="5%">
  75. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_INDEX_VALUE_COUNT'), 'ai.extraid', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  76. </th>
  77. <th nowrap="nowrap">
  78. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_SEARCH_INDEX'), 'ai.search_index', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  79. </th>
  80. <th nowrap="nowrap">
  81. <?php echo JHTML::_('grid.sort', JText::_('FLEXI_INDEX_VALUE_ID'), 'ai.value_id', $this->lists['order_Dir'], $this->lists['order'] ); ?>
  82. </th>
  83. </tr>
  84. <tr id="filterline">
  85. <!--td class="left col_title" colspan="4">
  86. <span class="radio"><?php echo $this->lists['scope']; ?></span>
  87. <input type="text" name="search" id="search" value="<?php echo $this->lists['search']; ?>" class="inputbox" />
  88. </td-->
  89. <td class="left"></td>
  90. <td class="left"></td>
  91. <td class="left" colspan="3">
  92. <?php echo '<label class="label'.($this->f_active['search_itemtitle'] ? " highlight":"").'">'.JText::_('FLEXI_TITLE').'</label> '; ?>
  93. <input type="text" name="search_itemtitle" id="search_itemtitle" value="<?php echo $this->lists['search_itemtitle']; ?>" class="text_area" onChange="document.adminForm.submit();" size="30"/>
  94. <?php echo '<label class="label'.($this->f_active['search_itemid'] ? " highlight":"").'">'.JText::_('FLEXI_ID').'</label> '; ?>
  95. <input type="text" name="search_itemid" id="search_itemid" value="<?php echo $this->lists['search_itemid']; ?>" class="text_area" onChange="document.adminForm.submit();" size="6" />
  96. <br/>
  97. <?php echo '<label class="label'.($this->f_active['filter_itemtype'] ? " highlight":"").'">'.JText::_('FLEXI_TYPE_NAME').'</label> '; ?>
  98. <?php echo $this->lists['filter_itemtype']; ?>
  99. <?php echo '<label class="label'.($this->f_active['filter_itemstate'] ? " highlight":"").'">'.JText::_('FLEXI_STATE').'</label> '; ?>
  100. <?php echo $this->lists['filter_itemstate']; ?>
  101. </td>
  102. <td class="left col_fieldtype" >
  103. <?php echo '<label class="label'.($this->f_active['filter_fieldtype'] ? " highlight":"").'">'.JText::_('FLEXI_FILTER').'</label> '; ?><br/>
  104. <?php echo $this->lists['filter_fieldtype']; ?>
  105. </td>
  106. <td class="left"></td>
  107. <td class="left col_search_index">
  108. <?php echo '<label class="label'.($this->f_active['search_index'] ? " highlight":"").'">'.JText::_('FLEXI_FILTER').'</label> '; ?><br/>
  109. <input type="text" name="search_index" id="search_index" value="<?php echo $this->lists['search_index']; ?>" class="text_area" onChange="document.adminForm.submit();" />
  110. </td>
  111. <td class="left"></td>
  112. </tr>
  113. <tr>
  114. <td colspan="9" class="filterbuttons">
  115. <input type="submit" class="fc_button fcsimple" onclick="this.form.submit();" value="<?php echo JText::_( 'FLEXI_APPLY_FILTERS' ); ?>" />
  116. <input type="button" class="fc_button fcsimple" onclick="delAllFilters();this.form.submit();" value="<?php echo JText::_( 'FLEXI_RESET_FILTERS' ); ?>" />
  117. <div class="limit" style="display: inline-block; margin-left: 24px;">
  118. <?php echo JText::_(FLEXI_J16GE ? 'JGLOBAL_DISPLAY_NUM' : 'DISPLAY NUM') . $this->pagination->getLimitBox(); ?>
  119. </div>
  120. <span class="fc_item_total_data fc_nice_box" style="margin-right:10px;" >
  121. <?php echo @$this->resultsCounter ? $this->resultsCounter : $this->pagination->getResultsCounter(); // custom Results Counter ?>
  122. </span>
  123. <span class="fc_pages_counter">
  124. <?php echo $this->pagination->getPagesCounter(); ?>
  125. </span>
  126. <?php if (isset($this->lists['filter_stategrp'])) : ?>
  127. <span class="radio flexi_tabbox" style="margin-left:60px;"><?php echo '<span class="flexi_tabbox_label">'.JText::_('FLEXI_LISTING_RECORDS').': </span>'.$this->lists['filter_stategrp']; ?></span>
  128. <?php endif; ?>
  129. <div class='fc_mini_note_box' style='float:right; clear:both!important;'>
  130. <span class="radio flexi_tabbox" style="margin-left:60px;"><?php echo '<span class="flexi_tabbox_label">'.JText::_('FLEXI_LISTING_RECORDS').': </span>'.$this->lists['filter_indextype']; ?></span>
  131. </div>
  132. <!--
  133. <span style="float:right;">
  134. <input type="button" class="button" onclick="delAllFilters();this.form.submit();" value="<?php echo JText::_( 'FLEXI_RESET_FILTERS' ); ?>" />
  135. <input type="button" class="button submitbutton" onclick="this.form.submit();" value="<?php echo JText::_( 'FLEXI_APPLY_FILTERS' ); ?>" />
  136. <input type="button" class="button" id="hide_filters" value="<?php echo JText::_( 'FLEXI_HIDE_FILTERS' ); ?>" />
  137. <input type="button" class="button" id="show_filters" value="<?php echo JText::_( 'FLEXI_DISPLAY_FILTERS' ); ?>" />
  138. </span>
  139. -->
  140. </td>
  141. </tr>
  142. </thead>
  143. <tbody>
  144. <?php if (count($this->data) == 0): ?>
  145. <tr class="row0">
  146. <td align="center" colspan="9">
  147. <?php
  148. if ($this->total == 0) {
  149. echo JText::_('FLEXI_NO_DATA');
  150. //echo JText::_('FINDER_INDEX_TIP');
  151. } else {
  152. echo JText::_('FINDER_INDEX_NO_CONTENT');
  153. }
  154. ?>
  155. </td>
  156. </tr>
  157. <?php endif; ?>
  158. <?php
  159. $n = 0; $o = 0;
  160. foreach ($this->data as $row): ?>
  161. <tr class="<?php echo 'row', $o; ?>">
  162. <td>
  163. <?php echo $this->pagination->getRowOffset( $n ); ?>
  164. </td>
  165. <td align="center">
  166. <?php echo JHTML::_('grid.id', $n, $row->field_id.'|'.$row->item_id); ?>
  167. </td>
  168. <td>
  169. <span class="editlinktip hasTip" title="<?php echo JText::_( 'FLEXI_EDIT_ITEM' );?>::<?php echo $row->title; ?>">
  170. <?php
  171. $link = 'index.php?option=com_flexicontent&'.$items_task.'edit&cid[]='. $row->id;
  172. echo '<a target="_blank" href="'.$link.'">'.$this->escape($row->title).'</a>';
  173. ?>
  174. </span>
  175. </td>
  176. <td>
  177. <?php echo $this->escape($row->label); ?>
  178. </td>
  179. <td>
  180. <?php echo $this->escape($row->name); ?>
  181. </td>
  182. <td nowrap="nowrap" style="text-align: center" class="col_fieldtype">
  183. <?php echo $row->field_type; ?>
  184. </td>
  185. <td nowrap="nowrap" style="text-align: center;">
  186. <?php echo $row->extraid; ?>
  187. </td>
  188. <td style="text-align: left;" class="col_search_index">
  189. <?php
  190. if(iconv_strlen($row->search_index, "UTF-8")>400)
  191. echo iconv_substr($row->search_index, 0, 400, "UTF-8").'...';
  192. else
  193. echo $row->search_index;
  194. ?>
  195. </td>
  196. <td nowrap="nowrap" style="text-align: center;">
  197. <?php echo $row->value_id; ?>
  198. </td>
  199. <?php /*<td nowrap="nowrap" style="text-align: center;">
  200. <?php //echo JHtml::date($row->indexdate, '%Y-%m-%d %H:%M:%S'); ?>
  201. </td>*/ ?>
  202. </tr>
  203. <?php $n++; $o = ++$o % 2; ?>
  204. <?php endforeach; ?>
  205. </tbody>
  206. <tfoot>
  207. <tr>
  208. <td colspan="9" nowrap="nowrap">
  209. <?php echo $this->pagination->getListFooter(); ?>
  210. </td>
  211. </tr>
  212. </tfoot>
  213. </table>
  214. <input type="hidden" name="task" value="display" />
  215. <input type="hidden" name="boxchecked" value="0" />
  216. <input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
  217. <input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
  218. <input type="hidden" name="controller" value="search" />
  219. <?php echo JHTML::_('form.token'); ?>
  220. </form>
  221. </div>