Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/joomla/joomla-cms into s…
Browse files Browse the repository at this point in the history
…earch-tools-filters-smartsearch2
  • Loading branch information
pe7er committed Nov 4, 2015
2 parents df5f6f2 + 922102d commit ef2c89b
Show file tree
Hide file tree
Showing 34 changed files with 546 additions and 446 deletions.
22 changes: 12 additions & 10 deletions administrator/components/com_categories/models/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public function __construct($config = array())
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication();
$context = $this->context;

// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
{
$this->context .= '.' . $layout;
}

$extension = $app->getUserStateFromRequest('com_categories.categories.filter.extension', 'extension', 'com_content', 'cmd');

Expand All @@ -78,19 +83,19 @@ protected function populateState($ordering = null, $direction = null)
// Extract the optional section name
$this->setState('filter.section', (count($parts) > 1) ? $parts[1] : null);

$search = $this->getUserStateFromRequest($context . '.search', 'filter_search');
$search = $this->getUserStateFromRequest($this->context . '.search', 'filter_search');
$this->setState('filter.search', $search);

$level = $this->getUserStateFromRequest($context . '.filter.level', 'filter_level');
$level = $this->getUserStateFromRequest($this->context . '.filter.level', 'filter_level');
$this->setState('filter.level', $level);

$access = $this->getUserStateFromRequest($context . '.filter.access', 'filter_access');
$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access');
$this->setState('filter.access', $access);

$published = $this->getUserStateFromRequest($context . '.filter.published', 'filter_published', '');
$published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published);

$language = $this->getUserStateFromRequest($context . '.filter.language', 'filter_language', '');
$language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', '');
$this->setState('filter.language', $language);

$tag = $this->getUserStateFromRequest($this->context . '.filter.tag', 'filter_tag', '');
Expand Down Expand Up @@ -147,10 +152,6 @@ protected function getListQuery()
$query = $db->getQuery(true);
$user = JFactory::getUser();

// Determine for which component the category manager retrieves its categories (for item count)
$jinput = JFactory::getApplication()->input;
$countitemhelper = JPATH_ADMINISTRATOR . "/components/" . $jinput->get('extension') . '/helpers/countitems.php';

// Select the required fields from the table.
$query->select(
$this->getState(
Expand Down Expand Up @@ -304,6 +305,7 @@ protected function getListQuery()

// Load Helper file of the component for which com_categories displays the categories
$classname = ucfirst(substr($extension, 4)) . 'Helper';

if (class_exists($classname) && method_exists($classname, 'countItems'))
{
// Get the SQL to extend the com_category $query object with item count (published, unpublished, trashed)
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_installer/models/discover.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message', '');
$app->setUserState('com_installer.extension_message', '');
$this->setState('list.ordering', 'name');

parent::populateState('name', 'asc');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset addfieldpath="/administrator/components/com_installer/models/fields"/>

<fields name="filter">
<field
name="search"
type="text"
hint="JSEARCH_FILTER"
/>

<field
name="client_id"
type="location"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_CLIENT_SELECT</option>
</field>

<field
name="type"
type="type"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_TYPE_SELECT</option>
</field>

<field
name="group"
type="folder"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_FOLDER_SELECT</option>
</field>

</fields>
<fields name="list">
<field
name="limit"
type="limitbox"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset addfieldpath="/administrator/components/com_installer/models/fields"/>

<fields name="filter">
<field
name="search"
type="text"
hint="JSEARCH_FILTER"
/>

<field
name="client_id"
type="location"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_CLIENT_SELECT</option>
</field>

<field
name="type"
type="type"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_TYPE_SELECT</option>
</field>

<field
name="group"
type="folder"
onchange="this.form.submit();"
>
<option value="">COM_INSTALLER_VALUE_FOLDER_SELECT</option>
</field>

</fields>
<fields name="list">
<field
name="limit"
type="limitbox"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
1 change: 1 addition & 0 deletions administrator/components/com_installer/models/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected function populateState($ordering = null, $direction = null)
$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$app->setUserState('com_installer.message', '');
$app->setUserState('com_installer.extension_message', '');
$this->setState('list.ordering', 'name');

parent::populateState('name', 'asc');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,7 @@
<?php if ($this->ftp) : ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php endif; ?>

<!-- Begin Filters -->
<div id="filter-bar" class="btn-toolbar">
<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="filter-search btn-group pull-left">
<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_INSTALLER_FILTER_LABEL'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="icon-search"></span></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="icon-remove"></span></button>
</div>
</div>
<div class="clearfix"> </div>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>

<!-- Begin Content -->
<?php if (count($this->items)) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ class InstallerViewDiscover extends InstallerViewDefault
public function display($tpl = null)
{
// Get data from the model.
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

parent::display($tpl);
}
Expand All @@ -55,45 +57,6 @@ protected function addToolbar()

JHtmlSidebar::setAction('index.php?option=com_installer&view=discover');

JHtmlSidebar::addFilter(
JText::_('COM_INSTALLER_VALUE_CLIENT_SELECT'),
'filter_client_id',
JHtml::_(
'select.options',
array('0' => 'JSITE', '1' => 'JADMINISTRATOR'),
'value',
'text',
$this->state->get('filter.client_id'),
true
)
);

JHtmlSidebar::addFilter(
JText::_('COM_INSTALLER_VALUE_TYPE_SELECT'),
'filter_type',
JHtml::_(
'select.options',
InstallerHelper::getExtensionTypes(),
'value',
'text',
$this->state->get('filter.type'),
true
)
);

JHtmlSidebar::addFilter(
JText::_('COM_INSTALLER_VALUE_FOLDER_SELECT'),
'filter_group',
JHtml::_(
'select.options',
array_merge(InstallerHelper::getExtensionGroupes(), array('*' => JText::_('COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE'))),
'value',
'text',
$this->state->get('filter.group'),
true
)
);

parent::addToolbar();
JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_DISCOVER');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,7 @@
<?php if ($this->ftp) : ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php endif; ?>
<div id="filter-bar" class="btn-toolbar">
<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="filter-search btn-group pull-left">
<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_INSTALLER_FILTER_LABEL'); ?>" />
</div>
<div class="btn-group pull-left">
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="icon-search"></span></button>
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="icon-remove"></span></button>
</div>
</div>
<div class="clearfix"> </div>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>

<!-- Begin Content -->
<?php if (count($this->items)) : ?>
Expand Down
27 changes: 3 additions & 24 deletions administrator/components/com_installer/views/update/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

$paths = new stdClass;
$paths->first = '';

Expand Down Expand Up @@ -85,30 +88,6 @@ protected function addToolbar()

JHtmlSidebar::setAction('index.php?option=com_installer&view=manage');

JHtmlSidebar::addFilter(
JText::_('COM_INSTALLER_VALUE_CLIENT_SELECT'),
'filter_client_id',
JHtml::_('select.options', array('0' => 'JSITE', '1' => 'JADMINISTRATOR'), 'value', 'text', $this->state->get('filter.client_id'), true)
);

JHtmlSidebar::addFilter(
JText::_('COM_INSTALLER_VALUE_TYPE_SELECT'),
'filter_type',
JHtml::_('select.options', InstallerHelper::getExtensionTypes(), 'value', 'text', $this->state->get('filter.type'), true)
);

JHtmlSidebar::addFilter(
JText::_('COM_INSTALLER_VALUE_FOLDER_SELECT'),
'filter_group',
JHtml::_(
'select.options',
array_merge(InstallerHelper::getExtensionGroupes(), array('*' => JText::_('COM_INSTALLER_VALUE_FOLDER_NONAPPLICABLE'))),
'value',
'text',
$this->state->get('filter.group'),
true
)
);
parent::addToolbar();
JToolbarHelper::help('JHELP_EXTENSIONS_EXTENSION_MANAGER_UPDATE');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
$trashed = $this->state->get('filter.state') == -2 ? true : false;
$canOrder = $user->authorise('core.edit.state', 'com_modules');
$saveOrder = $listOrder == 'ordering';
$editor = JFactory::getApplication()->input->get('editor', '', 'cmd');

if ($saveOrder)
{
Expand Down Expand Up @@ -46,12 +47,12 @@
};
moduleIns = function(type, name) {
parent.window.jInsertEditorText("{loadmodule " + type + "," + name + "," + jQuery("#extra_class").val() + "}");
parent.window.jInsertEditorText("{loadmodule " + type + "," + name + "," + jQuery("#extra_class").val() + "}", "' . $editor . '");
parent.window.jModalClose();
}
modulePosIns = function(position) {
parent.window.jInsertEditorText("{loadposition " + position + "," + jQuery("#extra_class").val() + "}");
parent.window.jInsertEditorText("{loadposition " + position + "," + jQuery("#extra_class").val() + "}", "' . $editor . '");
parent.window.jModalClose();
}
');
Expand All @@ -71,7 +72,6 @@
</div>
<form action="<?php echo JRoute::_('index.php?option=com_modules&view=modules&layout=modal&tmpl=component&' . JSession::getFormToken() . '=1');?>"
method="post" name="adminForm" id="adminForm">
<form action="<?php echo JRoute::_('index.php?option=com_modules&layout=modal'); ?>" method="post" name="adminForm" id="adminForm">
<div id="j-main-container">
<div id="filter-bar" class="btn-toolbar">
<div class="filter-search btn-group pull-left">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ public function display($tpl = null)
$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');

if ($this->getLayout() == 'default')
{
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
}

// Check for errors.
if (count($errors = $this->get('Errors')))
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_users/models/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function populateState($ordering = null, $direction = null)
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state');
$this->setState('filter.state', $state);

$groupId = $this->getUserStateFromRequest($this->context . '.filter.group', 'filter_group_id', null, 'int');
$groupId = $this->getUserStateFromRequest($this->context . '.filter.group_id', 'filter_group_id', null, 'int');
$this->setState('filter.group_id', $groupId);

$range = $this->getUserStateFromRequest($this->context . '.filter.range', 'filter_range');
Expand Down

0 comments on commit ef2c89b

Please sign in to comment.