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

@ -0,0 +1,100 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Import the checkboxes field type classes needed
JFormHelper::loadFieldClass('checkboxes');
use VDM\Joomla\Utilities\Component\Helper;
/**
* Superpowerpaths Form Field class for the Componentbuilder component
*/
class JFormFieldSuperpowerpaths extends JFormFieldCheckboxes
{
/**
* The superpowerpaths field type.
*
* @var string
*/
public $type = 'superpowerpaths';
// A DynamicCheckboxes@ Field
/**
* Method to get the data to be passed to the layout for rendering.
*
* @return array
*
* @since 3.5
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
// True if the field has 'value' set. In other words, it has been stored, don't use the default values.
$hasValue = (isset($this->value) && !empty($this->value));
// If a value has been stored, use it. Otherwise, use the defaults.
$checkedOptions = $hasValue ? $this->value : $this->checkedOptions;
// get the form options
$options = [];
// get the component params
$params = Helper::getParams();
$activate = $params->get('super_powers_repositories', 0);
// set the default
$default = $params->get('super_powers_core', 'joomla/super-powers');
// must have one / in the path
if (strpos($default, '/') !== false)
{
$tmp = new stdClass;
$tmp->text = $tmp->value = trim($default);
$tmp->checked = false;
$options[$tmp->value] = $tmp;
}
if ($activate == 1)
{
$subform = $params->get($this->fieldname);
// add the paths found in global settings
if (is_object($subform))
{
foreach ($subform as $value)
{
if (isset($value->owner) && strlen($value->owner) > 1 &&
isset($value->repo) && strlen($value->repo) > 1)
{
$tmp = new stdClass;
$tmp->text = $tmp->value = trim($value->owner) . '/' . trim($value->repo);
$tmp->checked = false;
$options[$tmp->value] = $tmp;
}
}
}
}
$extraData = array(
'checkedOptions' => is_array($checkedOptions) ? $checkedOptions : explode(',', (string) $checkedOptions),
'hasValue' => $hasValue,
'options' => array_values($options)
);
return array_merge($data, $extraData);
}
}