Skip to content

Commit

Permalink
Merge branch '4.0-dev' of https://github.com/joomla/joomla-cms into j…
Browse files Browse the repository at this point in the history
…4test_integration

# Conflicts:
#	.drone.yml
  • Loading branch information
Hackwar committed Jun 11, 2019
2 parents 3aa88a1 + a224c87 commit 682a59e
Show file tree
Hide file tree
Showing 158 changed files with 645 additions and 1,067 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Expand Up @@ -70,15 +70,15 @@ steps:
- name: php74-unit
depends_on: [ phpcs ]
image: phpdaily/php:7.4-dev
errignore: true
failure: ignore
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php80-unit
depends_on: [ phpcs ]
image: phpdaily/php:8.0-dev
errignore: true
failure: ignore
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
Expand Down Expand Up @@ -233,6 +233,6 @@ services:

---
kind: signature
hmac: 5cbc6d695236cdb1bb6fa5873903bc40a5ac8ba58d229fac893f7d5f0273406b
hmac: dd025e495e7b2ff29cb89ac1bf7873a0a7059fc3edb3764b443979e01b32e7a5

...
Expand Up @@ -11,7 +11,6 @@

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Utilities\ArrayHelper;
Expand Down Expand Up @@ -107,8 +106,7 @@ public function exportLogs()

$csvDelimiter = ComponentHelper::getComponent('com_actionlogs')->getParams()->get('csv_delimiter', ',');

$app = Factory::getApplication();
$app->setHeader('Content-Type', 'application/csv', true)
$this->app->setHeader('Content-Type', 'application/csv', true)
->setHeader('Content-Disposition', 'attachment; filename="' . $filename . '.csv"', true)
->setHeader('Cache-Control', 'must-revalidate', true)
->sendHeaders();
Expand Down
@@ -0,0 +1 @@
ALTER TABLE `#__extensions` ADD COLUMN `note` varchar(255) AFTER `state`;
@@ -0,0 +1 @@
ALTER TABLE "#__extensions" ADD COLUMN "note" varchar(255);
Expand Up @@ -12,7 +12,6 @@
defined('_JEXEC') or die;

use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;

Expand Down Expand Up @@ -115,7 +114,7 @@ public function display($cachable = false, $urlparams = array())
$model = $this->getModel($vName);

// Load the filter state.
$app = Factory::getApplication();
$app = $this->app;

$model->setState('filter.type', $app->getUserState($this->context . '.filter.type'));
$model->setState('filter.begin', $app->getUserState($this->context . '.filter.begin'));
Expand All @@ -136,7 +135,7 @@ public function display($cachable = false, $urlparams = array())
$cookiePath = $app->get('cookie_path', '/');
$isHttpsForced = $app->isHttpsForced();

$app->input->cookie->set(
$this->input->cookie->set(
ApplicationHelper::getHash($this->context . '.basename'),
$form['basename'],
$cookieLifeTime,
Expand All @@ -146,7 +145,7 @@ public function display($cachable = false, $urlparams = array())
true
);

$app->input->cookie->set(
$this->input->cookie->set(
ApplicationHelper::getHash($this->context . '.compressed'),
$form['compressed'],
$cookieLifeTime,
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_banners/forms/banner.xml
Expand Up @@ -73,7 +73,6 @@
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
maxlength="255"
size="45"
labelclass="control-label"
/>

<field
Expand Down
1 change: 0 additions & 1 deletion administrator/components/com_banners/forms/client.xml
Expand Up @@ -54,7 +54,6 @@
label="JGLOBAL_FIELD_VERSION_NOTE_LABEL"
maxlength="255"
size="45"
labelclass="control-label"
/>

<field
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_banners/tmpl/banner/edit.php
Expand Up @@ -17,6 +17,7 @@
HTMLHelper::_('behavior.formvalidator');

HTMLHelper::_('script', 'com_banners/admin-banner-edit.min.js', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'com_contenthistory/admin-history-versions.js', ['version' => 'auto', 'relative' => true]);
?>

<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="banner-form" class="form-validate">
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_banners/tmpl/client/edit.php
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Router\Route;

HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('script', 'com_contenthistory/admin-history-versions.js', ['version' => 'auto', 'relative' => true]);
?>

<form action="<?php echo Route::_('index.php?option=com_banners&layout=edit&id=' . (int) $this->item->id); ?>" method="post" name="adminForm" id="client-form" class="form-validate">
Expand Down
Expand Up @@ -13,7 +13,6 @@

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Component\Cache\Administrator\Helper\CacheHelper;

/**
* Cache Controller
Expand All @@ -23,48 +22,12 @@
class DisplayController extends BaseController
{
/**
* Display a view.
* The default view for the display method.
*
* @param boolean $cachable If true, the view output will be cached
* @param array $urlparams An array of safe URL parameters and their variable types, for valid values see {@link \JFilterInput::clean()}.
*
* @return static This object to support chaining.
*
* @since 1.5
* @var string
* @since __DEPLOY_VERSION__
*/
public function display($cachable = false, $urlparams = false)
{
// Get the document object.
$document = $this->app->getDocument();

// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'cache');
$vFormat = $document->getType();
$lName = $this->input->get('layout', 'default', 'string');

// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
{
switch ($vName)
{
case 'purge':
$this->app->enqueueMessage(Text::_('COM_CACHE_RESOURCE_INTENSIVE_WARNING'), 'warning');
break;
case 'cache':
default:
$model = $this->getModel($vName);
$view->setModel($model, true);
break;
}

$view->setLayout($lName);

// Push document object into the view.
$view->document = $document;

$view->display();
}
}
protected $default_view = 'cache';

/**
* Method to delete a list of cache groups.
Expand Down Expand Up @@ -161,6 +124,6 @@ public function purge()
$this->app->enqueueMessage(Text::_('COM_CACHE_EXPIRED_ITEMS_HAVE_BEEN_PURGED'), 'message');
}

$this->setRedirect('index.php?option=com_cache&view=purge');
$this->setRedirect('index.php?option=com_cache&view=cache');
}
}
24 changes: 0 additions & 24 deletions administrator/components/com_cache/Helper/CacheHelper.php

This file was deleted.

7 changes: 4 additions & 3 deletions administrator/components/com_cache/View/Cache/HtmlView.php
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;

/**
Expand Down Expand Up @@ -68,18 +69,18 @@ protected function addToolbar()
{
ToolbarHelper::title(Text::_('COM_CACHE_CLEAR_CACHE'), 'lightning clear');

$toolbar = Toolbar::getInstance();
ToolbarHelper::custom('delete', 'delete.png', 'delete_f2.png', 'JTOOLBAR_DELETE', true);
$toolbar->appendButton('Confirm', 'COM_CACHE_RESOURCE_INTENSIVE_WARNING', 'delete', 'COM_CACHE_PURGE_EXPIRED', 'purge', false);
ToolbarHelper::custom('deleteAll', 'remove.png', 'delete_f2.png', 'JTOOLBAR_DELETE_ALL', false);
ToolbarHelper::divider();

if (Factory::getUser()->authorise('core.admin', 'com_cache'))
{
ToolbarHelper::preferences('com_cache');
ToolbarHelper::divider();
}

ToolbarHelper::divider();
ToolbarHelper::help('JHELP_SITE_MAINTENANCE_CLEAR_CACHE');

\JHtmlSidebar::setAction('index.php?option=com_cache');
}
}
61 changes: 0 additions & 61 deletions administrator/components/com_cache/View/Purge/HtmlView.php

This file was deleted.

30 changes: 0 additions & 30 deletions administrator/components/com_cache/tmpl/purge/default.php

This file was deleted.

8 changes: 0 additions & 8 deletions administrator/components/com_cache/tmpl/purge/default.xml

This file was deleted.

Expand Up @@ -11,12 +11,11 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Session\Session;
use Joomla\Input\Input;
use Joomla\Registry\Registry;

/**
Expand All @@ -40,7 +39,7 @@ class CategoryController extends FormController
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param CMSApplication $app The JApplication for the dispatcher
* @param \JInput $input Input
* @param Input $input Input
*
* @since 1.6
* @see \JControllerLegacy
Expand All @@ -66,7 +65,7 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
*/
protected function allowAdd($data = array())
{
$user = Factory::getUser();
$user = $this->app->getIdentity();

return ($user->authorise('core.create', $this->extension) || count($user->getAuthorisedCategories($this->extension, 'core.create')));
}
Expand All @@ -84,7 +83,7 @@ protected function allowAdd($data = array())
protected function allowEdit($data = array(), $key = 'parent_id')
{
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
$user = Factory::getUser();
$user = $this->app->getIdentity();

// Check "edit" permission on record asset (explicit or inherited)
if ($user->authorise('core.edit', $this->extension . '.category.' . $recordId))
Expand Down

0 comments on commit 682a59e

Please sign in to comment.