Skip to content

Commit

Permalink
Moved Filters from Left to Search Tools - Ordering dropdown is not wo…
Browse files Browse the repository at this point in the history
…rking
  • Loading branch information
pe7er committed May 15, 2015
1 parent b92729c commit 0799c3b
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 69 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
label="COM_NEWSFEEDS_FILTER_SEARCH_DESC"
hint="JSEARCH_FILTER"
/>
<field
name="published"
type="status"
label="COM_NEWSFEEDS_FILTER_PUBLISHED"
description="COM_NEWSFEEDS_FILTER_PUBLISHED_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
</field>
<field
name="category_id"
type="category"
label="JOPTION_FILTER_CATEGORY"
extension="com_newsfeeds"
description="JOPTION_FILTER_CATEGORY_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_CATEGORY</option>
</field>
<field
name="access"
type="accesslevel"
label="JOPTION_FILTER_ACCESS"
description="JOPTION_FILTER_ACCESS_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_ACCESS</option>
</field>
<field
name="language"
type="contentlanguage"
label="JOPTION_FILTER_LANGUAGE"
description="JOPTION_FILTER_LANGUAGE_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_LANGUAGE</option>
<option value="*">JALL</option>
</field>
<field
name="tag"
type="tag"
mode="nested"
label="JOPTION_FILTER_TAG"
description="JOPTION_FILTER_TAG_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_TAG</option>
</field>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="COM_NEWSFEEDS_LIST_FULL_ORDERING"
description="COM_NEWSFEEDS_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.id DESC"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.ordering ASC">JGRID_HEADING_ORDERING_ASC</option>
<option value="a.ordering DESC">JGRID_HEADING_ORDERING_DESC</option>
<option value="a.published ASC">JSTATUS_ASC</option>
<option value="a.published DESC">JSTATUS_DESC</option>
<option value="a.name ASC">JGLOBAL_TITLE_ASC</option>
<option value="a.name DESC">JGLOBAL_TITLE_DESC</option>
<option value="category_title ASC">JCATEGORY_ASC</option>
<option value="category_title DESC">JCATEGORY_DESC</option>
<option value="a.access ASC">JGRID_HEADING_ACCESS_ASC</option>
<option value="a.access DESC">JGRID_HEADING_ACCESS_DESC</option>
<option value="numarticles ASC">COM_NEWSFEEDS_NUM_ARTICLES_HEADING_ASC</option>
<option value="numarticles DESC">COM_NEWSFEEDS_NUM_ARTICLES_HEADING_DESC</option>
<option value="a.cache_time ASC">COM_NEWSFEEDS_CACHE_TIME_HEADING_ASC</option>
<option value="a.cache_time DESC">COM_NEWSFEEDS_CACHE_TIME_HEADING_DESC</option>
<option value="language ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="language DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
class="input-mini"
default="25"
label="COM_NEWSFEEDS_LIST_LIMIT"
description="COM_NEWSFEEDS_LIST_LIMIT_DESC"
onchange="this.form.submit();"
/>
</fields>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -52,44 +52,18 @@
');
?>
<form action="<?php echo JRoute::_('index.php?option=com_newsfeeds&view=newsfeeds'); ?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)) : ?>
<?php if (!empty( $this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
<label for="filter_search" class="element-invisible"><?php echo JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC');?></label>
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('COM_NEWSFEEDS_SEARCH_IN_TITLE'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
<option value="asc" <?php if ($listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
<option value="desc" <?php if ($listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
</select>
</div>
<div class="btn-group pull-right hidden-phone">
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
<?php echo JHtml::_('select.options', $sortFields, 'value', 'text', $listOrder);?>
</select>
</div>
</div>
<div class="clearfix"> </div>
<?php else : ?>
<div id="j-main-container">
<?php endif;?>
<?php
// Search tools bar
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ class NewsfeedsViewNewsfeeds extends JViewLegacy
*/
public function display($tpl = null)
{
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

NewsfeedsHelper::addSubmenu('newsfeeds');

Expand Down Expand Up @@ -138,38 +140,6 @@ protected function addToolbar()
}

JToolbarHelper::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS');

JHtmlSidebar::setAction('index.php?option=com_newsfeeds&view=newsfeeds');

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_PUBLISHED'),
'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
);

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_CATEGORY'),
'filter_category_id',
JHtml::_('select.options', JHtml::_('category.options', 'com_newsfeeds'), 'value', 'text', $this->state->get('filter.category_id'))
);

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_ACCESS'),
'filter_access',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
);

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_LANGUAGE'),
'filter_language',
JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))
);

JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_TAG'),
'filter_tag',
JHtml::_('select.options', JHtml::_('tag.options', true, true), 'value', 'text', $this->state->get('filter.tag'))
);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions administrator/language/en-GB/en-GB.com_newsfeeds.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ COM_NEWSFEEDS_BATCH_MENU_LABEL="Select Category for Move/Copy"
COM_NEWSFEEDS_BATCH_OPTIONS="Batch process the selected news feeds"
COM_NEWSFEEDS_BATCH_TIP="If a category is selected for move/copy, any actions selected will be applied to the copied or moved news feeds. Otherwise, all actions are applied to the selected news feeds."
COM_NEWSFEEDS_CACHE_TIME_HEADING="Cache Time"
COM_NEWSFEEDS_CACHE_TIME_HEADING_ASC="Cache Time ascending"
COM_NEWSFEEDS_CACHE_TIME_HEADING_DESC="Cache Time descending"
COM_NEWSFEEDS_CATEGORIES_DESC="These settings apply for News Feeds Categories Options unless they are changed for a specific menu item."
COM_NEWSFEEDS_CHANGE_FEED_BUTTON="Select Feed"
COM_NEWSFEEDS_CONFIGURATION="News Feed Manager Options"
Expand Down Expand Up @@ -106,6 +108,8 @@ COM_NEWSFEEDS_NEW_NEWSFEED="New News Feed"
COM_NEWSFEEDS_NO_ITEM_SELECTED="No news feeds selected."
COM_NEWSFEEDS_NONE="None"
COM_NEWSFEEDS_NUM_ARTICLES_HEADING="# Articles"
COM_NEWSFEEDS_NUM_ARTICLES_HEADING_ASC="# Articles ascending"
COM_NEWSFEEDS_NUM_ARTICLES_HEADING_DESC="# Articles descending"
COM_NEWSFEEDS_PUBLISH_ITEM="Publish News Feed"
COM_NEWSFEEDS_RIGHT="Right"
COM_NEWSFEEDS_SAVE_SUCCESS="News feed successfully saved."
Expand Down

0 comments on commit 0799c3b

Please sign in to comment.