Skip to content

Commit

Permalink
Merge branch '4.0-dev' into remove-ftp-layer
Browse files Browse the repository at this point in the history
  • Loading branch information
roland-d committed Nov 16, 2018
2 parents c42c1af + c98df41 commit a68fa28
Show file tree
Hide file tree
Showing 322 changed files with 2,718 additions and 1,691 deletions.
1 change: 1 addition & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pipeline:
# needed for system testing
- composer update joomla/test-system --no-progress --no-suggest
- composer update joomla-projects/selenium-server-standalone --no-progress --no-suggest
- composer update joomla-projects/joomla-browser --no-progress --no-suggest
- npm install --unsafe-perm

rebuild-cache:
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_admin/Model/ProfileModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ProfileModel extends UserModel
/**
* Method to get the record form.
*
* @param array $data An optional array of data for the form to interogate.
* @param array $data An optional array of data for the form to interrogate.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return \JForm A \JForm object on success, false on failure
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_admin/Model/SysinfoModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class SysInfoModel extends BaseDatabaseModel
/**
* Remove sections of data marked as private in the privateSettings
*
* @param array $dataArray Array with data tha may contain private informati
* @param array $dataArray Array with data that may contain private information
* @param string $dataType Type of data to search for a specific section in the privateSettings array
*
* @return array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function getInput()
$value = (int) $this->value > 0 ? (int) $this->value : '';

Factory::getDocument()->addScriptOptions('modal-associations', ['itemId' => $value]);
HTMLHelper::_('script', 'com_associations/modal-associations.min.js', false, true);
HTMLHelper::_('script', 'com_associations/modal-associations.min.js', ['version' => 'auto', 'relative' => true]);

// Setup variables for display.
$html = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Administrator
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
);

Text::script('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT', true);
HTMLHelper::_('script', 'com_associations/admin-associations-default.min.js', false, true);
HTMLHelper::_('script', 'com_associations/admin-associations-default.min.js', ['version' => 'auto', 'relative' => true]);
?>
<form action="<?php echo Route::_('index.php?option=com_associations&view=associations'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
);

Factory::getDocument()->addScriptOptions('assosiations-modal', ['func' => $function]);
HTMLHelper::_('script', 'com_associations/admin-associations-modal.min.js', false, true);
HTMLHelper::_('script', 'com_associations/admin-associations-modal.min.js', ['version' => 'auto', 'relative' => true]);
?>
<form action="<?php echo Route::_('index.php?option=com_associations&view=associations&layout=modal&tmpl=component&function='
. $function . '&' . Session::getFormToken() . '=1'); ?>" method="post" name="adminForm" id="adminForm">
Expand All @@ -61,7 +61,7 @@
<table class="table" id="associationsList">
<caption id="captionTable" class="sr-only">
?php echo Text::_('COM_ASSOCIATIONS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
</caption>
</caption>
<thead>
<tr>
<?php if (!empty($this->typeSupports['state'])) : ?>
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_banners/Model/BannerModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,16 @@ public function stick(&$pks, $value = 1)
*
* @param Table $table A record object.
*
* @return array An array of conditions to add to add to ordering queries.
* @return array An array of conditions to add to ordering queries.
*
* @since 1.6
*/
protected function getReorderConditions($table)
{
return array(
'catid = ' . (int) $table->catid,
'state >= 0'
);
return [
$this->_db->quoteName('catid') . ' = ' . (int) $table->catid,
$this->_db->quoteName('state') . ' >= 0',
];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function getItems()
// Load the list items.
$items = parent::getItems();

// If emtpy or an error, just return.
// If empty or an error, just return.
if (empty($items))
{
return array();
Expand Down
3 changes: 1 addition & 2 deletions administrator/components/com_banners/Table/BannerTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ public function store($updateNulls = false)

if ($purchaseType < 0 && $this->cid)
{
/** @var ClientTable $client */
$client = Table::getInstance('Client', __NAMESPACE__ . '\\', array('dbo' => $db));
$client = new ClientTable($db);
$client->load($this->cid);
$purchaseType = $client->purchase_type;
}
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_banners/tmpl/banner/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Router\Route;

HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('formbehavior.chosen', '#jform_catid', null, array('disable_search_threshold' => 0 ));

HTMLHelper::_('script', 'com_banners/admin-banner-edit.min.js', array('version' => 'auto', 'relative' => true));
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Component class for com_categories
*
* @since __DEPLOY_VERSION__
* @since 4.0.0
*/
class CategoriesComponent extends MVCComponent implements BootableExtensionInterface
{
Expand All @@ -37,7 +37,7 @@ class CategoriesComponent extends MVCComponent implements BootableExtensionInter
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 4.0.0
*/
public function boot(ContainerInterface $container)
{
Expand Down
105 changes: 19 additions & 86 deletions administrator/components/com_categories/Field/CategoryeditField.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@

defined('JPATH_BASE') or die;

use Joomla\Utilities\ArrayHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;

FormHelper::loadFieldClass('list');

/**
* Category Edit field..
*
* @since 1.6
*/
class CategoryeditField extends \JFormFieldList
class CategoryeditField extends ListField
{
/**
* To allow creation of new categories.
Expand All @@ -42,6 +40,14 @@ class CategoryeditField extends \JFormFieldList
*/
public $type = 'CategoryEdit';

/**
* Name of the layout being used to render the field
*
* @var string
* @since __DEPLOY_VERSION__
*/
protected $layout = 'joomla.form.field.categoryedit';

/**
* Method to attach a JForm object to the field.
*
Expand Down Expand Up @@ -340,88 +346,15 @@ protected function getOptions()
*/
protected function getInput()
{
$html = array();
$class = array();
$attr = '';

// Initialize some field attributes.
$class[] = !empty($this->class) ? $this->class : '';

if ($this->allowAdd)
{
$customGroupText = Text::_('JGLOBAL_CUSTOM_CATEGORY');

$class[] = 'chosen-custom-value';
$attr .= ' data-custom_group_text="' . $customGroupText . '" '
. 'data-no_results_text="' . Text::_('JGLOBAL_ADD_CUSTOM_CATEGORY') . '" '
. 'data-placeholder="' . Text::_('JGLOBAL_TYPE_OR_SELECT_CATEGORY') . '" ';
}

if ($class)
{
$attr .= 'class="' . implode(' ', $class) . '"';
}

$attr .= !empty($this->size) ? ' size="' . $this->size . '"' : '';
$attr .= $this->multiple ? ' multiple' : '';
$attr .= $this->required ? ' required' : '';
$attr .= $this->autofocus ? ' autofocus' : '';

// To avoid user's confusion, readonly="true" should imply disabled="true".
if ((string) $this->readonly == '1'
|| (string) $this->readonly == 'true'
|| (string) $this->disabled == '1'
|| (string) $this->disabled == 'true')
{
$attr .= ' disabled="disabled"';
}

// Initialize JavaScript field attributes.
$attr .= $this->onchange ? ' onchange="' . $this->onchange . '"' : '';

// Get the field options.
$options = (array) $this->getOptions();
$data = $this->getLayoutData();

// Create a read-only list (no name) with hidden input(s) to store the value(s).
if ((string) $this->readonly == '1' || (string) $this->readonly == 'true')
{
$html[] = HTMLHelper::_('select.genericlist', $options, '', trim($attr), 'value', 'text', $this->value, $this->id);
$data['options'] = $this->getOptions();
$data['allowCustom'] = $this->allowAdd;

// E.g. form field type tag sends $this->value as array
if ($this->multiple && is_array($this->value))
{
if (!count($this->value))
{
$this->value[] = '';
}

foreach ($this->value as $value)
{
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '">';
}
}
else
{
$html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '">';
}
}
else
{
// Create a regular list.
if (count($options) === 0)
{
// All Categories have been deleted, so we need a new category (This will create on save if selected).
$options[0] = new \stdClass;
$options[0]->value = 'Uncategorised';
$options[0]->text = 'Uncategorised';
$options[0]->level = '1';
$options[0]->published = '1';
$options[0]->lft = '1';
}

$html[] = HTMLHelper::_('select.genericlist', $options, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
}
$renderer = $this->getRenderer($this->layout);
$renderer->setComponent('com_categories');
$renderer->setClient(1);

return implode($html);
return $renderer->render($data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,15 @@ public function getForm($data = array(), $loadData = true)
*
* @param \JTableCategory $table Current table instance
*
* @return array An array of conditions to add to add to ordering queries.
* @return array An array of conditions to add to ordering queries.
*
* @since 1.6
*/
protected function getReorderConditions($table)
{
return 'extension = ' . $this->_db->quote($table->extension);
return [
$this->_db->quoteName('extension') . ' = ' . $this->_db->quote($table->extension),
];
}

/**
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_categories/categories.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<folder>forms</folder>
<folder>Helper</folder>
<folder>helpers</folder>
<folder>layouts</folder>
<folder>Model</folder>
<folder>Table</folder>
<folder>tmpl</folder>
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_categories/forms/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

<field
name="parent_id"
class="advancedSelect"
type="categoryedit"
label="COM_CATEGORIES_FIELD_PARENT_LABEL"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
type="tag"
label="JOPTION_SELECT_TAG"
mode="nested"
custom="false"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_TAG</option>
Expand Down

0 comments on commit a68fa28

Please sign in to comment.