Skip to content

Commit

Permalink
Merge branch 'staging' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
chrBrd committed Apr 13, 2016
2 parents 66720e7 + 59908b8 commit 9a64c9d
Show file tree
Hide file tree
Showing 19 changed files with 328 additions and 604 deletions.
1 change: 1 addition & 0 deletions administrator/components/com_admin/script.php
Expand Up @@ -1407,6 +1407,7 @@ public function deleteUnexistingFiles()
'/libraries/joomla/document/opensearch/opensearch.php',
'/libraries/joomla/document/raw/raw.php',
'/libraries/joomla/document/xml/xml.php',
'/administrator/components/com_installer/views/languages/tmpl/default_filter.php',
);

// TODO There is an issue while deleting folders using the ftp mode
Expand Down
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
label="JSEARCH_FILTER"
description="JSEARCH_FILTER"
hint="JSEARCH_FILTER"
/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
description="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="name ASC"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="name ASC">JGRID_HEADING_LANGUAGE_ASC</option>
<option value="name DESC">JGRID_HEADING_LANGUAGE_DESC</option>
<option value="element ASC">COM_INSTALLER_HEADING_LANGUAGE_TAG_ASC</option>
<option value="element DESC">COM_INSTALLER_HEADING_LANGUAGE_TAG_DESC</option>
<option value="update_id ASC">JGRID_HEADING_ID_ASC</option>
<option value="update_id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIMIT"
description="JGLOBAL_LIMIT"
class="input-mini"
default="25"
onchange="this.form.submit();"
/>
</fields>
</form>
19 changes: 7 additions & 12 deletions administrator/components/com_installer/models/languages.php
Expand Up @@ -41,8 +41,9 @@ public function __construct($config = array())
if (empty($config['filter_fields']))
{
$config['filter_fields'] = array(
'update_id', 'update_id',
'name', 'name',
'update_id',
'name',
'element',
);
}

Expand Down Expand Up @@ -99,7 +100,7 @@ protected function _getListQuery()
$query = $db->getQuery(true);

// Select the required fields from the updates table.
$query->select($db->quoteName(array('update_id', 'name', 'version', 'detailsurl', 'type')))
$query->select($db->quoteName(array('update_id', 'name', 'element', 'version', 'detailsurl', 'type')))
->from($db->quoteName('#__updates'));

/*
Expand All @@ -122,17 +123,14 @@ protected function _getListQuery()

// Filter by search in title
$search = $this->getState('filter.search');

if (!empty($search))
{
$search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%'));
$query->where('(LOWER(name) LIKE ' . strtolower($search) . ')');
}

// Add the list ordering clause.
$listOrder = $this->state->get('list.ordering');
$orderDirn = $this->state->get('list.direction');
$query->order($db->escape($listOrder) . ' ' . $db->escape($orderDirn));
$query->order($db->escape($this->getState('list.ordering', 'name')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));

return $query;
}
Expand Down Expand Up @@ -168,12 +166,9 @@ protected function getStoreId($id = '')
*/
protected function populateState($ordering = 'name', $direction = 'asc')
{
$app = JFactory::getApplication();

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

$this->setState('extension_message', $app->getUserState('com_installer.extension_message'));
$this->setState('extension_message', JFactory::getApplication()->getUserState('com_installer.extension_message'));

parent::populateState($ordering, $direction);
}
Expand Down
Expand Up @@ -16,46 +16,44 @@
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));

$version = new JVersion;

?>
<div id="installer-languages" class="clearfix">
<form action="<?php echo JRoute::_('index.php?option=com_installer&view=languages');?>" method="post" name="adminForm" id="adminForm">
<form action="<?php echo JRoute::_('index.php?option=com_installer&view=languages'); ?>" method="post" name="adminForm" id="adminForm">
<?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;?>
<?php if (count($this->items) || $this->escape($this->state->get('filter.search'))) : ?>
<?php echo $this->loadTemplate('filter'); ?>
<?php if (empty($this->items)) : ?>
<?php endif; ?>
<?php echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('filterButton' => false))); ?>
<div class="clearfix"></div>
<?php if (empty($this->items)) : ?>
<div class="alert alert-no-items">
<?php echo JText::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<?php else : ?>
<table class="table table-striped">
<thead>
<tr>
<th width="20" class="nowrap center">
<th width="1%" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<th class="nowrap">
<?php echo JHtml::_('grid.sort', 'COM_INSTALLER_HEADING_NAME', 'name', $listDirn, $listOrder); ?>
<?php echo JHtml::_('searchtools.sort', 'JGRID_HEADING_LANGUAGE', 'name', $listDirn, $listOrder); ?>
</th>
<th width="10%">
<?php echo JText::_('JVERSION'); ?>
<th width="1%" class="nowrap">
<?php echo JHtml::_('searchtools.sort', 'COM_INSTALLER_HEADING_LANGUAGE_TAG', 'element', $listDirn, $listOrder); ?>
</th>
<th class="nowrap hidden-phone">
<?php echo JText::_('COM_INSTALLER_HEADING_TYPE'); ?>
<th width="5%" class="center">
<?php echo JText::_('JVERSION'); ?>
</th>
<th width="35%" class="nowrap hidden-phone">
<th width="40%" class="nowrap hidden-phone">
<?php echo JText::_('COM_INSTALLER_HEADING_DETAILS_URL'); ?>
</th>
<th width="30" class="nowrap hidden-phone">
<?php echo JHtml::_('grid.sort', 'COM_INSTALLER_HEADING_ID', 'update_id', $listDirn, $listOrder); ?>
<th width="1%" class="nowrap hidden-phone">
<?php echo JHtml::_('searchtools.sort', 'COM_INSTALLER_HEADING_ID', 'update_id', $listDirn, $listOrder); ?>
</th>
</tr>
</thead>
Expand All @@ -67,47 +65,47 @@
</tr>
</tfoot>
<tbody>
<?php foreach ($this->items as $i => $language) : ?>
<?php
$version = new JVersion;
$currentShortVersion = preg_replace('#^([0-9\.]+)(|.*)$#', '$1', $version->getShortVersion());
foreach ($this->items as $i => $language) :
// Get language code and language image.
preg_match('#^pkg_([a-z]{2,3}-[A-Z]{2})$#', $language->element, $element);
$language->code = $element[1];
?>
<tr class="row<?php echo $i % 2; ?>">
<td class="center">
<?php echo JHtml::_('grid.id', $i, $language->update_id, false, 'cid'); ?>
</td>
<td>
<label for="cb<?php echo $i; ?>">
<?php echo $language->name; ?>

<?php // Display a Note if language pack version is not equal to Joomla version ?>
<?php if (substr($language->version, 0, 3) != $version::RELEASE
|| substr($language->version, 0, 5) != $version->getShortVersion()) : ?>
<div class="small"><?php echo JText::_('JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM'); ?></div>
<?php endif; ?>
</label>
</td>
<td class="small">
<?php echo $language->version; ?>
<td>
<?php echo $language->code; ?>
</td>
<td class="small hidden-phone">
<?php echo JText::_('COM_INSTALLER_TYPE_' . strtoupper($language->type)); ?>
<td class="center">
<?php // Display a Note if language pack version is not equal to Joomla version ?>
<?php if (substr($language->version, 0, 3) != $version::RELEASE || substr($language->version, 0, 5) != $currentShortVersion) : ?>
<span class="label label-warning hasTooltip" title="<?php echo JText::_('JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM'); ?>"><?php echo $language->version; ?></span>
<?php else : ?>
<span class="label label-success"><?php echo $language->version; ?></span>
<?php endif; ?>
</td>
<td class="small hidden-phone">
<?php echo $language->detailsurl; ?>
<a href="<?php echo $language->detailsurl; ?>" target="_blank"><?php echo $language->detailsurl; ?></a>
</td>
<td class="small hidden-phone">
<td class="hidden-phone">
<?php echo $language->update_id; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php else : ?>
<div class="alert"><?php echo JText::_('COM_INSTALLER_MSG_LANGUAGES_NOLANGUAGES'); ?></div>
<?php endif; ?>

<?php endif; ?>
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
Expand Down

This file was deleted.

Expand Up @@ -47,9 +47,11 @@ public function display($tpl = null)
$this->model->findLanguages();

// Get data from the model.
$this->state = $this->get('State');
$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->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');

// Check for errors.
if (count($errors = $this->get('Errors')))
Expand Down
@@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_messages
*
* @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;

JFormHelper::loadFieldClass('list');

JLoader::register('MessagesHelper', JPATH_ADMINISTRATOR . '/components/com_messages/helpers/messages.php');

/**
* Form Field class for the Joomla Framework.
*
* @since 3.5.2
*/
class JFormFieldMessageStates extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 3.5.2
*/
protected $type = 'MessageStates';

/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @since 3.5.2
*/
protected function getOptions()
{
// Merge state options with any additional options in the XML definition.
return array_merge(parent::getOptions(), MessagesHelper::getStateOptions());
}
}
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
label="JSEARCH_FILTER"
description="JSEARCH_FILTER"
hint="JSEARCH_FILTER"
/>
<field
name="state"
type="messagestates"
label="COM_MESSAGES_FILTER_STATES_LABEL"
description="COM_MESSAGES_FILTER_STATES_DESC"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
<option value="*">JALL</option>
</field>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
description="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="a.date_time DESC"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.subject ASC">COM_MESSAGES_HEADING_SUBJECT_ASC</option>
<option value="a.subject DESC">COM_MESSAGES_HEADING_SUBJECT_DESC</option>
<option value="a.state ASC">COM_MESSAGES_HEADING_READ_ASC</option>
<option value="a.state DESC">COM_MESSAGES_HEADING_READ_DESC</option>
<option value="a.user_id_from ASC">COM_MESSAGES_HEADING_FROM_ASC</option>
<option value="a.user_id_from DESC">COM_MESSAGES_HEADING_FROM_DESC</option>
<option value="a.date_time ASC">JDATE_ASC</option>
<option value="a.date_time DESC">JDATE_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIMIT"
description="JGLOBAL_LIMIT"
class="input-mini"
default="5"
onchange="this.form.submit();"
/>
</fields>
</form>

0 comments on commit 9a64c9d

Please sign in to comment.