Skip to content

Commit

Permalink
Merge branch '5.2-dev' into save_categoery_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
brianteeman authored Jul 24, 2024
2 parents 1da2327 + b2f2e77 commit b38b05d
Show file tree
Hide file tree
Showing 51 changed files with 238 additions and 143 deletions.
9 changes: 9 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,13 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/cweagans/composer-patches/src/Patches.php',
'/libraries/vendor/cweagans/composer-patches/tests/PatchEventTest.php',
'/libraries/vendor/laminas/laminas-diactoros/PATCHES.txt',
// From 5.2.0-alpha2 to 5.2.0-alpha3
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/FontAwesome.otf',
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.eot',
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.svg',
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.ttf',
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.woff',
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.woff2',
];

$folders = [
Expand Down Expand Up @@ -2597,6 +2604,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/cweagans/composer-patches/src',
'/libraries/vendor/cweagans/composer-patches',
'/libraries/vendor/cweagans',
// From 5.2.0-alpha2 to 5.2.0-alpha3
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts',
];

$status['files_checked'] = $files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public function fetchAssociations()
Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables');
$categoryTable = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');

foreach ($associations as $lang => $association) {
foreach ($associations as $association) {
$categoryTable->load($association->id);
$associations[$lang]->title = $categoryTable->title;
$association->title = $categoryTable->title;
}

$countContentLanguages = \count(LanguageHelper::getContentLanguages([0, 1], false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public function fetchAssociations()
// Add the title to each of the associated records
$contactTable = $this->factory->createTable('Contact', 'Administrator');

foreach ($associations as $lang => $association) {
foreach ($associations as $association) {
$contactTable->load($association->id);
$associations[$lang]->title = $contactTable->name;
$association->title = $contactTable->name;
}

$countContentLanguages = \count(LanguageHelper::getContentLanguages([0, 1], false));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function fetchAssociations()
// Add the title to each of the associated records
$contentTable = Table::getInstance('Content', '\\Joomla\\CMS\\Table\\');

foreach ($associations as $lang => $association) {
foreach ($associations as $association) {
$contentTable->load($association->id);
$associations[$lang]->title = $contentTable->title;
$association->title = $contentTable->title;
}

$countContentLanguages = \count(LanguageHelper::getContentLanguages([0, 1], false));
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_fields/forms/field.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
name="default_value"
type="textarea"
label="COM_FIELDS_FIELD_DEFAULT_VALUE_LABEL"
filter="raw"
filter="safehtml"
/>

<field
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Indexer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public function getIncludedTermIds()

// Sanitize the terms.
foreach ($results as $key => $value) {
$results[$key] = array_unique($results[$key]);
$results[$key] = array_unique($value);
$results[$key] = ArrayHelper::toInteger($results[$key]);
}

Expand Down Expand Up @@ -476,7 +476,7 @@ public function getRequiredTermIds()

// Sanitize the terms.
foreach ($results as $key => $value) {
$results[$key] = array_unique($results[$key]);
$results[$key] = array_unique($value);
$results[$key] = ArrayHelper::toInteger($results[$key]);
}

Expand Down
20 changes: 10 additions & 10 deletions administrator/components/com_finder/src/Service/HTML/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ public function slider($options = [])
// Translate node titles if possible.
$lang = Factory::getLanguage();

foreach ($nodes as $nk => $nv) {
foreach ($nodes as $nv) {
if (trim($nv->parent_title, '*') === 'Language') {
$title = LanguageHelper::branchLanguageTitle($nv->title);
} else {
$key = LanguageHelper::branchPlural($nv->title);
$title = $lang->hasKey($key) ? Text::_($key) : $nv->title;
}

$nodes[$nk]->title = $title;
$nv->title = $title;
}

// Adding slides
Expand Down Expand Up @@ -320,7 +320,7 @@ public function select($idxQuery, $options)
$db->setQuery($query);

try {
$branches[$bk]->nodes = $db->loadObjectList('id');
$bv->nodes = $db->loadObjectList('id');
} catch (\RuntimeException $e) {
return null;
}
Expand All @@ -329,7 +329,7 @@ public function select($idxQuery, $options)
$language = Factory::getLanguage();
$root = [];

foreach ($branches[$bk]->nodes as $node_id => $node) {
foreach ($bv->nodes as $node_id => $node) {
if (trim($node->parent_title, '*') === 'Language') {
$title = LanguageHelper::branchLanguageTitle($node->title);
} else {
Expand All @@ -338,10 +338,10 @@ public function select($idxQuery, $options)
}

if ($node->level > 2) {
$branches[$bk]->nodes[$node_id]->title = str_repeat('-', $node->level - 2) . $title;
$node->title = str_repeat('-', $node->level - 2) . $title;
} else {
$branches[$bk]->nodes[$node_id]->title = $title;
$root[] = $branches[$bk]->nodes[$node_id];
$node->title = $title;
$root[] = $branches[$bk]->nodes[$node_id];
}

if ($node->parent_id && isset($branches[$bk]->nodes[$node->parent_id])) {
Expand All @@ -355,7 +355,7 @@ public function select($idxQuery, $options)
$branches[$bk]->nodes = $this->reduce($root);

// Add the Search All option to the branch.
array_unshift($branches[$bk]->nodes, ['id' => null, 'title' => Text::_('COM_FINDER_FILTER_SELECT_ALL_LABEL')]);
array_unshift($bv->nodes, ['id' => null, 'title' => Text::_('COM_FINDER_FILTER_SELECT_ALL_LABEL')]);
}

// Store the data in cache.
Expand All @@ -372,7 +372,7 @@ public function select($idxQuery, $options)
$html .= '<div class="filter-branch' . $classSuffix . '">';

// Iterate through all branches and build code.
foreach ($branches as $bk => $bv) {
foreach ($branches as $bv) {
// If the multi-lang plugin is enabled then drop the language branch.
if ($bv->title === 'Language' && Multilanguage::isEnabled()) {
continue;
Expand Down Expand Up @@ -400,7 +400,7 @@ public function select($idxQuery, $options)
$html .= '<div class="controls">';
$html .= HTMLHelper::_(
'select.genericlist',
$branches[$bk]->nodes,
$bv->nodes,
't[]',
'class="form-select advancedSelect"',
'id',
Expand Down
12 changes: 12 additions & 0 deletions administrator/components/com_guidedtours/forms/tour.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,16 @@
>
<option value="*">JALL</option>
</field>

<field
name="autostart"
type="radio"
label="COM_GUIDEDTOURS_AUTOSTART_LABEL"
description="COM_GUIDEDTOURS_AUTOSTART_DESC"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
'access',
'language',
'extensions',
'autostart',
'note',
];

Expand Down
11 changes: 6 additions & 5 deletions administrator/components/com_mails/src/Helper/MailsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ public static function mailtags($mail, $fieldname)
* Load the translation files for an extension
*
* @param string $extension Extension name
* @param string $language Language to load
*
* @return void
*
* @since 4.0.0
*/
public static function loadTranslationFiles($extension)
public static function loadTranslationFiles($extension, $language = 'en-GB')
{
static $cache = [];

Expand Down Expand Up @@ -96,12 +97,12 @@ public static function loadTranslationFiles($extension)
break;
}

$lang->load($extension, JPATH_ADMINISTRATOR)
|| $lang->load($extension, $source);
$lang->load($extension, JPATH_ADMINISTRATOR, $language, true)
|| $lang->load($extension, $source, $language, true);

if (!$lang->hasKey(strtoupper($extension))) {
$lang->load($extension . '.sys', JPATH_ADMINISTRATOR)
|| $lang->load($extension . '.sys', $source);
$lang->load($extension . '.sys', JPATH_ADMINISTRATOR, $language, true)
|| $lang->load($extension . '.sys', $source, $language, true);
}

$cache[$extension] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Joomla\CMS\Object\CMSObject;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
use Joomla\Component\Mails\Administrator\Helper\MailsHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -85,14 +86,11 @@ public function display($tpl = null)
throw new GenericDataException(implode("\n", $errors), 500);
}

list($component, $template_id) = explode('.', $this->item->template_id, 2);
list($extension, $template_id) = explode('.', $this->item->template_id, 2);
$fields = ['subject', 'body', 'htmlbody'];
$this->templateData = [];
$language = $this->getLanguage();
$language->load($component, JPATH_SITE, $this->item->language, true);
$language->load($component, JPATH_SITE . '/components/' . $component, $this->item->language, true);
$language->load($component, JPATH_ADMINISTRATOR, $this->item->language, true);
$language->load($component, JPATH_ADMINISTRATOR . '/components/' . $component, $this->item->language, true);

MailsHelper::loadTranslationFiles($extension, $this->item->language);

$this->master->subject = Text::_($this->master->subject);
$this->master->body = Text::_($this->master->body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function display($tpl = null)
}

foreach ($extensions as $extension) {
MailsHelper::loadTranslationFiles($extension);
MailsHelper::loadTranslationFiles($extension, $defaultLanguageTag);
}

$this->addToolbar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export default {
{
bubbles: true,
cancelable: false,
detail: {},
detail: {
type: 'dir',
path: destination.path,
},
},
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ export default {
/* Handle the on preview double click event */
onPreviewDblClick() {
this.navigateTo(this.item.path);
window.parent.document.dispatchEvent(
new CustomEvent('onMediaFileSelected', {
bubbles: true,
cancelable: false,
detail: {
type: this.item.type,
path: this.item.path,
},
}),
);
},
/* Hide actions dropdown */
hideActions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export default {
bubbles: true,
cancelable: false,
detail: {
type: this.item.type,
path: this.item.path,
thumb: this.item.thumb,
fileType: this.item.mime_type ? this.item.mime_type : false,
Expand All @@ -142,7 +143,10 @@ export default {
new CustomEvent('onMediaFileSelected', {
bubbles: true,
cancelable: false,
detail: {},
detail: {
type: this.item.type,
path: this.item.path,
},
}),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,32 +136,31 @@ export default {
* @param event
*/
onClick(event) {
const path = false;
const data = {
path,
path: this.item.path,
type: this.item.type,
thumb: false,
fileType: this.item.mime_type ? this.item.mime_type : false,
extension: this.item.extension ? this.item.extension : false,
};
if (this.item.type === 'file') {
data.path = this.item.path;
data.thumb = this.item.thumb ? this.item.thumb : false;
data.width = this.item.width ? this.item.width : 0;
data.height = this.item.height ? this.item.height : 0;
window.parent.document.dispatchEvent(
new CustomEvent(
'onMediaFileSelected',
{
bubbles: true,
cancelable: false,
detail: data,
},
),
);
}
window.parent.document.dispatchEvent(
new CustomEvent(
'onMediaFileSelected',
{
bubbles: true,
cancelable: false,
detail: data,
},
),
);
// Handle clicks when the item was not selected
if (!this.isSelected()) {
// Unselect all other selected items,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ export default {
/* Handle the on drive click event */
onDriveClick() {
this.navigateTo(this.drive.root);
window.parent.document.dispatchEvent(
new CustomEvent('onMediaFileSelected', {
bubbles: true,
cancelable: false,
detail: {
type: 'dir',
path: this.drive.root,
},
}),
);
},
moveFocusToChildElement(nextRoot) {
this.$refs[nextRoot].setFocusToFirstChild();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ export default {
{
bubbles: true,
cancelable: false,
detail: {},
detail: {
type: item.type,
path: item.path,
},
},
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ public function fetchAssociations()
Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/tables');
$menuTable = Table::getInstance('Menu', '\\Joomla\\CMS\\Table\\', []);

foreach ($associations as $lang => $association) {
foreach ($associations as $association) {
$menuTable->load($association->id);
$associations[$lang]->title = $menuTable->title;
$association->title = $menuTable->title;
}

$countContentLanguages = \count(LanguageHelper::getContentLanguages([0, 1], false));
Expand Down
Loading

0 comments on commit b38b05d

Please sign in to comment.