Fix the update server #978 issue. Fixed the change log to load all entries, not just the last one. Fixed #983 so that database updates are created when adding a new adminview. Moved a few builder arrays to the Compiler Registry. Adds super powers to JCB. Adds Gitea API library. Improves Power filters. Fix #991 to add the Utilities service class. Adds Superpower Key (SPK) replacement feature. Adds Superpower search (GREP) feature. Adds Power Insert/Update Classe. Fix #995 that all update sites are using the correct URL.

This commit is contained in:
2023-05-02 02:10:55 +02:00
parent d6c73987f5
commit df16b2e3ad
246 changed files with 24890 additions and 4141 deletions

View File

@ -11,6 +11,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use VDM\Joomla\Utilities\StringHelper;
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.formvalidator');
@ -125,7 +126,7 @@ jQuery('<div id="compiling"></div>')
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<?php if (ComponentbuilderHelper::checkString($this->SuccessMessage)): ?>
<?php if (StringHelper::check($this->SuccessMessage)): ?>
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<?php echo $this->SuccessMessage; ?>

View File

@ -356,6 +356,45 @@ class ComponentbuilderViewCompiler extends HtmlView
$form->setField($xml, null, true, 'advanced');
}
// powers repository attributes
$attributes = [
'type' => 'radio',
'name' => 'powers_repository',
'label' => 'COM_COMPONENTBUILDER_ACTIVATE_SUPER_POWERS',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_THIS_ADDS_POWERS_TO_A_LOCAL_REPOSITORY_FOLDER_ALL_BAPPROVEDB_POWERS_LINKED_TO_THIS_COMPONENT_WILL_BE_MOVED_TO_YOUR_BLOCALB_POWERS_REPOSITORY_FOLDER_INTO_THEIR_SELECTIVE_TARGET_PATHS_THIS_LOCAL_FOLDER_PATH_MUST_BE_SET_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_BSUPER_POWERB_TAB',
'default' => '2',
'showon' => 'show_advanced_options:1'];
// start the repository options
$options = [
'2' => 'COM_COMPONENTBUILDER_GLOBAL',
'1' => 'COM_COMPONENTBUILDER_YES',
'0' => 'COM_COMPONENTBUILDER_NO'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// powers local path to repositories attributes
$attributes = [
'type' => 'text',
'name' => 'local_powers_repository_path',
'label' => 'COM_COMPONENTBUILDER_LOCAL_POWERS_REPOSITORY_PATH',
'class' => 'btn-group btn-group-yesno',
'description' => 'COM_COMPONENTBUILDER_HERE_YOU_CAN_SET_THE_PATH_TO_THE_SUPER_POWERS_LOCAL_REPOSITORY_FOLDER_WHERE_BLAYERCOREB_AND_ALL_TARGETED_BLAYEROWNB_SUB_PATHS_WILL_BE_PLACED_WITH_THEIR_SELECTIVE_BSWITCHAPPROVEDB_POWERS',
'default' => $this->params->get('local_powers_repository_path', ''),
'showon' => 'show_advanced_options:1[AND]powers_repository:1'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'advanced');
}
// Indentation attributes
$attributes = [
'type' => 'radio',

View File

@ -64,6 +64,17 @@ $componentParams = $this->params; // will be removed just use $this->params inst
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'powerTab', 'super_power', JText::_('COM_COMPONENTBUILDER_POWER_SUPER_POWER', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span6">
<?php echo JLayoutHelper::render('power.super_power_left', $this); ?>
</div>
<div class="span6">
<?php echo JLayoutHelper::render('power.super_power_right', $this); ?>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.addTab', 'powerTab', 'composer', JText::_('COM_COMPONENTBUILDER_POWER_COMPOSER', true)); ?>
<div class="row-fluid form-horizontal-desktop">
</div>

View File

@ -146,6 +146,16 @@ class ComponentbuilderViewPower extends HtmlView
{
JToolBarHelper::custom('power.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if ($this->canDo->get('power.sync'))
{
// add Sync button.
JToolBarHelper::custom('power.syncPowers', 'loop custom-button-syncpowers', '', 'COM_COMPONENTBUILDER_SYNC', false);
}
if ($this->canDo->get('power.reset'))
{
// add Reset button.
JToolBarHelper::custom('power.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
}
JToolBarHelper::cancel('power.cancel', 'JTOOLBAR_CLOSE');
}
}

View File

@ -67,7 +67,7 @@ $edit = "index.php?option=com_componentbuilder&view=powers&task=power.edit";
<?php else: ?>
<?php echo $this->escape($item->system_name); ?>
<?php endif; ?><br /><small>GUID:
<?php echo $this->escape($item->guid); ?></small>
<?php echo $this->escape($item->guid); ?><?php if(isset($item->super_power_key)): ?><br />SPK: <?php echo $item->super_power_key; ?><?php endif; ?></small>
</div>
</td>
<td class="hidden-phone">
@ -81,7 +81,8 @@ $edit = "index.php?option=com_componentbuilder&view=powers&task=power.edit";
<?php else: ?>
<?php echo $this->escape($item->extends_name); ?>
<?php endif; ?><?php elseif ($item->extends === '-1') : ?><br /><?php echo JText::_('COM_COMPONENTBUILDER_EXTENDS'); ?>:
<?php echo $this->escape($item->extends_custom); ?><?php endif; ?>
<?php echo $this->escape($item->extends_custom); ?><?php endif; ?><br /><?php echo JText::_('COM_COMPONENTBUILDER_SUPER_POWER'); ?>:
<?php echo JText::_($item->approved); ?>
</div>
</td>
<td class="hidden-phone">

View File

@ -141,6 +141,21 @@ class ComponentbuilderViewPowers extends HtmlView
// add Run Expansion button.
JToolBarHelper::custom('powers.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false);
}
if ($this->user->authorise('power.init', 'com_componentbuilder'))
{
// add Init button.
JToolBarHelper::custom('powers.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
}
if ($this->user->authorise('power.sync', 'com_componentbuilder'))
{
// add Sync button.
JToolBarHelper::custom('powers.syncPowers', 'loop custom-button-syncpowers', '', 'COM_COMPONENTBUILDER_SYNC', false);
}
if ($this->user->authorise('power.reset', 'com_componentbuilder'))
{
// add Reset button.
JToolBarHelper::custom('powers.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
}
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('powers');
@ -195,43 +210,23 @@ class ComponentbuilderViewPowers extends HtmlView
);
}
// Only load Power Version batch if create, edit, and batch is allowed
// Only load Approved batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Power Version Selection
$this->power_versionOptions = JFormHelper::loadFieldType('powersfilterpowerversion')->options;
// We do some sanitation for Power Version filter
if (ComponentbuilderHelper::checkArray($this->power_versionOptions) &&
isset($this->power_versionOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->power_versionOptions[0]->value))
// Set Approved Selection
$this->approvedOptions = JFormHelper::loadFieldType('powersfilterapproved')->options;
// We do some sanitation for Approved filter
if (ComponentbuilderHelper::checkArray($this->approvedOptions) &&
isset($this->approvedOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->approvedOptions[0]->value))
{
unset($this->power_versionOptions[0]);
unset($this->approvedOptions[0]);
}
// Power Version Batch Selection
// Approved Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_POWER_POWER_VERSION_LABEL').' -',
'batch[power_version]',
JHtml::_('select.options', $this->power_versionOptions, 'value', 'text')
);
}
// Only load Extends Name batch if create, edit, and batch is allowed
if ($this->canBatch && $this->canCreate && $this->canEdit)
{
// Set Extends Name Selection
$this->extendsNameOptions = JFormHelper::loadFieldType('Classpowers')->options;
// We do some sanitation for Extends Name filter
if (ComponentbuilderHelper::checkArray($this->extendsNameOptions) &&
isset($this->extendsNameOptions[0]->value) &&
!ComponentbuilderHelper::checkString($this->extendsNameOptions[0]->value))
{
unset($this->extendsNameOptions[0]);
}
// Extends Name Batch Selection
JHtmlBatch_::addListSelection(
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_POWER_EXTENDS_LABEL').' -',
'batch[extends]',
JHtml::_('select.options', $this->extendsNameOptions, 'value', 'text')
'- Keep Original '.JText::_('COM_COMPONENTBUILDER_POWER_APPROVED_LABEL').' -',
'batch[approved]',
JHtml::_('select.options', $this->approvedOptions, 'value', 'text')
);
}
}