Skip to content

Commit

Permalink
extend JLayout iconclass with search and replace some hard coded icon…
Browse files Browse the repository at this point in the history
…s with fa-search
  • Loading branch information
hans2103 committed Sep 14, 2020
1 parent eb959dd commit 04a1ae7
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 8 deletions.
Expand Up @@ -52,7 +52,7 @@
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_LOAD'); ?></span>
</button>
<button id="toolbar-preview" type="button" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW_DESC'); ?>" data-url="<?php echo Route::_('index.php?option=com_contenthistory&view=preview&layout=preview&tmpl=component&' . Session::getFormToken() . '=1'); ?>">
<span class="fas fa-search" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
<span class="d-none d-md-inline"><?php echo Text::_('COM_CONTENTHISTORY_BUTTON_PREVIEW'); ?></span>
</button>
<button id="toolbar-compare" type="button" class="btn btn-secondary" aria-label="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" title="<?php echo Text::_('COM_CONTENTHISTORY_BUTTON_COMPARE_DESC'); ?>" data-url="<?php echo Route::_('index.php?option=com_contenthistory&view=compare&layout=compare&tmpl=component&' . Session::getFormToken() . '=1'); ?>">
Expand Down
3 changes: 2 additions & 1 deletion administrator/components/com_modules/tmpl/select/default.php
Expand Up @@ -12,6 +12,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

$app = Factory::getApplication();
Expand Down Expand Up @@ -43,7 +44,7 @@ class="form-control" id="comModulesSelectSearch"
>
<div class="input-group-append" aria-hidden="true">
<div class="input-group-text">
<span class="fa fa-search"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion components/com_finder/tmpl/search/default_form.php
Expand Up @@ -11,6 +11,7 @@

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;

/*
Expand Down Expand Up @@ -38,7 +39,7 @@
<input type="text" name="q" id="q" class="js-finder-search-query form-control" value="<?php echo $this->escape($this->query->input); ?>">
<span class="input-group-append">
<button type="submit" class="btn btn-primary">
<span class="fas fa-search icon-white" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search', 'class' => 'icon-white']); ?>
<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>
</button>
<?php if ($this->params->get('show_advanced', 1)) : ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_tags/tmpl/tag/default_items.php
Expand Up @@ -41,7 +41,7 @@
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="form-control" title="<?php echo Text::_('COM_TAGS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo Text::_('COM_TAGS_TITLE_FILTER_LABEL'); ?>">
<span class="input-group-append">
<button type="submit" name="filter-search-button" title="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>" class="btn btn-secondary">
<span class="fas fa-search" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
</button>
<button type="reset" name="filter-clear-button" title="<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>" class="btn btn-secondary">
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'times']); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_tags/tmpl/tag/list_items.php
Expand Up @@ -33,7 +33,7 @@
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="form-control" title="<?php echo Text::_('COM_TAGS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo Text::_('COM_TAGS_TITLE_FILTER_LABEL'); ?>">
<span class="input-group-append">
<button type="submit" name="filter-search-button" title="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>" class="btn btn-secondary">
<span class="fas fa-search" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
</button>
<button type="reset" name="filter-clear-button" title="<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>" class="btn btn-secondary">
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'times']); ?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_tags/tmpl/tags/default_items.php
Expand Up @@ -60,7 +60,7 @@
<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="form-control" title="<?php echo Text::_('COM_TAGS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo Text::_('COM_TAGS_TITLE_FILTER_LABEL'); ?>">
<span class="input-group-append">
<button type="submit" name="filter-search-button" title="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>" class="btn btn-secondary">
<span class="fas fa-search" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
</button>
<button type="reset" name="filter-clear-button" title="<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>" class="btn btn-secondary">
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'times']); ?>
Expand Down
4 changes: 4 additions & 0 deletions layouts/joomla/icon/iconclass.php
Expand Up @@ -156,6 +156,10 @@
$icon = 'fas fa-spinner';
break;

case 'search':
$icon = 'fas fa-search';
break;

case 'search-plus':
$icon = 'fas fa-search-plus';
break;
Expand Down
3 changes: 2 additions & 1 deletion layouts/joomla/searchtools/default/bar.php
Expand Up @@ -10,6 +10,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\Registry\Registry;

$data = $displayData;
Expand Down Expand Up @@ -48,7 +49,7 @@
<?php endif; ?>
</label>
<button type="submit" class="btn btn-primary" aria-label="<?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?>">
<span class="fas fa-search" aria-hidden="true"></span>
<?php echo LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search']); ?>
</button>
</span>
</div>
Expand Down
5 changes: 4 additions & 1 deletion modules/mod_finder/tmpl/default.php
Expand Up @@ -11,6 +11,7 @@

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Module\Finder\Site\Helper\FinderHelper;

Expand All @@ -33,7 +34,9 @@
$output .= '<div class="mod-finder__search input-group">';
$output .= $input;
$output .= '<span class="input-group-append">';
$output .= '<button class="btn btn-primary" type="submit"><span class="fas fa-search icon-white" aria-hidden="true"></span> ' . Text::_('JSEARCH_FILTER_SUBMIT') . '</button>';
$output .= '<button class="btn btn-primary" type="submit">';
$output .= LayoutHelper::render('joomla.icon.iconclass', ['icon' => 'search', 'class' => 'icon-white']);
$output .= Text::_('JSEARCH_FILTER_SUBMIT') . '</button>';
$output .= '</span>';
$output .= '</div>';
}
Expand Down

0 comments on commit 04a1ae7

Please sign in to comment.