Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[searchtools] Integrate searchtools no results message in the searchtools layout #9738

Merged
merged 3 commits into from
Apr 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false))); ?>
<div class="clearfix"></div>
<?php if (empty($this->data)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false, 'totalResults' => count($this->data)))); ?>
<?php if (count($this->data) > 0) : ?>
<table class="table table-striped">
<thead>
<tr>
Expand Down
7 changes: 6 additions & 1 deletion layouts/joomla/searchtools/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
'filtersHidden' => isset($data['options']['filtersHidden']) ? $data['options']['filtersHidden'] : empty($data['view']->activeFilters),
'defaultLimit' => isset($data['options']['defaultLimit']) ? $data['options']['defaultLimit'] : JFactory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'orderFieldSelector' => '#list_fullordering'
'orderFieldSelector' => '#list_fullordering',
'totalResults' => isset($data['options']['totalResults']) ? $data['options']['totalResults'] : -1,
'noResultsText' => isset($data['options']['noResultsText']) ? $data['options']['noResultsText'] : JText::_('JGLOBAL_NO_MATCHING_RESULTS'),
);

$data['options'] = array_merge($customOptions, $data['options']);
Expand All @@ -45,3 +47,6 @@
<?php echo JLayoutHelper::render('joomla.searchtools.default.filters', $data); ?>
</div>
</div>
<?php if ($data['options']['totalResults'] === 0) : ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default.noitems', $data); ?>
<?php endif; ?>
16 changes: 16 additions & 0 deletions layouts/joomla/searchtools/default/noitems.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('JPATH_BASE') or die;

$data = $displayData;
?>
<div class="alert alert-info alert-no-items">
<?php echo $data['options']['noResultsText']; ?>
</div>