Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/upstream/3.8-dev' into j3/names…
Browse files Browse the repository at this point in the history
…pace/router

# Conflicts:
#	libraries/classmap.php
  • Loading branch information
laoneo committed May 9, 2017
2 parents 5ec1e9c + 82b0f47 commit 294d4af
Show file tree
Hide file tree
Showing 197 changed files with 6,415 additions and 5,059 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,9 @@ public function deleteUnexistingFiles()
'/administrator/components/com_messages/layouts/toolbar/mysettings.php',
'/media/editors/tinymce/plugins/jdragdrop/plugin.js',
'/media/editors/tinymce/plugins/jdragdrop/plugin.min.js',
// Joomla 3.7.1
'/media/editors/tinymce/langs/uk-UA.js',
'/media/system/js/fields/calendar-locales/zh.js',
);

// TODO There is an issue while deleting folders using the ftp mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ CREATE TABLE "#__fields_groups" (
"access" bigint DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
CREATE INDEX "#__fields_idx_checked_out" ON "#__fields_groups" ("checked_out");
CREATE INDEX "#__fields_idx_state" ON "#__fields_groups" ("state");
CREATE INDEX "#__fields_idx_created_by" ON "#__fields_groups" ("created_by");
CREATE INDEX "#__fields_idx_access" ON "#__fields_groups" ("access");
CREATE INDEX "#__fields_idx_context" ON "#__fields_groups" ("context");
CREATE INDEX "#__fields_idx_language" ON "#__fields_groups" ("language");
CREATE INDEX "#__fields_groups_idx_checked_out" ON "#__fields_groups" ("checked_out");
CREATE INDEX "#__fields_groups_idx_state" ON "#__fields_groups" ("state");
CREATE INDEX "#__fields_groups_idx_created_by" ON "#__fields_groups" ("created_by");
CREATE INDEX "#__fields_groups_idx_access" ON "#__fields_groups" ("access");
CREATE INDEX "#__fields_groups_idx_context" ON "#__fields_groups" ("context");
CREATE INDEX "#__fields_groups_idx_language" ON "#__fields_groups" ("language");

--
-- Table: #__fields_values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function display($tpl = null)
*
* @since 1.6
* @note Necessary for Hathor compatibility
* @deprecated 4.0 To be removed with Hathor
*/
protected function _setSubMenu()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class AssociationsControllerAssociation extends JControllerForm
*/
public function edit($key = null, $urlVar = null)
{
list($extensionName, $typeName) = explode('.', $this->input->get('itemtype'));
list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string'));

$id = $this->input->get('id', 0);
$id = $this->input->get('id', 0, 'int');

// Check if reference item can be edited.
if (!AssociationsHelper::allowEdit($extensionName, $typeName, $id))
Expand All @@ -60,7 +60,7 @@ public function cancel($key = null)
{
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

list($extensionName, $typeName) = explode('.', $this->input->get('itemtype'));
list($extensionName, $typeName) = explode('.', $this->input->get('itemtype', '', 'string'));

// Only check in, if component item type allows to check out.
if (AssociationsHelper::typeSupportsCheckout($extensionName, $typeName))
Expand All @@ -73,7 +73,7 @@ public function cancel($key = null)
$ids = array_unique(explode(',', $targetId));
}

$ids[] = $this->input->get('id', 0);
$ids[] = $this->input->get('id', 0, 'int');

foreach ($ids as $key => $id)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function getOptions()
{
$input = JFactory::getApplication()->input;

list($extensionName, $typeName) = explode('.', $input->get('itemtype'));
list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string'));

// Get the extension specific helper method
$helper = AssociationsHelper::getExtensionHelper($extensionName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,22 @@ class AssociationsViewAssociation extends JViewLegacy
* @return void
*
* @since 3.7.0
* @throws Exception
*/
public function display($tpl = null)
{
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode("\n", $errors), 500);

return false;
}

$this->app = JFactory::getApplication();
$this->form = $this->get('Form');
$input = $this->app->input;
$this->referenceId = $input->get('id', 0, 'int');

list($extensionName, $typeName) = explode('.', $input->get('itemtype'));
list($extensionName, $typeName) = explode('.', $input->get('itemtype', '', 'string'));

$extension = AssociationsHelper::getSupportedExtension($extensionName);
$types = $extension->get('types');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center">
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_config/model/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function save($data)
* Look for a custom cache_path
* First check if a path is given in the submitted data, then check if a path exists in the previous data, otherwise use the default
*/
if ($data['cache_path'])
if (!empty($data['cache_path']))
{
$path = $data['cache_path'];
}
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_contact/helpers/associations.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

defined('_JEXEC') or die;

use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Association\AssociationExtensionHelper;

JTable::addIncludePath(__DIR__ . '/../tables');

Expand All @@ -18,7 +18,7 @@
*
* @since 3.7.0
*/
class ContactAssociationsHelper extends JAssociationExtensionHelper
class ContactAssociationsHelper extends AssociationExtensionHelper
{
/**
* The extension name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5"
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
value="<?php echo $item->ordering; ?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center">
Expand Down
15 changes: 8 additions & 7 deletions administrator/components/com_content/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
type="plugins"
label="COM_CONTENT_FIELD_CAPTCHA_LABEL"
description="COM_CONTENT_FIELD_CAPTCHA_DESC"
default="0"
default=""
folder="captcha"
filter="cmd"
>
Expand Down Expand Up @@ -762,6 +762,7 @@
<fieldset name="list_default_parameters"
label="JGLOBAL_LIST_LAYOUT_OPTIONS"
description="COM_CONTENT_CONFIG_LIST_SETTINGS_DESC"
addfieldpath="/administrator/components/com_content/models/fields"
>

<field name="show_pagination_limit"
Expand Down Expand Up @@ -836,21 +837,21 @@
</field>

<field name="list_show_votes"
type="list"
type="votelist"
default="0"
label="JGLOBAL_LIST_VOTES_LABEL"
description="JGLOBAL_LIST_VOTES_DESC">
<option value="1" requires="vote">JSHOW</option>
<option value="0" requires="vote">JHIDE</option>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>

<field name="list_show_ratings"
type="list"
type="votelist"
default="0"
label="JGLOBAL_LIST_RATINGS_LABEL"
description="JGLOBAL_LIST_RATINGS_DESC">
<option value="1" requires="vote">JSHOW</option>
<option value="0" requires="vote">JHIDE</option>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>

</fieldset>
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_content/helpers/associations.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

defined('_JEXEC') or die;

use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Association\AssociationExtensionHelper;

/**
* Content associations helper.
*
* @since 3.7.0
*/
class ContentAssociationsHelper extends JAssociationExtensionHelper
class ContentAssociationsHelper extends AssociationExtensionHelper
{
/**
* The extension name
Expand Down
34 changes: 33 additions & 1 deletion administrator/components/com_content/models/article.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public function getForm($data = array(), $loadData = true)
protected function loadFormData()
{
// Check the session for previously entered form data.
$app = JFactory::getApplication();
$app = JFactory::getApplication();
$data = $app->getUserState('com_content.edit.article.data', array());

if (empty($data))
Expand Down Expand Up @@ -451,6 +451,38 @@ protected function loadFormData()
return $data;
}

/**
* Method to validate the form data.
*
* @param JForm $form The form to validate against.
* @param array $data The data to validate.
* @param string $group The name of the field group to validate.
*
* @return array|boolean Array of filtered data if valid, false otherwise.
*
* @see JFormRule
* @see JFilterInput
* @since 3.7.0
*/
public function validate($form, $data, $group = null)
{
// Don't allow to change the users if not allowed to access com_users.
if (JFactory::getApplication()->isClient('administrator') && !JFactory::getUser()->authorise('core.manage', 'com_users'))
{
if (isset($data['created_by']))
{
unset($data['created_by']);
}

if (isset($data['modified_by']))
{
unset($data['modified_by']);
}
}

return parent::validate($form, $data, $group);
}

/**
* Method to save the form data.
*
Expand Down
13 changes: 4 additions & 9 deletions administrator/components/com_content/models/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public function __construct($config = array())
'author_id',
'category_id',
'level',
'tag'
'tag',
'rating_count', 'rating',
);

if (JLanguageAssociations::isEnabled())
Expand Down Expand Up @@ -322,14 +323,8 @@ protected function getListQuery()
}

// Add the list ordering clause.
$orderCol = $this->state->get('list.fullordering', 'a.id');
$orderDirn = '';

if (empty($orderCol))
{
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'DESC');
}
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'DESC');

$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));

Expand Down
13 changes: 4 additions & 9 deletions administrator/components/com_content/models/featured.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public function __construct($config = array())
'author_id',
'category_id',
'level',
'tag'
'tag',
'rating_count', 'rating',
);
}

Expand Down Expand Up @@ -220,14 +221,8 @@ protected function getListQuery()
}

// Add the list ordering clause.
$orderCol = $this->state->get('list.fullordering', 'a.title');
$orderDirn = '';

if (empty($orderCol))
{
$orderCol = $this->state->get('list.ordering', 'a.title');
$orderDirn = $this->state->get('list.direction', 'ASC');
}
$orderCol = $this->state->get('list.ordering', 'a.title');
$orderDirn = $this->state->get('list.direction', 'ASC');

$query->order($db->escape($orderCol) . ' ' . $db->escape($orderDirn));

Expand Down
43 changes: 43 additions & 0 deletions administrator/components/com_content/models/fields/votelist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

JFormHelper::loadFieldClass('list');

/**
* Votelist Field class.
*
* @since __DEPLOY_VERSION__
*/
class JFormFieldVotelist extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since __DEPLOY_VERSION__
*/
protected $type = 'Votelist';

/**
* Method to get the field options.
*
* @return array The field option objects.
*
* @throws \Exception
*
* @since __DEPLOY_VERSION__
*/
public function getOptions()
{
// Requires vote plugin enabled
return JPluginHelper::isEnabled('content', 'vote') ? parent::getOptions() : array();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$app = JFactory::getApplication();
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering'));
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'a.ordering';
$columns = 10;
Expand Down Expand Up @@ -147,7 +147,7 @@
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public function display($tpl = null)
}

// Levels filter - Used in Hathor.
// @deprecated 4.0 To be removed with Hathor
$this->f_levels = array(
JHtml::_('select.option', '1', JText::_('J1')),
JHtml::_('select.option', '2', JText::_('J2')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = str_replace(' ' . $this->state->get('list.direction'), '', $this->state->get('list.fullordering'));
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
$saveOrder = $listOrder == 'fp.ordering';
$columns = 10;
Expand Down Expand Up @@ -141,7 +141,7 @@
<span class="icon-menu" aria-hidden="true"></span>
</span>
<?php if ($canChange && $saveOrder) : ?>
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order " />
<input type="text" style="display:none" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order" />
<?php endif; ?>
</td>
<td class="center">
Expand Down

0 comments on commit 294d4af

Please sign in to comment.