Skip to content

Commit

Permalink
Merge branch 'staging' into 3.10-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Babker committed Sep 26, 2018
2 parents 501efda + ee78080 commit eb8af52
Show file tree
Hide file tree
Showing 58 changed files with 693 additions and 239 deletions.
29 changes: 29 additions & 0 deletions administrator/components/com_actionlogs/models/actionlogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\Utilities\ArrayHelper;

/**
Expand Down Expand Up @@ -319,4 +320,32 @@ public function purge()
return false;
}
}

/**
* Get the filter form
*
* @param array $data data
* @param boolean $loadData load current data
*
* @return \JForm|boolean The \JForm object or false on error
*
* @since 3.9.0
*/
public function getFilterForm($data = array(), $loadData = true)
{
$form = parent::getFilterForm($data, $loadData);
$params = ComponentHelper::getParams('com_actionlogs');
$ipLogging = (bool) $params->get('ip_logging', 0);

// Add ip sort options to sort dropdown
if ($form && $ipLogging)
{
/* @var JFormFieldList $field */
$field = $form->getField('fullordering', 'list');
$field->addOption(JText::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), array('value' => 'a.ip_address ASC'));
$field->addOption(JText::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), array('value' => 'a.ip_address DESC'));
}

return $form;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
<option value="a.log_date DESC">JDATE_DESC</option>
<option value="a.user_id ASC">COM_ACTIONLOGS_NAME_ASC</option>
<option value="a.user_id DESC">COM_ACTIONLOGS_NAME_DESC</option>
<option value="a.ip_address ASC">COM_ACTIONLOGS_IP_ADDRESS_ASC</option>
<option value="a.ip_address DESC">COM_ACTIONLOGS_IP_ADDRESS_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
Expand Down
5 changes: 0 additions & 5 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,6 @@ public function deleteUnexistingFiles()
'/administrator/components/com_content/views/articles/tmpl/default_batch.php',
'/administrator/components/com_installer/controllers/languages.php',
'/administrator/components/com_languages/layouts/joomla/searchtools/default.php',
'/administrator/components/com_languages/layouts/joomla/searchtools/default/bar.php',
'/administrator/components/com_media/views/medialist/tmpl/thumbs_doc.php',
'/administrator/components/com_media/views/medialist/tmpl/thumbs_folder.php',
'/administrator/components/com_media/views/medialist/tmpl/thumbs_img.php',
Expand Down Expand Up @@ -2132,10 +2131,6 @@ public function deleteUnexistingFiles()
'/administrator/components/com_cache/layouts/joomla/searchtools',
'/administrator/components/com_cache/layouts/joomla',
'/administrator/components/com_cache/layouts',
'/administrator/components/com_languages/layouts/joomla/searchtools/default',
'/administrator/components/com_languages/layouts/joomla/searchtools',
'/administrator/components/com_languages/layouts/joomla',
'/administrator/components/com_languages/layouts',
'/administrator/components/com_modules/layouts/joomla/searchtools/default',
'/administrator/components/com_modules/layouts/joomla/searchtools',
'/administrator/components/com_modules/layouts/joomla',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE `#__privacy_consents` ADD COLUMN `state` INT(10) NOT NULL DEFAULT '1';
ALTER TABLE `#__privacy_consents` ADD COLUMN `state` INT(10) NOT NULL DEFAULT '1' AFTER `user_id`;
44 changes: 8 additions & 36 deletions administrator/components/com_admin/views/profile/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,50 +27,22 @@
// Load chosen.css
JHtml::_('formbehavior.chosen', 'select');

// Get the form fieldsets.
$fieldsets = $this->form->getFieldsets();
// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
$this->ignore_fieldsets = array('user_details');
?>

<form action="<?php echo JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->item->id); ?>" method="post" name="adminForm" id="profile-form" class="form-validate form-horizontal" enctype="multipart/form-data">
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'account')); ?>

<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'account', JText::_('COM_ADMIN_USER_ACCOUNT_DETAILS')); ?>
<?php foreach ($this->form->getFieldset('user_details') as $field) : ?>
<div class="control-group">
<div class="control-label"><?php echo $field->label; ?></div>
<div class="controls">
<?php if ($field->fieldname == 'password2') : ?>
<?php // Disables autocomplete ?> <input type="password" style="display:none">
<?php endif; ?>
<?php echo $field->input; ?>
</div>
</div>
<?php if ($field->fieldname === 'password2') : ?>
<?php // Disables autocomplete ?>
<input type="password" style="display:none">
<?php endif; ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>

<?php foreach ($fieldsets as $fieldset) : ?>
<?php
if ($fieldset->name == 'user_details')
{
continue;
}
?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', $fieldset->name, JText::_($fieldset->label)); ?>
<?php foreach ($this->form->getFieldset($fieldset->name) as $field) : ?>
<?php if ($field->hidden) : ?>
<div class="control-group">
<div class="controls"><?php echo $field->input; ?></div>
</div>
<?php else : ?>
<div class="control-group">
<div class="control-label"><?php echo $field->label; ?></div>
<div class="controls"><?php echo $field->input; ?></div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endforeach; ?>

<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
Expand Down
18 changes: 1 addition & 17 deletions administrator/components/com_config/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
/**
* Config Component Controller
*
* @since 1.5
* @deprecated 4.0
* @since 1.5
*/
class ConfigController extends JControllerLegacy
{
/**
* @var string The default view.
* @since 1.6
* @deprecated 4.0
*/
protected $default_view = 'application';

Expand All @@ -33,26 +31,12 @@ class ConfigController extends JControllerLegacy
* @return ConfigController This object to support chaining.
*
* @since 1.5
* @deprecated 4.0
*/
public function display($cachable = false, $urlparams = array())
{
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'application');

try
{
JLog::add(
sprintf('%s is deprecated. Use ConfigControllerApplicationDisplay or ConfigControllerComponentDisplay instead.', __CLASS__),
JLog::WARNING,
'deprecated'
);
}
catch (RuntimeException $exception)
{
// Informational log only
}

if (ucfirst($vName) == 'Application')
{
$controller = new ConfigControllerApplicationDisplay;
Expand Down
2 changes: 2 additions & 0 deletions administrator/components/com_content/models/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ protected function getListQuery()
* @return stdClass
*
* @since 1.6
*
* @deprecated 4.0 To be removed with Hathor
*/
public function getAuthors()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class ContentViewArticles extends JViewLegacy
* The item authors
*
* @var stdClass
*
* @deprecated 4.0 To be removed with Hathor
*/
protected $authors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class ContentViewFeatured extends JViewLegacy
* The item authors
*
* @var stdClass
*
* @deprecated 4.0 To be removed with Hathor
*/
protected $authors;

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_languages/models/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class LanguagesModelInstalled extends JModelList
protected $data = null;

/**
* @var int total number pf languages
* @var int total number of languages
*/
protected $total = null;

/**
* @var int total number pf languages installed
* @var int total number of languages installed
* @deprecated 4.0
*/
protected $langlist = null;
Expand Down
29 changes: 22 additions & 7 deletions administrator/components/com_menus/models/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,28 @@ protected function getListQuery()

if (!empty($parentId))
{
$query->where('a.parent_id = ' . (int) $parentId);
$level = $this->getState('filter.level');

// Create a subquery for the sub-items list
$subQuery = $db->getQuery(true)
->select('sub.id')
->from('#__menu as sub')
->join('INNER', '#__menu as this ON sub.lft > this.lft AND sub.rgt < this.rgt')
->where('this.id = ' . (int) $parentId);

if ($level)
{
$subQuery->where('sub.level <= this.level + ' . (int) ($level - 1));
}

// Add the subquery to the main query
$query->where('(a.parent_id = ' . (int) $parentId . ' OR a.parent_id IN (' . (string) $subQuery . '))');
}

// Filter on the level.
elseif ($level = $this->getState('filter.level'))
{
$query->where('a.level <= ' . (int) $level);
}

// Filter the items over the menu id if set.
Expand Down Expand Up @@ -421,12 +442,6 @@ protected function getListQuery()
}
}

// Filter on the level.
if ($level = $this->getState('filter.level'))
{
$query->where('a.level <= ' . (int) $level);
}

// Filter on the language.
if ($language = $this->getState('filter.language'))
{
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_privacy/helpers/privacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function addSubmenu($vName)
*/
public static function renderDataAsXml(array $exportData)
{
$export = new SimpleXMLElement("<data-export />");
$export = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><data-export />');

foreach ($exportData as $domain)
{
Expand Down
20 changes: 18 additions & 2 deletions administrator/components/com_privacy/models/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ class PrivacyModelDashboard extends JModelLegacy
public function getPrivacyPolicyInfo()
{
$policy = array(
'published' => false,
'editLink' => '',
'published' => false,
'articlePublished' => false,
'editLink' => '',
);

/*
Expand Down Expand Up @@ -84,10 +85,25 @@ public function getRequestFormPublished()
$item = $menu->getItems('link', 'index.php?option=com_privacy&view=request', true);

$status = array(
'exists' => false,
'published' => false,
'link' => '',
);

$db = $this->getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__menu'))
->where($db->quoteName('client_id') . ' = 0')
->where($db->quoteName('link') . ' = ' . $db->quote('index.php?option=com_privacy&view=request'));
$db->setQuery($query);

// Check if the menu item exists in database
if ($db->loadResult())
{
$status['exists'] = true;
}

$linkMode = $app->get('force_ssl', 0) == 2 ? 1 : -1;

if (!($item instanceof JMenuItem))
Expand Down
Loading

0 comments on commit eb8af52

Please sign in to comment.