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:
@ -17,16 +17,16 @@ jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Powersfilterpowerversion Form Field class for the Componentbuilder component
|
||||
* Powersfilterapproved Form Field class for the Componentbuilder component
|
||||
*/
|
||||
class JFormFieldPowersfilterpowerversion extends JFormFieldList
|
||||
class JFormFieldPowersfilterapproved extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The powersfilterpowerversion field type.
|
||||
* The powersfilterapproved field type.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $type = 'powersfilterpowerversion';
|
||||
public $type = 'powersfilterapproved';
|
||||
|
||||
/**
|
||||
* Method to get a list of options for a list input.
|
||||
@ -42,24 +42,28 @@ class JFormFieldPowersfilterpowerversion extends JFormFieldList
|
||||
$query = $db->getQuery(true);
|
||||
|
||||
// Select the text.
|
||||
$query->select($db->quoteName('power_version'));
|
||||
$query->select($db->quoteName('approved'));
|
||||
$query->from($db->quoteName('#__componentbuilder_power'));
|
||||
$query->order($db->quoteName('power_version') . ' ASC');
|
||||
$query->order($db->quoteName('approved') . ' ASC');
|
||||
|
||||
// Reset the query using our newly populated query object.
|
||||
$db->setQuery($query);
|
||||
|
||||
$results = $db->loadColumn();
|
||||
$_filter = array();
|
||||
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_VERSION') . ' -');
|
||||
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_SUPER_POWER') . ' -');
|
||||
|
||||
if ($results)
|
||||
{
|
||||
// get powersmodel
|
||||
$model = ComponentbuilderHelper::getModel('powers');
|
||||
$results = array_unique($results);
|
||||
foreach ($results as $power_version)
|
||||
foreach ($results as $approved)
|
||||
{
|
||||
// Now add the power_version and its text to the options array
|
||||
$_filter[] = JHtml::_('select.option', $power_version, $power_version);
|
||||
// Translate the approved selection
|
||||
$text = $model->selectionTranslation($approved,'approved');
|
||||
// Now add the approved and its text to the options array
|
||||
$_filter[] = JHtml::_('select.option', $approved, JText::_($text));
|
||||
}
|
||||
}
|
||||
return $_filter;
|
100
admin/models/fields/superpowerpaths.php
Normal file
100
admin/models/fields/superpowerpaths.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user