Stable release of v3.2.0-beta4

Add Preferred Joomla Version to Components.
This commit is contained in:
2024-03-07 21:23:32 +02:00
parent 0b0568299c
commit 5675f186cd
64 changed files with 4242 additions and 433 deletions

View File

@ -299,7 +299,8 @@ class ComponentbuilderViewCompiler extends HtmlView
// start the joomla versions options
$options = [
'3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE',
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR_AND_FIVE'
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR',
'5' => 'COM_COMPONENTBUILDER_JOOMLA_FIVE'
];
// add to form
@ -327,8 +328,8 @@ class ComponentbuilderViewCompiler extends HtmlView
// Joomla Version 4 and five attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_four_five',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR_AND_JOOMLA_FIVE',
'name' => 'joomla_version_note_four',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR',
'class' => 'alert alert-success',
'showon' => 'joomla_version:4'];
@ -339,6 +340,21 @@ class ComponentbuilderViewCompiler extends HtmlView
$form->setField($xml, null, true, 'builder');
}
// Joomla Version 5 and five attributes
$attributes = [
'type' => 'note',
'name' => 'joomla_version_note_five',
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FIVE',
'class' => 'alert alert-success',
'showon' => 'joomla_version:5'];
// add to form
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'builder');
}
// Advanced Options
$attributes = [
'type' => 'radio',
@ -554,8 +570,7 @@ class ComponentbuilderViewCompiler extends HtmlView
protected function getSupportMessage(): string
{
return LayoutHelper::render('jcbsupportmessage', []);
}
}
/**
* Prepares the document
@ -661,6 +676,11 @@ class ComponentbuilderViewCompiler extends HtmlView
getComponentDetails_server(id).then(function(result) {
if (result.html) {
document.getElementById('component-details').innerHTML = result.html;
if (result.preferred_joomla_version) {
jQuery('#joomla_version').val(result.preferred_joomla_version);
jQuery('#joomla_version').trigger('liszt:updated');
jQuery('#joomla_version').trigger('change');
}
}
});
}