Resolved gh-436 so that the new Joomla plugin builder/feature is fully active, and part of the import and export of JCB packages.

This commit is contained in:
2019-08-12 23:30:31 +02:00
parent ed43b00862
commit 7fed9d7a1c
16 changed files with 519 additions and 127 deletions

View File

@ -22,13 +22,25 @@ JHtml::_('behavior.formvalidation');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
?>
<?php if ($this->canDo->get('compiler.access')): ?>
<?php if ($this->canDo->get('compiler.access')): ?>
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task === 'compiler.back') {
parent.history.back();
return false;
} else {
var form = document.getElementById('adminForm');
form.task.value = task;
form.submit();
}
}
</script>
<form action="<?php echo JRoute::_('index.php?option=com_componentbuilder&view=compiler'); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
<script type="text/javascript">
Joomla.submitbutton = function(task)
Joomla.submitbutton = function(task, key)
{
if (task == ''){
return false;
@ -42,11 +54,16 @@ Joomla.submitbutton = function(task)
if (isValid){
jQuery('#form').hide();
// get correct form based on task
if (task == 'compiler.compiler') {
if (task == 'compiler.compiler' || task == 'compiler.installCompiledPlugin') {
var form = document.getElementById('compilerForm');
} else {
var form = document.getElementById('adminForm');
}
// set the plugin id
if (task == 'compiler.installCompiledPlugin') {
form.install_item_id.value = key;
}
// set the task value
form.task.value = task;
form.submit();
// some ui movements
@ -112,6 +129,7 @@ jQuery('<div id="loading"></div>')
<button class="btn btn-small btn-success" onclick="Joomla.submitbutton('compiler.compiler')"><span class="icon-cog icon-white"></span>
<?php echo JText::_('COM_COMPONENTBUILDER_COMPILE_COMPONENT'); ?>
</button>
<input type="hidden" name="install_item_id" value="0">
<input type="hidden" name="version" value="3" />
<input type="hidden" name="task" value="compiler.compiler" />
<?php echo JHtml::_('form.token'); ?>

View File

@ -231,7 +231,7 @@ class ComponentbuilderViewImport_joomla_components extends JViewLegacy
'name' => 'canmerge',
'label' => 'COM_COMPONENTBUILDER_MERGE',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS',
'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_CLASS_PROPERTY_CLASS_METHOD_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS',
'default' => '1');
// load the merge attributes
ComponentbuilderHelper::xmlAddAttributes($mergeXML, $mergeAttributes);