Skip to content

Commit

Permalink
Merge branch '4.0-dev' into 4.0-dev_fatal_error_pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko authored Jan 2, 2021
2 parents 739738a + 72bd3b3 commit cbb47ca
Show file tree
Hide file tree
Showing 69 changed files with 1,436 additions and 1,980 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ public static function loadActionLogPluginsLanguage()
|| $lang->load($extension, JPATH_PLUGINS . '/' . $type . '/' . $name);
}

// Load plg_system_actionlogs too
$lang->load('plg_system_actionlogs', JPATH_ADMINISTRATOR);

// Load com_privacy too.
$lang->load('com_privacy', JPATH_ADMINISTRATOR);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE `#__modules` SET `title` = 'Notifications' WHERE `#__modules`.`id` = 9;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UPDATE "#__modules" SET "title" = 'Notifications' WHERE "#__modules"."id" = 9;
13 changes: 4 additions & 9 deletions administrator/components/com_admin/tmpl/profile/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
// Get the form fieldsets.
$fieldsets = $this->form->getFieldsets();

// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
$this->useCoreUI = true;
?>
<form
action="<?php echo Route::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->item->id); ?>"
Expand All @@ -35,14 +37,7 @@
class="form-validate"
>
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'user_details']); ?>
<?php foreach ($fieldsets as $fieldset) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', $fieldset->name, Text::_($fieldset->label)); ?>
<?php foreach ($this->form->getFieldset($fieldset->name) as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endforeach; ?>

<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php if (!empty($this->twofactorform) && $this->item->id) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'twofactorauth', Text::_('COM_ADMIN_PROFILE_TWO_FACTOR_AUTH')); ?>
<div class="control-group">
Expand Down Expand Up @@ -88,7 +83,7 @@ class="form-validate"

<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>

<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<input type="hidden" name="task" value="">
<input type="hidden" name="return" value="<?php echo $input->get('return', '', 'BASE64'); ?>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,6 @@ public function stick($pks = null, $state = 1, $userId = 0)
*/
public function getTypeAlias()
{
return 'com_banners.banner';
return $this->typeAlias;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ClientTable extends Table implements VersionableTableInterface
*/
public function __construct(DatabaseDriver $db)
{
$this->typeAlias = 'com_banners.client';
$this->typeAlias = 'com_banners.client';

$this->setColumnAlias('published', 'state');

Expand All @@ -56,7 +56,7 @@ public function __construct(DatabaseDriver $db)
*/
public function getTypeAlias()
{
return 'com_banners.client';
return $this->typeAlias;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Tag\TaggableTableInterface;
use Joomla\CMS\Tag\TaggableTableTrait;
use Joomla\CMS\Versioning\VersionableTableInterface;
use Joomla\Database\DatabaseDriver;
use Joomla\String\StringHelper;
Expand All @@ -25,8 +27,10 @@
*
* @since 1.0
*/
class ContactTable extends Table implements VersionableTableInterface
class ContactTable extends Table implements VersionableTableInterface, TaggableTableInterface
{
use TaggableTableTrait;

/**
* Indicates that columns fully support the NULL value in the database
*
Expand Down Expand Up @@ -271,6 +275,6 @@ public function generateAlias()
*/
public function getTypeAlias()
{
return 'com_contact.contact';
return $this->typeAlias;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Table\TableInterface;
use Joomla\CMS\Tag\TaggableTableInterface;
use Joomla\CMS\UCM\UCMType;
use Joomla\CMS\Versioning\VersionableModelTrait;
use Joomla\CMS\Workflow\Workflow;
Expand Down Expand Up @@ -261,6 +262,12 @@ protected function batchMove($value, $pks, $contexts)
// Set the new category ID
$this->table->catid = $categoryId;

// We don't want to modify tags - so remove the associated tags helper
if ($this->table instanceof TaggableTableInterface)
{
$this->table->clearTagsHelper();
}

// Check the row.
if (!$this->table->check())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_fields.admin-fields-batch');
$wa->useScript('joomla.batch-copymove');

$context = $this->escape($this->state->get('filter.context'));
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ public function display($cachable = false, $urlparams = false)
// Get and render the view.
if ($view = $this->getView($vName, $vFormat))
{
$ftp = ClientHelper::setCredentialsFromRequest('ftp');
$view->ftp = &$ftp;
ClientHelper::setCredentialsFromRequest('ftp');

// Get the model for the view.
/** @var \Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel $model */
$model = $this->getModel('Update');

/** @var ?\Joomla\Component\Installer\Administrator\Model\WarningsModel $warningsModel */
$warningsModel = $this->app->bootComponent('com_installer')
->getMVCFactory()->createModel('Warnings', 'Administrator', ['ignore_request' => true]);

if (is_object($warningsModel))
if ($warningsModel !== null)
{
$view->setModel($warningsModel, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
*/
class HtmlView extends BaseHtmlView
{
/**
* Holds an array with the configured FTP options.
*
* @var array
*
* @since __DEPLOY_VERSION__
*/
protected $ftp = null;

/**
* An array with the Joomla! update information.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

\defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Router\Route;

/**
* Mail templates Controller
Expand All @@ -27,4 +29,33 @@ class DisplayController extends BaseController
* @since 1.6
*/
protected $default_view = 'templates';

/**
* Method to display a view.
*
* @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 BaseController|boolean This object to support chaining.
*
* @since 1.5
*/
public function display($cachable = false, $urlparams = array())
{
$view = $this->input->get('view', 'templates');
$layout = $this->input->get('layout', '');
$id = $this->input->getString('template_id');

// Check for edit form.
if ($view == 'template' && $layout == 'edit' && !$this->checkEditId('com_mails.edit.template', $id))
{
// Somehow the person just went to the form - we don't allow that.
$this->setMessage(Text::sprintf('COM_MAILS_ERROR_UNHELD_ID', $id), 'error');
$this->setRedirect(Route::_('index.php?option=com_mails&view=templates', false));

return false;
}

return parent::display();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ public function getForm($data = array(), $loadData = true)
*/
public function getItem($pk = null)
{
$template_id = $this->getState($this->getName() . '.template_id');
$templateId = $this->getState($this->getName() . '.template_id');
$language = $this->getState($this->getName() . '.language');
$table = $this->getTable('Template', 'Table');

if ($template_id != '' && $language != '')
if ($templateId != '' && $language != '')
{
// Attempt to load the row.
$return = $table->load(array('template_id' => $template_id, 'language' => $language));
$return = $table->load(array('template_id' => $templateId, 'language' => $language));

// Check for a table object error.
if ($return === false && $table->getError())
Expand All @@ -174,7 +174,7 @@ public function getItem($pk = null)

if (!$item->template_id)
{
$item->template_id = $template_id;
$item->template_id = $templateId;
}

if (!$item->language)
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_mails/tmpl/templates/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
<th scope="col" class="w-15 d-none d-md-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_MAILS_HEADING_COMPONENT', 'a.component', $listDirn, $listOrder); ?>
</th>
<th scope="col" class="w-10 d-md-table-cell">
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo Text::_('COM_MAILS_HEADING_TEMPLATES_FOR_LANGUAGES'); ?>
</th>
<th scope="col" class="w-10 d-md-table-cell">
<th scope="col" class="w-10 d-none d-md-table-cell">
<?php echo Text::_('COM_MAILS_HEADING_NO_TEMPLATES_FOR_LANGUAGES'); ?>
</th>
<th scope="col" class="w-30 d-none d-md-table-cell">
Expand Down Expand Up @@ -83,7 +83,7 @@
<td class="d-none d-md-table-cell">
<?php echo Text::_($component); ?>
</td>
<td class="d-md-table-cell">
<td class="d-none d-md-table-cell">
<?php foreach ($this->languages as $language) : ?>
<?php if (in_array($language->lang_code, $item->languages)) : ?>
<?php if ($language->image) : ?>
Expand All @@ -94,7 +94,7 @@
<?php endif; ?>
<?php endforeach; ?>
</td>
<td class="d-md-table-cell">
<td class="d-none d-md-table-cell">
<?php foreach ($this->languages as $language) : ?>
<?php if (!in_array($language->lang_code, $item->languages)) : ?>
<?php if ($language->image) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('com_menus.batch-body');
$wa->useScript('joomla.batch-copymove');
}
?>
<div class="container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function getItem($pk = null)
// Invalid message_id returns 0
if ($this->item->user_id_to === '0')
{
$this->setError(JText::_('JERROR_ALERTNOAUTHOR'));
$this->setError(Text::_('JERROR_ALERTNOAUTHOR'));

return false;
}
Expand Down Expand Up @@ -201,7 +201,7 @@ public function getItem($pk = null)
}
}

// Get the user name for an existing messasge.
// Get the user name for an existing message.
if ($this->item->user_id_from && $fromUser = new User($this->item->user_id_from))
{
$this->item->set('from_user_name', $fromUser->name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public function display($tpl = null)
{
throw new GenericDataException(implode("\n", $errors), 500);
}
elseif ($this->getLayout() !== 'edit' && empty($this->item->message_id))
{
throw new GenericDataException(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}

parent::display($tpl);
$this->addToolbar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

$this->document->getWebAssetManager()
->usePreset('choicesjs')
->useScript('webcomponent.field-fancy-select');
->useScript('webcomponent.field-fancy-select')
->useScript('joomla.batch-copymove');

?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Joomla\CMS\Language\Text;
use Joomla\CMS\String\PunycodeHelper;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Tag\TaggableTableInterface;
use Joomla\CMS\Tag\TaggableTableTrait;
use Joomla\CMS\Versioning\VersionableTableInterface;
use Joomla\Database\DatabaseDriver;
use Joomla\String\StringHelper;
Expand All @@ -25,8 +27,10 @@
*
* @since 1.6
*/
class NewsfeedTable extends Table implements VersionableTableInterface
class NewsfeedTable extends Table implements VersionableTableInterface, TaggableTableInterface
{
use TaggableTableTrait;

/**
* Indicates that columns fully support the NULL value in the database
*
Expand Down Expand Up @@ -206,6 +210,6 @@ public function store($updateNulls = true)
*/
public function getTypeAlias()
{
return 'com_newsfeeds.newsfeed';
return $this->typeAlias;
}
}
2 changes: 1 addition & 1 deletion administrator/components/com_tags/src/Table/TagTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,6 @@ public function delete($pk = null, $children = false)
*/
public function getTypeAlias()
{
return 'com_tags.tag';
return $this->typeAlias;
}
}
2 changes: 1 addition & 1 deletion administrator/components/com_users/src/Table/NoteTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ public function check()
*/
public function getTypeAlias()
{
return 'com_users.note';
return $this->typeAlias;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
HTMLHelper::_('select.option', 'no', Text::_('JNO'))
);

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('joomla.batch-copymove');

?>

<div class="container">
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_mails.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COM_MAILS_CONFIG_FIELD_ATTACHMENT_FOLDER_LABEL="Attachments Folder"
COM_MAILS_CONFIG_FIELD_COPY_MAILS_LABEL="Send Copy"
COM_MAILS_CONFIG_MAIL_OPTIONS="Mails"
COM_MAILS_CONFIGURATION="Mail Templates: Options"
COM_MAILS_ERROR_UNHELD_ID="You are not permitted to use that link to directly access that page (Template: %s)."
COM_MAILS_FIELD_ALTERNATIVE_MAILCONFIG_LABEL="Mail Settings"
COM_MAILS_FIELD_ATTACHMENTS_LABEL="Attachments"
COM_MAILS_FIELD_BODY_LABEL="Body"
Expand Down
Loading

0 comments on commit cbb47ca

Please sign in to comment.