You've already forked joomla_test
first commit
This commit is contained in:
41
components/com_finder/views/search/tmpl/default.php
Normal file
41
components/com_finder/views/search/tmpl/default.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_finder
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
JHtml::_('behavior.framework');
|
||||
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||
JHtml::stylesheet('com_finder/finder.css', false, true, false);
|
||||
?>
|
||||
|
||||
<div class="finder<?php echo $this->pageclass_sfx; ?>">
|
||||
<?php if ($this->params->get('show_page_heading')) : ?>
|
||||
<h1>
|
||||
<?php if ($this->escape($this->params->get('page_heading'))) : ?>
|
||||
<?php echo $this->escape($this->params->get('page_heading')); ?>
|
||||
<?php else : ?>
|
||||
<?php echo $this->escape($this->params->get('page_title')); ?>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($this->params->get('show_search_form', 1)) : ?>
|
||||
<div id="search-form">
|
||||
<?php echo $this->loadTemplate('form'); ?>
|
||||
</div>
|
||||
<?php endif;
|
||||
|
||||
// Load the search results layout if we are performing a search.
|
||||
if ($this->query->search === true):
|
||||
?>
|
||||
<div id="search-results">
|
||||
<?php echo $this->loadTemplate('results'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
181
components/com_finder/views/search/tmpl/default.xml
Normal file
181
components/com_finder/views/search/tmpl/default.xml
Normal file
@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_FINDER_MENU_SEARCH_VIEW_DEFAULT_TITLE">
|
||||
<help
|
||||
key = "JHELP_MENUS_MENU_ITEM_FINDER_SEARCH"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_FINDER_MENU_SEARCH_VIEW_DEFAULT_TEXT]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<fields name="request" addfieldpath="/administrator/components/com_finder/models/fields">
|
||||
<fieldset name="request">
|
||||
<field name="q"
|
||||
type="text"
|
||||
label="COM_FINDER_SEARCH_SEARCH_QUERY_LABEL"
|
||||
description="COM_FINDER_SEARCH_SEARCH_QUERY_DESC"
|
||||
size="30"
|
||||
/>
|
||||
<field name="f"
|
||||
type="searchfilter"
|
||||
default=""
|
||||
label="COM_FINDER_SEARCH_FILTER_SEARCH_LABEL"
|
||||
description="COM_FINDER_SEARCH_FILTER_SEARCH_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
<fields name="params" addfieldpath="/administrator/components/com_finder/models/fields">
|
||||
<fieldset name="basic">
|
||||
<field name="show_date_filters"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SHOW_DATE_FILTERS_LABEL"
|
||||
description="COM_FINDER_CONFIG_SHOW_DATE_FILTERS_DESC">
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
</field>
|
||||
<field name="show_advanced"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SHOW_ADVANCED_LABEL"
|
||||
description="COM_FINDER_CONFIG_SHOW_ADVANCED_DESC">
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
</field>
|
||||
<field name="expand_advanced"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_EXPAND_ADVANCED_LABEL"
|
||||
description="COM_FINDER_CONFIG_EXPAND_ADVANCED_DESC">
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
</field>
|
||||
<field type="spacer" />
|
||||
<field name="show_description"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SHOW_DESCRIPTION_LABEL"
|
||||
description="COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESC">
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
</field>
|
||||
<field name="description_length"
|
||||
type="text"
|
||||
default="255"
|
||||
filter="integer"
|
||||
label="COM_FINDER_CONFIG_DESCRIPTION_LENGTH_LABEL"
|
||||
description="COM_FINDER_CONFIG_DESCRIPTION_LENGTH_DESC"
|
||||
size="5"
|
||||
/>
|
||||
<field name="show_url"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SHOW_URL_LABEL"
|
||||
description="COM_FINDER_CONFIG_SHOW_URL_DESC">
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
</field>
|
||||
<field type="spacer" />
|
||||
</fieldset>
|
||||
<fieldset name="advanced">
|
||||
<field name="show_pagination_limit" type="list"
|
||||
label="JGLOBAL_DISPLAY_SELECT_LABEL"
|
||||
validate="options"
|
||||
description="JGLOBAL_DISPLAY_SELECT_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
<field name="show_pagination" type="list"
|
||||
description="JGLOBAL_PAGINATION_DESC"
|
||||
validate="options"
|
||||
label="JGLOBAL_PAGINATION_LABEL" >
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="2">JGLOBAL_AUTO</option>
|
||||
</field>
|
||||
<field name="show_pagination_results" type="list"
|
||||
label="JGLOBAL_PAGINATION_RESULTS_LABEL"
|
||||
validate="options"
|
||||
description="JGLOBAL_PAGINATION_RESULTS_DESC" >
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
<field name="allow_empty_query"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
validate="options"
|
||||
label="COM_FINDER_ALLOW_EMPTY_QUERY_LABEL"
|
||||
description="COM_FINDER_ALLOW_EMPTY_QUERY_DESC">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="sort_order"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SORT_ORDER_LABEL"
|
||||
description="COM_FINDER_CONFIG_SORT_ORDER_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="relevance">COM_FINDER_CONFIG_SORT_OPTION_RELEVANCE</option>
|
||||
<option value="date">COM_FINDER_CONFIG_SORT_OPTION_START_DATE</option>
|
||||
<option value="price">COM_FINDER_CONFIG_SORT_OPTION_LIST_PRICE</option>
|
||||
</field>
|
||||
<field name="sort_direction"
|
||||
type="list"
|
||||
default=""
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SORT_DIRECTION_LABEL"
|
||||
description="COM_FINDER_CONFIG_SORT_DIRECTION_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="desc">COM_FINDER_CONFIG_SORT_OPTION_DESCENDING</option>
|
||||
<option value="asc">COM_FINDER_CONFIG_SORT_OPTION_ASCENDING</option>
|
||||
</field>
|
||||
<field type="spacer" />
|
||||
<field name="show_feed"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SHOW_FEED_LABEL"
|
||||
description="COM_FINDER_CONFIG_SHOW_FEED_DESC">
|
||||
<option value="1">JSHOW</option>
|
||||
<option value="0">JHIDE</option>
|
||||
</field>
|
||||
<field name="show_feed_text"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
validate="options"
|
||||
label="COM_FINDER_CONFIG_SHOW_FEED_TEXT_LABEL"
|
||||
description="COM_FINDER_CONFIG_SHOW_FEED_TEXT_DESC">
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset name="integration">
|
||||
<field name="show_feed_link" type="list"
|
||||
description="JGLOBAL_SHOW_FEED_LINK_DESC"
|
||||
validate="options"
|
||||
label="JGLOBAL_SHOW_FEED_LINK_LABEL" >
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
111
components/com_finder/views/search/tmpl/default_form.php
Normal file
111
components/com_finder/views/search/tmpl/default_form.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_finder
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEvent('domready', function() {
|
||||
<?php if ($this->params->get('show_advanced', 1)) : ?>
|
||||
/*
|
||||
* This segment of code adds the slide effect to the advanced search box.
|
||||
*/
|
||||
if (document.id('advanced-search') != null)
|
||||
{
|
||||
var searchSlider = new Fx.Slide('advanced-search');
|
||||
|
||||
<?php if (!$this->params->get('expand_advanced', 0)) : ?>
|
||||
searchSlider.hide();
|
||||
<?php endif; ?>
|
||||
|
||||
document.id('advanced-search-toggle').addEvent('click', function(e)
|
||||
{
|
||||
e = new Event(e);
|
||||
e.stop();
|
||||
searchSlider.toggle();
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* This segment of code disables select boxes that have no value when the
|
||||
* form is submitted so that the URL doesn't get blown up with null values.
|
||||
*/
|
||||
if (document.id('finder-search') != null)
|
||||
{
|
||||
document.id('finder-search').addEvent('submit', function(e){
|
||||
e = new Event(e);
|
||||
e.stop();
|
||||
|
||||
if (document.id('advanced-search') != null)
|
||||
{
|
||||
// Disable select boxes with no value selected.
|
||||
document.id('advanced-search').getElements('select').each(function(s){
|
||||
if (!s.getProperty('value'))
|
||||
{
|
||||
s.setProperty('disabled', 'disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.id('finder-search').submit();
|
||||
});
|
||||
}
|
||||
<?php endif; ?>
|
||||
/*
|
||||
* This segment of code sets up the autocompleter.
|
||||
*/
|
||||
<?php if ($this->params->get('show_autosuggest', 1)) : ?>
|
||||
<?php JHtml::_('script', 'com_finder/autocompleter.js', false, true); ?>
|
||||
var url = '<?php echo JRoute::_('index.php?option=com_finder&task=suggestions.display&format=json&tmpl=component', false); ?>';
|
||||
var completer = new Autocompleter.Request.JSON(document.id('q'), url, {'postVar': 'q'});
|
||||
<?php endif; ?>
|
||||
});
|
||||
</script>
|
||||
|
||||
<form id="finder-search" action="<?php echo JRoute::_($this->query->toURI()); ?>" method="get" class="form-inline">
|
||||
<?php echo $this->getFields(); ?>
|
||||
|
||||
<?php
|
||||
/*
|
||||
* DISABLED UNTIL WEIRD VALUES CAN BE TRACKED DOWN.
|
||||
*/
|
||||
if (false && $this->state->get('list.ordering') !== 'relevance_dsc') : ?>
|
||||
<input type="hidden" name="o" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<fieldset class="word">
|
||||
<label for="q">
|
||||
<?php echo JText::_('COM_FINDER_SEARCH_TERMS'); ?>
|
||||
</label>
|
||||
<input type="text" name="q" id="q" size="30" value="<?php echo $this->escape($this->query->input); ?>" class="inputbox" />
|
||||
<?php if ($this->escape($this->query->input) != '' || $this->params->get('allow_empty_search')):?>
|
||||
<button name="Search" type="submit" class="btn btn-primary"><span class="icon-search icon-white"></span> <?php echo JText::_('JSEARCH_FILTER_SUBMIT');?></button>
|
||||
<?php else: ?>
|
||||
<button name="Search" type="submit" class="btn btn-primary disabled"><span class="icon-search icon-white"></span> <?php echo JText::_('JSEARCH_FILTER_SUBMIT');?></button>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('show_advanced', 1)) : ?>
|
||||
<a href="#advancedSearch" data-toggle="collapse" class="btn"><span class="icon-list"></span> <?php echo JText::_('COM_FINDER_ADVANCED_SEARCH_TOGGLE'); ?></a>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
|
||||
<?php if ($this->params->get('show_advanced', 1)) : ?>
|
||||
<div id="advancedSearch" class="collapse">
|
||||
<hr />
|
||||
<?php if ($this->params->get('show_advanced_tips', 1)) : ?>
|
||||
<div class="advanced-search-tip">
|
||||
<?php echo JText::_('COM_FINDER_ADVANCED_TIPS'); ?>
|
||||
</div>
|
||||
<hr />
|
||||
<?php endif; ?>
|
||||
<div id="finder-filter-window">
|
||||
<?php echo JHtml::_('filter.select', $this->query, $this->params); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</form>
|
37
components/com_finder/views/search/tmpl/default_result.php
Normal file
37
components/com_finder/views/search/tmpl/default_result.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_finder
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Get the mime type class.
|
||||
$mime = !empty($this->result->mime) ? 'mime-' . $this->result->mime : null;
|
||||
|
||||
// Get the base url.
|
||||
$base = JUri::getInstance()->toString(array('scheme', 'host', 'port'));
|
||||
|
||||
// Get the route with highlighting information.
|
||||
if (!empty($this->query->highlight) && empty($this->result->mime) && $this->params->get('highlight_terms', 1) && JPluginHelper::isEnabled('system', 'highlight'))
|
||||
{
|
||||
$route = $this->result->route . '&highlight=' . base64_encode(json_encode($this->query->highlight));
|
||||
} else {
|
||||
$route = $this->result->route;
|
||||
}
|
||||
?>
|
||||
|
||||
<li>
|
||||
<h4 class="result-title <?php echo $mime; ?>"><a href="<?php echo JRoute::_($route); ?>"><?php echo $this->result->title; ?></a></h4>
|
||||
<?php if ($this->params->get('show_description', 1)) : ?>
|
||||
<p class="result-text<?php echo $this->pageclass_sfx; ?>">
|
||||
<?php echo JHtml::_('string.truncate', $this->result->description, $this->params->get('description_length', 255)); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->params->get('show_url', 1)) : ?>
|
||||
<div class="small result-url<?php echo $this->pageclass_sfx; ?>"><?php echo $base . JRoute::_($this->result->route); ?></div>
|
||||
<?php endif; ?>
|
||||
</li>
|
92
components/com_finder/views/search/tmpl/default_results.php
Normal file
92
components/com_finder/views/search/tmpl/default_results.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Site
|
||||
* @subpackage com_finder
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
// Activate the highlighter if enabled.
|
||||
if (!empty($this->query->highlight) && $this->params->get('highlight_terms', 1))
|
||||
{
|
||||
JHtml::_('behavior.highlighter', $this->query->highlight);
|
||||
}
|
||||
|
||||
// Get the application object.
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Display the suggested search if it is different from the current search.
|
||||
if (($this->suggested && $this->params->get('show_suggested_query', 1)) || ($this->explained && $this->params->get('show_explained_query', 1))):
|
||||
?>
|
||||
<div id="search-query-explained">
|
||||
<?php
|
||||
// Display the suggested search query.
|
||||
if ($this->suggested && $this->params->get('show_suggested_query', 1))
|
||||
{
|
||||
// Replace the base query string with the suggested query string.
|
||||
$uri = JUri::getInstance($this->query->toURI());
|
||||
$uri->setVar('q', $this->suggested);
|
||||
|
||||
// Compile the suggested query link.
|
||||
$link = '<a href="' . JRoute::_($uri->toString(array('path', 'query'))) . '">'
|
||||
. $this->escape($this->suggested)
|
||||
. '</a>';
|
||||
|
||||
echo JText::sprintf('COM_FINDER_SEARCH_SIMILAR', $link);
|
||||
}
|
||||
// Display the explained search query.
|
||||
elseif ($this->explained && $this->params->get('show_explained_query', 1))
|
||||
{
|
||||
echo $this->explained;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ($this->total == 0):
|
||||
?>
|
||||
<div id="search-result-empty">
|
||||
<h2><?php echo JText::_('COM_FINDER_SEARCH_NO_RESULTS_HEADING'); ?></h2>
|
||||
<?php if ($app->getLanguageFilter()) : ?>
|
||||
<p><?php echo JText::sprintf('COM_FINDER_SEARCH_NO_RESULTS_BODY_MULTILANG', $this->escape($this->query->input)); ?></p>
|
||||
<?php else : ?>
|
||||
<p><?php echo JText::sprintf('COM_FINDER_SEARCH_NO_RESULTS_BODY', $this->escape($this->query->input)); ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
else:
|
||||
// Prepare the pagination string. Results X - Y of Z
|
||||
$start = (int) $this->pagination->get('limitstart') + 1;
|
||||
$total = (int) $this->pagination->get('total');
|
||||
$limit = (int) $this->pagination->get('limit') * $this->pagination->pagesTotal;
|
||||
$limit = (int) ($limit > $total ? $total : $limit);
|
||||
$pages = JText::sprintf('COM_FINDER_SEARCH_RESULTS_OF', $start, $limit, $total);
|
||||
?>
|
||||
<br id="highlighter-start" />
|
||||
<ul class="search-results<?php echo $this->pageclass_sfx; ?> list-striped">
|
||||
<?php
|
||||
for ($i = 0, $n = count($this->results); $i < $n; $i++):
|
||||
$this->result = &$this->results[$i];
|
||||
$layout = $this->getLayoutFile($this->result->layout);
|
||||
?>
|
||||
<?php echo $this->loadTemplate($layout); ?>
|
||||
<?php
|
||||
endfor;
|
||||
?>
|
||||
</ul>
|
||||
<br id="highlighter-end" />
|
||||
|
||||
<div class="search-pagination">
|
||||
<div class="pagination">
|
||||
<?php echo $this->pagination->getPagesLinks(); ?>
|
||||
</div>
|
||||
<div class="search-pages-counter">
|
||||
<?php echo $pages; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
1
components/com_finder/views/search/tmpl/index.html
Normal file
1
components/com_finder/views/search/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user