Skip to content
This repository was archived by the owner on Sep 17, 2018. It is now read-only.

Commit c76acf8

Browse files
committed
Merge branch '4.0-dev' of github.com:joomla/joomla-cms
2 parents af558b5 + c52c23e commit c76acf8

File tree

190 files changed

+2155
-1514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+2155
-1514
lines changed

administrator/components/com_admin/forms/profile.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
type="templatestyle"
9898
label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL"
9999
client="administrator"
100+
filter="uint"
100101
>
101102
<option value="">JOPTION_USE_DEFAULT</option>
102103
</field>

administrator/components/com_admin/sql/updates/mysql/4.0.0-2017-10-10.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
2-
(487, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);
1+
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
2+
(487, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 0, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0);
33

44
INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
55
VALUES

administrator/components/com_admin/sql/updates/mysql/4.0.0-2018-06-03.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ CREATE TABLE IF NOT EXISTS `#__csp` (
1313
PRIMARY KEY (`id`)
1414
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
1515

16-
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`, `namespace`) VALUES
17-
(35, 'com_csp', 'component', 'com_csp', '', 0, 0, 1, 0, '', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Csp');
16+
INSERT INTO `#__extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`, `namespace`) VALUES
17+
(35, 'com_csp', 'component', 'com_csp', '', 0, 0, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0, 'Joomla\\Component\\Csp');
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
INSERT INTO `#__extensions`
2-
(`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`)
2+
(`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`)
33
VALUES
4-
(488, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0);
4+
(488, 0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 0, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0);

administrator/components/com_admin/sql/updates/postgresql/4.0.0-2018-06-03.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ CREATE TABLE IF NOT EXISTS "#__csp" (
1313
PRIMARY KEY ("id")
1414
);
1515

16-
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "custom_data", "system_data", "checked_out", "checked_out_time", "ordering", "state", "namespace") VALUES
17-
(35, 'com_csp', 'component', 'com_csp', ' ', 0, 0, 1, 0, '', '{}', '', '', 0, '1970-01-01 00:00:00', 0, 0, 'Joomla\\Component\\Csp');
16+
INSERT INTO "#__extensions" ("extension_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state", "namespace") VALUES
17+
(35, 'com_csp', 'component', 'com_csp', ' ', 0, 0, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0, 'Joomla\\Component\\Csp');

administrator/components/com_associations/Field/ItemlanguageField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function getOptions()
8383
$itemId = (int) $associations[$language->lang_code]['id'];
8484
$options[$langCode]->value = $language->lang_code . ':' . $itemId . ':edit';
8585

86-
// Check if user does have permission to edit the associated item.
86+
// Check if user does have permission to edit the associated item.
8787
$canEdit = AssociationsHelper::allowEdit($extensionName, $typeName, $itemId);
8888

8989
// Check if item can be checked out

administrator/components/com_associations/Field/Modal/AssociationField.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ protected function getInput()
6969

7070
// Clear association button
7171
$html[] = '<button'
72-
. ' class="btn btn-secondary' . ($value ? '' : ' hidden') . '"'
73-
. ' onclick="return Joomla.submitbutton(\'undo-association\');"'
74-
. ' id="remove-assoc">'
75-
. '<span class="icon-remove" aria-hidden="true"></span> ' . \JText::_('JCLEAR')
76-
. '</button>';
72+
. ' class="btn btn-secondary' . ($value ? '' : ' hidden') . '"'
73+
. ' onclick="return Joomla.submitbutton(\'undo-association\');"'
74+
. ' id="remove-assoc">'
75+
. '<span class="icon-remove" aria-hidden="true"></span> ' . \JText::_('JCLEAR')
76+
. '</button>';
7777

7878
$html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . $value . '">';
7979

administrator/components/com_associations/tmpl/associations/modal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
JFactory::getDocument()->addScriptOptions('assosiations-modal', ['func' => $function]);
3939
JHtml::_('script', 'com_associations/admin-associations-modal.min.js', false, true);
4040
?>
41-
<form action="<?php echo JRoute::_('index.php?option=com_associations&view=associations&layout=modal&tmpl=component&function=' . $function . '&' . JSession::getFormToken() . '=1');
42-
?>" method="post" name="adminForm" id="adminForm">
41+
<form action="<?php echo JRoute::_('index.php?option=com_associations&view=associations&layout=modal&tmpl=component&function='
42+
. $function . '&' . JSession::getFormToken() . '=1'); ?>" method="post" name="adminForm" id="adminForm">
4343

4444
<?php if (!empty( $this->sidebar)) : ?>
4545
<div id="j-sidebar-container" class="col-md-2">

administrator/components/com_categories/tmpl/categories/default.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,33 +81,33 @@
8181
<?php if (isset($this->items[0]) && property_exists($this->items[0], 'count_published')) :
8282
$columns++; ?>
8383
<th style="width:3%" class="nowrap text-center d-none d-md-table-cell">
84-
<span class="icon-publish hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_PUBLISHED_ITEMS'); ?>">
85-
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_PUBLISHED_ITEMS'); ?></span>
86-
</span>
84+
<span class="icon-publish hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_PUBLISHED_ITEMS'); ?>">
85+
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_PUBLISHED_ITEMS'); ?></span>
86+
</span>
8787
</th>
8888
<?php endif; ?>
8989
<?php if (isset($this->items[0]) && property_exists($this->items[0], 'count_unpublished')) :
9090
$columns++; ?>
9191
<th style="width:3%" class="nowrap text-center d-none d-md-table-cell">
92-
<span class="icon-unpublish hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_UNPUBLISHED_ITEMS'); ?>">
93-
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_UNPUBLISHED_ITEMS'); ?></span>
94-
</span>
92+
<span class="icon-unpublish hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_UNPUBLISHED_ITEMS'); ?>">
93+
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_UNPUBLISHED_ITEMS'); ?></span>
94+
</span>
9595
</th>
9696
<?php endif; ?>
9797
<?php if (isset($this->items[0]) && property_exists($this->items[0], 'count_archived')) :
9898
$columns++; ?>
9999
<th style="width:3%" class="nowrap text-center d-none d-md-table-cell">
100-
<span class="icon-archive hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_ARCHIVED_ITEMS'); ?>">
101-
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_ARCHIVED_ITEMS'); ?></span>
102-
</span>
100+
<span class="icon-archive hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_ARCHIVED_ITEMS'); ?>">
101+
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_ARCHIVED_ITEMS'); ?></span>
102+
</span>
103103
</th>
104104
<?php endif; ?>
105105
<?php if (isset($this->items[0]) && property_exists($this->items[0], 'count_trashed')) :
106106
$columns++; ?>
107107
<th style="width:3%" class="nowrap text-center d-none d-md-table-cell">
108-
<span class="icon-trash hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_TRASHED_ITEMS'); ?>">
109-
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_TRASHED_ITEMS'); ?></span>
110-
</span>
108+
<span class="icon-trash hasTooltip" aria-hidden="true" title="<?php echo JText::_('COM_CATEGORY_COUNT_TRASHED_ITEMS'); ?>">
109+
<span class="sr-only"><?php echo JText::_('COM_CATEGORY_COUNT_TRASHED_ITEMS'); ?></span>
110+
</span>
111111
</th>
112112
<?php endif; ?>
113113
<th style="width:10%" class="nowrap d-none d-md-table-cell text-center">
@@ -271,14 +271,14 @@
271271
&& $user->authorise('core.edit', $extension)
272272
&& $user->authorise('core.edit.state', $extension)) : ?>
273273
<?php echo JHtml::_(
274-
'bootstrap.renderModal',
275-
'collapseModal',
276-
array(
277-
'title' => JText::_('COM_CATEGORIES_BATCH_OPTIONS'),
278-
'footer' => $this->loadTemplate('batch_footer'),
279-
),
280-
$this->loadTemplate('batch_body')
281-
); ?>
274+
'bootstrap.renderModal',
275+
'collapseModal',
276+
array(
277+
'title' => JText::_('COM_CATEGORIES_BATCH_OPTIONS'),
278+
'footer' => $this->loadTemplate('batch_footer'),
279+
),
280+
$this->loadTemplate('batch_body')
281+
); ?>
282282
<?php endif; ?>
283283
<?php endif; ?>
284284

administrator/components/com_content/Model/ArticleModel.php

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ protected function batchCopy($value, $pks, $contexts)
6868
return false;
6969
}
7070

71+
JPluginHelper::importPlugin('system');
72+
$dispatcher = JEventDispatcher::getInstance();
73+
74+
// Register FieldsHelper
75+
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
76+
7177
// Parent exists so we let's proceed
7278
while (!empty($pks))
7379
{
@@ -94,6 +100,19 @@ protected function batchCopy($value, $pks, $contexts)
94100
}
95101
}
96102

103+
$fields = FieldsHelper::getFields('com_content.article', $this->table, true);
104+
$fieldsData = array();
105+
106+
if (!empty($fields))
107+
{
108+
$fieldsData['com_fields'] = array();
109+
110+
foreach ($fields as $field)
111+
{
112+
$fieldsData['com_fields'][$field->name] = $field->rawvalue;
113+
}
114+
}
115+
97116
// Alter the title & alias
98117
$data = $this->generateNewTitle($categoryId, $this->table->alias, $this->table->title);
99118
$this->table->title = $data['0'];
@@ -149,6 +168,9 @@ protected function batchCopy($value, $pks, $contexts)
149168
$db->setQuery($query);
150169
$db->execute();
151170
}
171+
172+
// Run event for copied article
173+
$dispatcher->trigger('onContentAfterSave', array('com_content.article', &$this->table, true, $fieldsData));
152174
}
153175

154176
// Clean the cache
@@ -157,6 +179,117 @@ protected function batchCopy($value, $pks, $contexts)
157179
return $newIds;
158180
}
159181

182+
/**
183+
* Batch move categories to a new category.
184+
*
185+
* @param integer $value The new category ID.
186+
* @param array $pks An array of row IDs.
187+
* @param array $contexts An array of item contexts.
188+
*
189+
* @return boolean True on success.
190+
*
191+
* @since __DEPLOY_VERSION__
192+
*/
193+
protected function batchMove($value, $pks, $contexts)
194+
{
195+
if (empty($this->batchSet))
196+
{
197+
// Set some needed variables.
198+
$this->user = JFactory::getUser();
199+
$this->table = $this->getTable();
200+
$this->tableClassName = get_class($this->table);
201+
$this->contentType = new JUcmType;
202+
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
203+
}
204+
205+
$categoryId = (int) $value;
206+
207+
if (!$this->checkCategoryId($categoryId))
208+
{
209+
return false;
210+
}
211+
212+
JPluginHelper::importPlugin('system');
213+
$dispatcher = JEventDispatcher::getInstance();
214+
215+
// Register FieldsHelper
216+
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
217+
218+
// Parent exists so we proceed
219+
foreach ($pks as $pk)
220+
{
221+
if (!$this->user->authorise('core.edit', $contexts[$pk]))
222+
{
223+
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
224+
225+
return false;
226+
}
227+
228+
// Check that the row actually exists
229+
if (!$this->table->load($pk))
230+
{
231+
if ($error = $this->table->getError())
232+
{
233+
// Fatal error
234+
$this->setError($error);
235+
236+
return false;
237+
}
238+
else
239+
{
240+
// Not fatal error
241+
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
242+
continue;
243+
}
244+
}
245+
246+
$fields = FieldsHelper::getFields('com_content.article', $this->table, true);
247+
$fieldsData = array();
248+
249+
if (!empty($fields))
250+
{
251+
$fieldsData['com_fields'] = array();
252+
253+
foreach ($fields as $field)
254+
{
255+
$fieldsData['com_fields'][$field->name] = $field->rawvalue;
256+
}
257+
}
258+
259+
// Set the new category ID
260+
$this->table->catid = $categoryId;
261+
262+
// Check the row.
263+
if (!$this->table->check())
264+
{
265+
$this->setError($this->table->getError());
266+
267+
return false;
268+
}
269+
270+
if (!empty($this->type))
271+
{
272+
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
273+
}
274+
275+
// Store the row.
276+
if (!$this->table->store())
277+
{
278+
$this->setError($this->table->getError());
279+
280+
return false;
281+
}
282+
283+
// Run event for moved article
284+
$dispatcher->trigger('onContentAfterSave', array('com_content.article', &$this->table, false, $fieldsData));
285+
}
286+
287+
// Clean the cache
288+
$this->cleanCache();
289+
290+
return true;
291+
}
292+
160293
/**
161294
* Method to test whether a record can be deleted.
162295
*

0 commit comments

Comments
 (0)