Skip to content

Commit

Permalink
Merge branch '4.0-dev' into log-deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedik committed Oct 24, 2020
2 parents e380943 + 29b2267 commit 4271eb2
Show file tree
Hide file tree
Showing 64 changed files with 300 additions and 505 deletions.
34 changes: 5 additions & 29 deletions .drone.yml
Expand Up @@ -24,7 +24,7 @@ steps:
- echo $(date)

- name: npm
image: node:current-alpine
image: node:14-alpine
depends_on: [ phpcs ]
commands:
- npm ci --unsafe-perm
Expand Down Expand Up @@ -120,28 +120,16 @@ steps:
depends_on: [ npm ]
image: node:current-alpine
commands:
- npx stylelint -s scss "administrator/components/com_media/resources/**/*.scss" "administrator/templates/**/*.scss" "build/media_source/**/*.scss" "templates/**/*.scss" "installation/template/**/*.scss"
- npm run lint:css

- name: javascript-cs
depends_on: [ npm ]
image: node:current-alpine
commands:
- npx eslint "**/*.js"

- name: javascript-tests
depends_on: [ npm ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
- sleep 3
- fluxbox > /dev/null 2>&1 &
- npm run test
- npm run lint:js

- name: system-tests-mysql
depends_on: [ javascript-tests ]
depends_on: [ javascript-cs ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
Expand Down Expand Up @@ -215,15 +203,9 @@ branches:
exclude: [ l10n_* ]

volumes:
- name: cache
host:
path: /tmp/cache
- name: composer-cache
host:
path: /tmp/composer-cache
- name: reference
host:
path: /tmp/reference

services:
- name: mysql
Expand All @@ -243,12 +225,6 @@ services:
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_DATABASE: test_joomla

- name: memcached
image: memcached:alpine

- name: redis
image: redis:alpine

- name: postgres
image: postgres:11-alpine
ports:
Expand Down Expand Up @@ -293,6 +269,6 @@ steps:

---
kind: signature
hmac: 400e7cdcd516fbb54ccc3f0f152e39a86346a47b7876a65741fec4898fe80b1f
hmac: f99784b6fd6bf3707a600f262bb9e59aa7b5f97e54df8976e459096de4344ef3

...
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

Expand Up @@ -4,9 +4,11 @@ DELETE FROM `#__extensions` WHERE `name` = 'plg_authentication_gmail' AND `type`
--
-- Delete possibly duplicate record for plg_sampledata_multilang
--
DELETE FROM `#__extensions`
WHERE `name` = 'plg_sampledata_multilang' AND `type` = 'plugin' AND `element` = 'multilang' AND `folder` = 'sampledata' AND `client_id` = 0
AND `extension_id` < (SELECT MAX(`extension_id`) FROM `#__extensions` WHERE `name` = 'plg_sampledata_multilang' AND `type` = 'plugin' AND `element` = 'multilang' AND `folder` = 'sampledata' AND `client_id` = 0);
DELETE `e1`.*
FROM `#__extensions` AS `e1`
LEFT JOIN (SELECT MAX(extension_id) AS last_id FROM `#__extensions` GROUP BY `name`,`type`,`element`,`folder`,`client_id`) AS `e2`
ON `e2`.`last_id` = `e1`.`extension_id`
WHERE `last_id` IS NULL;

--
-- Enable the remaining plg_sampledata_multilang record in case it has been disabled before
Expand Down
Expand Up @@ -14,6 +14,7 @@
use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\Component\Admin\Administrator\Service\HTML\Configuration;
use Joomla\Component\Admin\Administrator\Service\HTML\Directory;
use Joomla\Component\Admin\Administrator\Service\HTML\PhpSetting;
use Joomla\Component\Admin\Administrator\Service\HTML\System;
Expand Down Expand Up @@ -46,5 +47,6 @@ public function boot(ContainerInterface $container)
$this->getRegistry()->register('system', new System);
$this->getRegistry()->register('phpsetting', new PhpSetting);
$this->getRegistry()->register('directory', new Directory);
$this->getRegistry()->register('configuration', new Configuration);
}
}
@@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_admin
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Admin\Administrator\Service\HTML;

\defined('_JEXEC') or die;

/**
* Class for rendering configuration values
*
* @since __DEPLOY_VERSION__
*/
class Configuration
{
/**
* Method to generate a string for a value
*
* @param mixed $value The configuration value
*
* @return string Formatted and escaped string
*
* @since __DEPLOY_VERSION__
*/
public function value($value): string
{
if (\is_bool($value))
{
return $value ? 'true' : 'false';
}

if (\is_array($value))
{
$value = implode(', ', $value);
}

return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
}
8 changes: 6 additions & 2 deletions administrator/components/com_admin/tmpl/help/default.php
Expand Up @@ -20,7 +20,11 @@
<form action="<?php echo Route::_('index.php?option=com_admin&amp;view=help'); ?>" method="post" name="adminForm" id="adminForm">
<div class="row mt-sm-3">
<div id="sidebar" class="col-md-3">
<div class="sidebar-nav">
<button class="btn btn-sm btn-secondary my-2 options-menu d-md-none" type="button" data-toggle="collapse" data-target=".sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false">
<span class="fas fa-align-justify" aria-hidden="true"></span>
<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>
</button>
<div class="sidebar-nav" id="help-index">
<ul class="nav flex-column">
<li><?php echo HTMLHelper::_('link', Help::createUrl('JHELP_START_HERE'), Text::_('COM_ADMIN_START_HERE'), ['target' => 'helpFrame']); ?></li>
<li><?php echo HTMLHelper::_('link', $this->latestVersionCheck, Text::_('COM_ADMIN_LATEST_VERSION_CHECK'), ['target' => 'helpFrame']); ?></li>
Expand All @@ -38,7 +42,7 @@
</div>
</div>
<div class="col-md-9">
<iframe name="helpFrame" title="helpFrame" height="2100px" src="<?php echo $this->page; ?>" class="helpFrame table table-bordered"></iframe>
<iframe onLoad="var x = getElementById('help-index'); x.classList.remove('show');" name="helpFrame" title="helpFrame" height="2100px" src="<?php echo $this->page; ?>" class="helpFrame table table-bordered"></iframe>
</div>
</div>
<input class="textarea" type="hidden" name="option" value="com_admin">
Expand Down
Expand Up @@ -9,6 +9,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;

/** @var \Joomla\Component\Admin\Administrator\View\Sysinfo\HtmlView $this */
Expand All @@ -35,10 +36,7 @@
<?php echo $key; ?>
</th>
<td>
<?php if (is_bool($value)) : ?>
<?php $value = $value === true ? 'true' : 'false'; ?>
<?php endif; ?>
<?php echo htmlspecialchars($value, ENT_QUOTES); ?>
<?php echo HTMLHelper::_('configuration.value', $value); ?>
</td>
</tr>
<?php endforeach; ?>
Expand Down
Expand Up @@ -43,7 +43,7 @@

<?php // Begin Sidebar ?>
<div class="col-md-3" id="sidebar">
<button class="btn btn-sm btn-secondary my-2 options-menu d-md-none" type="button" data-toggle="collapse" data-target=".sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false" aria-label="<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>">
<button class="btn btn-sm btn-secondary my-2 options-menu d-md-none" type="button" data-toggle="collapse" data-target=".sidebar-nav" aria-controls="sidebar-nav" aria-expanded="false">
<span class="fas fa-align-justify" aria-hidden="true"></span>
<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>
</button>
Expand Down
21 changes: 8 additions & 13 deletions administrator/components/com_cpanel/tmpl/cpanel/default.php
Expand Up @@ -62,19 +62,14 @@
echo ModuleHelper::renderModule($module, array('style' => 'well'));
}
?>
<?php if ($user->authorise('core.manage', 'com_modules')) : ?>
<button type="button" data-toggle="modal" data-target="#moduleDashboardAddModal" class="cpanel-add-module text-center py-5 w-100 d-block">
<div class="cpanel-add-module-icon text-center">
<span class="fas fa-plus-square text-light mt-2"></span>
</div>
<span><?php echo Text::_('COM_CPANEL_ADD_DASHBOARD_MODULE'); ?></span>
</button>
<?php endif; ?>
</div>
</div>
</div>

<?php if ($user->authorise('core.manage', 'com_modules')) : ?>
<div class="row">
<div class="col-md-6">
<button type="button" data-toggle="modal" data-target="#moduleDashboardAddModal" class="cpanel-add-module text-center py-5 w-100 d-block">
<div class="cpanel-add-module-icon text-center">
<span class="fas fa-plus-square text-light mt-2"></span>
</div>
<span><?php echo Text::_('COM_CPANEL_ADD_DASHBOARD_MODULE'); ?></span>
</button>
</div>
</div>
<?php endif; ?>
Expand Up @@ -13,7 +13,6 @@

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Uri\Uri;

/**
Expand Down Expand Up @@ -80,53 +79,24 @@ public function login()

$result = $app->login($credentials, array('action' => 'core.login.admin'));

if ($app->input->getCmd('format') == 'json')
if ($result && !($result instanceof \Exception))
{
if ($result && !($result instanceof \Exception))
// Only redirect to an internal URL.
if (Uri::isInternal($return))
{
// Only redirect to an internal URL.
if (!Uri::isInternal($return) || strpos($return, 'tmpl=component') !== false)
// If &tmpl=component - redirect to index.php
if (strpos($return, 'tmpl=component') === false)
{
$return = 'index.php';
$app->redirect($return);
}

// We redirect via JS, so the session is not filled in the application
// So we do it manually
$messages = $app->getMessageQueue();

$app->getSession()->set('application.queue', $messages);

$response = new JsonResponse((object) ['return' => $return]);
}
else
{
$message = null;

if ($result instanceof \Exception)
else
{
$message = $result->getMessage();
$app->redirect('index.php');
}

$response = new JsonResponse(null, $message, true);
}

echo $response;
}
else
{
if ($result && !($result instanceof \Exception))
{
// Only redirect to an internal URL.
if (Uri::isInternal($return) && strpos($return, 'tmpl=component') === false)
{
$app->redirect($return);
}

$app->redirect('index.php');
}

$this->display();
}
$this->display();
}

/**
Expand Down
Expand Up @@ -149,7 +149,8 @@ export default {
/* Hide actions dropdown */
hideActions() {
this.showActions = false;
this.$nextTick(() => { this.$refs.actionToggle ? this.$refs.actionToggle.focus() : false });
// eslint-disable-next-line no-unused-expressions
this.$nextTick(() => { this.$refs.actionToggle ? this.$refs.actionToggle.focus() : false; });
},
},
};
Expand Down
Expand Up @@ -18,7 +18,7 @@
<div class="modal-content">
<div class="modal-header">
<slot name="header" />
<slot name="backdrop-close"></slot>
<slot name="backdrop-close" />
<button
v-if="showClose"
type="button"
Expand Down
Expand Up @@ -416,8 +416,8 @@
'footer' => $this->loadTemplate('modal_file_footer'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => 50,
'modalWidth' => 60,
'bodyHeight' => 70,
'modalWidth' => 80,
),
'body' => $this->loadTemplate('modal_file_body')
);
Expand All @@ -431,8 +431,8 @@
'footer' => $this->loadTemplate('modal_folder_footer'),
'height' => '400px',
'width' => '800px',
'bodyHeight' => 50,
'modalWidth' => 60,
'bodyHeight' => 70,
'modalWidth' => 80,
),
'body' => $this->loadTemplate('modal_folder_body')
);
Expand Down
Expand Up @@ -20,12 +20,12 @@
<div id="#template-manager-file" class="container-fluid">
<div class="mt-2 p-2">
<div class="row">
<div class="col-md-6">
<div class="col-md-4">
<div class="tree-holder">
<?php echo $this->loadTemplate('folders'); ?>
</div>
</div>
<div class="col-md-6">
<div class="col-md-8">
<div class="card card-outline-secondary mb-2">
<div class="card-body">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.createFile&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
Expand Down
Expand Up @@ -19,12 +19,12 @@
<div id="#template-manager-folder" class="container-fluid">
<div class="mt-2 p-2">
<div class="row">
<div class="col-md-6">
<div class="col-md-4">
<div class="tree-holder">
<?php echo $this->loadTemplate('folders'); ?>
</div>
</div>
<div class="col-md-6">
<div class="col-md-8">
<div class="card card-outline-secondary mb-2">
<div class="card-body">
<form method="post" action="<?php echo Route::_('index.php?option=com_templates&task=template.createFolder&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
Expand Down

0 comments on commit 4271eb2

Please sign in to comment.