Skip to content
Permalink
Browse files

Merge branch '4.0-dev' into drop_server_config_files

  • Loading branch information...
zero-24 committed Sep 6, 2019
2 parents 77aa389 + 8980efa commit a4497af7b421a30ce6f57aed6d253c8b294eddf8
Showing with 923 additions and 273 deletions.
  1. +2 −0 administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-08-03.sql
  2. +2 −0 administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-03.sql
  3. +2 −1 administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-08-31.sql
  4. +6 −1 administrator/components/com_cache/tmpl/cache/default.php
  5. +1 −1 administrator/components/com_fields/Dispatcher/Dispatcher.php
  6. +5 −5 administrator/components/com_fields/Field/TypeField.php
  7. +13 −0 administrator/components/com_installer/Controller/DisplayController.php
  8. +23 −0 administrator/components/com_installer/Controller/UpdatesiteController.php
  9. +49 −1 administrator/components/com_installer/Helper/InstallerHelper.php
  10. +138 −0 administrator/components/com_installer/Model/UpdatesiteModel.php
  11. +150 −84 administrator/components/com_installer/Model/UpdatesitesModel.php
  12. +37 −0 administrator/components/com_installer/Table/UpdatesiteTable.php
  13. +115 −0 administrator/components/com_installer/View/Updatesite/HtmlView.php
  14. +41 −19 administrator/components/com_installer/View/Updatesites/HtmlView.php
  15. +1 −0 administrator/components/com_installer/access.xml
  16. +42 −0 administrator/components/com_installer/forms/updatesite.xml
  17. +23 −0 administrator/components/com_installer/tmpl/updatesite/edit.php
  18. +30 −4 administrator/components/com_installer/tmpl/updatesites/default.php
  19. +106 −49 administrator/components/com_joomlaupdate/tmpl/joomlaupdate/default_preupdatecheck.php
  20. +6 −5 administrator/components/com_menus/presets/alternate.xml
  21. +15 −0 administrator/language/en-GB/en-GB.com_installer.ini
  22. +0 −1 administrator/language/en-GB/en-GB.com_installer.sys.ini
  23. +12 −7 administrator/language/en-GB/en-GB.com_joomlaupdate.ini
  24. +2 −0 administrator/language/en-GB/en-GB.ini
  25. +4 −4 administrator/modules/mod_quickicon/Helper/QuickIconHelper.php
  26. +7 −0 administrator/templates/atum/scss/pages/_com_joomlaupdate.scss
  27. +1 −0 administrator/templates/atum/scss/template.scss
  28. +2 −0 build/media_source/mod_login/js/admin-login.es6.js
  29. +2 −0 installation/sql/mysql/joomla.sql
  30. +3 −1 installation/sql/postgresql/joomla.sql
  31. +19 −15 libraries/src/UCM/UCMContent.php
  32. +19 −17 libraries/src/UCM/UCMType.php
  33. +45 −58 plugins/installer/override/override.php
@@ -0,0 +1,2 @@
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` int(10) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out_time` datetime NULL DEFAULT NULL;
@@ -0,0 +1,2 @@
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out` bigint DEFAULT 0 NOT NULL;
ALTER TABLE `#__update_sites` ADD COLUMN `checked_out_time` timestamp without time zone DEFAULT NULL;
@@ -1 +1,2 @@
INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id", "publish_up", "publish_down") VALUES (18, 'main', 'com_messages_manager', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, 15, 0, '1970-01-01 00:00:00', 0, 0, 'class:messages', 0, '', 17, 20, 0, '*', 1, '1970-01-01 00:00:00', '1970-01-01 00:00:00');
INSERT INTO "#__menu" ("id", "menutype", "title", "alias", "note", "path", "link", "type", "published", "parent_id", "level", "component_id", "checked_out", "checked_out_time", "browserNav", "access", "img", "template_style_id", "params", "lft", "rgt", "home", "language", "client_id")
SELECT 18, 'main', 'com_messages_manage', 'Private Messages', '', 'Messaging/Private Messages', 'index.php?option=com_messages&view=messages', 'component', 1, 10, 2, "extension_id", 0, '1970-01-01 00:00:00', 0, 0, 'class:messages-add', 0, '', 18, 19, 0, '*', 1 FROM "#__extensions" WHERE "name" = 'com_messages';
@@ -26,7 +26,12 @@
<div class="col-md-12">
<div id="j-main-container" class="j-main-container">
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
<?php if (count($this->data) > 0) : ?>
<?php if (empty($this->items)) : ?>
<div class="alert alert-info">
<span class="fa fa-info-circle" aria-hidden="true"></span><span class="sr-only"><?php echo Text::_('INFO'); ?></span>
<?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
</div>
<?php else : ?>
<table class="table">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_CACHE_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
@@ -16,7 +16,7 @@
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
/**
* ComponentDispatcher class for com_content
* ComponentDispatcher class for com_fields
*
* @since 4.0.0
*/
@@ -77,17 +77,17 @@ function ($a, $b)
}
);
// Preload the Loading indication
HTMLHelper::_('webcomponent', 'system/joomla-core-loader.min.js', ['relative' => true, 'version' => 'auto']);
$js = <<<JS
(function () {
window.typeHasChanged = function(element) {
Joomla.loadingLayer('show');
// Display the loading indication
document.body.appendChild(document.createElement('joomla-core-loader'));
document.querySelector('input[name=task]').value = 'field.reload';
element.form.submit();
};
document.addEventListener('DOMContentLaoded', function() {
Joomla.loadingLayer('load');
});
})();
JS;
@@ -13,8 +13,10 @@
use Joomla\CMS\Client\ClientHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Router\Route;
/**
* Installer Controller
@@ -42,6 +44,17 @@ public function display($cachable = false, $urlparams = false)
$vName = $this->input->get('view', 'install');
$vFormat = $document->getType();
$lName = $this->input->get('layout', 'default', 'string');
$id = $this->input->getInt('update_site_id');
// Check for edit form.
if ($vName === 'updatesite' && $lName === 'edit' && !$this->checkEditId('com_installer.edit.updatesite', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setMessage(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(Route::_('index.php?option=com_installer&view=updatesites', false));
$this->redirect();
}
// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
@@ -0,0 +1,23 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_installer
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Installer\Administrator\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\FormController;
/**
* Controller for a single update site
*
* @since __DEPLOY_VERSION__
*/
class UpdatesiteController extends FormController
{
}
@@ -14,6 +14,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Object\CMSObject;
/**
* Installer helper.
@@ -137,7 +138,7 @@ public static function getInstallationXML($element, $type, $client_id = 1, $fold
$path .= '/plugins/' . $folder . '/' . $element . '/' . $element . '.xml';
break;
case 'module':
$path .= '/modules/' . $element . '/' . $element->element . '.xml';
$path .= '/modules/' . $element . '/' . $element . '.xml';
break;
case 'template':
$path .= '/templates/' . $element . '/templateDetails.xml';
@@ -154,4 +155,51 @@ public static function getInstallationXML($element, $type, $client_id = 1, $fold
return simplexml_load_file($path);
}
/**
* Get the download key of an extension going through their installation xml
*
* @param CMSObject $extension element of an extension
*
* @return array An array with the prefix, suffix and value of the download key
*
* @since 4.0.0
*/
public static function getDownloadKey(CMSObject $extension): array
{
$installXmlFile = self::getInstallationXML(
$extension->get('element'),
$extension->get('type'),
$extension->get('client_id'),
$extension->get('folder')
);
if (!$installXmlFile)
{
return ['valid' => false];
}
if (!isset($installXmlFile->dlid))
{
return ['valid' => false];
}
$prefix = (string) $installXmlFile->dlid['prefix'];
$suffix = (string) $installXmlFile->dlid['suffix'];
$value = substr($extension->get('extra_query'), strlen($prefix));
if ($suffix)
{
$value = substr($value, 0, -strlen($suffix));
}
$downloadKey = [
'valid' => $value ? true : false,
'prefix' => $prefix,
'suffix' => $suffix,
'value' => $value
];
return $downloadKey;
}
}
@@ -0,0 +1,138 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_installer
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Installer\Administrator\Model;
defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Object\CMSObject;
use Joomla\Component\Installer\Administrator\Helper\InstallerHelper;
/**
* Item Model for an update site.
*
* @since 4.0.0
*/
class UpdatesiteModel extends AdminModel
{
/**
* The type alias for this content type.
*
* @var string
* @since 4.0.0
*/
public $typeAlias = 'com_installer.updatesite';
/**
* Method to get the row form.
*
* @param array $data Data for the form.
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
*
* @return Form|boolean A Form object on success, false on failure
*
* @throws \Exception
*
* @since 4.0.0
*/
public function getForm($data = [], $loadData = true)
{
// Get the form.
$form = $this->loadForm('com_installer.updatesite', 'updatesite', ['control' => 'jform', 'load_data' => $loadData]);
if (empty($form))
{
return false;
}
return $form;
}
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 4.0.0
*/
protected function loadFormData()
{
$data = $this->getItem();
$this->preprocessData('com_installer.updatesite', $data);
return $data;
}
/**
* Method to get a single record.
*
* @param integer $pk The id of the primary key.
*
* @return CMSObject|boolean Object on success, false on failure.
*
* @since 4.0.0
*/
public function getItem($pk = null)
{
$item = parent::getItem($pk);
$db = $this->getDbo();
$query = $db->getQuery(true)
->select(
$db->quoteName(
[
'update_sites.extra_query',
'extensions.type',
'extensions.element',
'extensions.folder',
'extensions.client_id',
'extensions.checked_out'
]
)
)
->from($db->quoteName('#__update_sites', 'update_sites'))
->innerJoin(
$db->quoteName('#__update_sites_extensions', 'update_sites_extensions'),
$db->quoteName('update_sites_extensions.update_site_id') . ' = ' . $db->quoteName('update_sites.update_site_id')
)
->innerJoin(
$db->quoteName('#__extensions', 'extensions'),
$db->quoteName('extensions.extension_id') . ' = ' . $db->quoteName('update_sites_extensions.extension_id')
)
->where($db->quoteName('update_sites.update_site_id') . ' = ' . (int) $item->get('update_site_id'));
$db->setQuery($query);
$extension = $db->loadObject(CMSObject::class);
$downloadKey = InstallerHelper::getDownloadKey($extension);
$item->set('extra_query', $downloadKey['value'] ?? '');
$item->set('downloadIdPrefix', $downloadKey['prefix'] ?? '');
$item->set('downloadIdSuffix', $downloadKey['suffix'] ?? '');
return $item;
}
/**
* Method to save the form data.
*
* @param array $data The form data.
*
* @return boolean True on success, False on error.
*
* @since 4.0.0
*/
public function save($data): bool
{
$data['extra_query'] = $data['downloadIdPrefix'] . $data['extra_query'] . $data['downloadIdSuffix'];
return parent::save($data);
}
}

0 comments on commit a4497af

Please sign in to comment.
You can’t perform that action at this time.