Release of v4.0.1-alpha3

Add in JCB gitea push feature to help maintain JCB core features. Add extending options to interfaces.
This commit is contained in:
2024-06-05 16:38:32 +02:00
parent 37c3a9a670
commit 4d544598e9
40 changed files with 1640 additions and 670 deletions

View File

@@ -153,7 +153,7 @@ class InterfacepowersField extends ListField
// Get the databse object.
$db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.guid','a.name','a.system_name','a.type','a.power_version'),array('guid','implements_name','system_name','type','version')));
$query->select($db->quoteName(array('a.guid','a.name','a.system_name','a.type','a.power_version'),array('guid','extendsinterfaces_name','system_name','type','version')));
$query->from($db->quoteName('#__componentbuilder_power', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
$query->where($db->quoteName('a.type') . ' = ' . $db->quote('interface'));
@@ -181,8 +181,11 @@ class InterfacepowersField extends ListField
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
// set the other option to enter text
$options[] = Html::_('select.option', -1, Text::_('COM_COMPONENTBUILDER_SET_CUSTOM'));
// if none was found, we add this to set an alternative to set custom
if (!$items)
{
$options[] = Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_NONE_FOUND'));
}
if ($items)
{
if ($this->multiple === false)
@@ -191,9 +194,11 @@ class InterfacepowersField extends ListField
}
foreach($items as $item)
{
$options[] = Html::_('select.option', $item->guid, $item->system_name . ' (v' . $item->version . ') [' . $item->type . ' ' . $item->implements_name . ']');
$options[] = Html::_('select.option', $item->guid, $item->system_name . ' [' . $item->type . ' ' . $item->extendsinterfaces_name . '] (v' . $item->version . ')');
}
}
// set the other option to enter text
$options[] = Html::_('select.option', -1, Text::_('COM_COMPONENTBUILDER_SET_CUSTOM'));
return $options;
}
}

View File

@@ -1295,7 +1295,7 @@ class AjaxModel extends ListModel
array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'fields' => array('params' => 'custom_admin_view_headers:power_:power', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW'),
array('table' => 'joomla_component', 'tables' => 'joomla_components', 'fields' => array('params' => 'joomla_component_headers:power_:power', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT'),
array('table' => 'component_dashboard', 'tables' => 'components_dashboard', 'fields' => array('params' => 'component_dashboard_headers:power_:power', 'joomla_component' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD', 'linked_name' => 'system_name'),
array('table' => 'power', 'tables' => 'powers', 'fields' => array('extends' => 'GUID', 'implements' => 'ARRAY', 'use_selection' => 'use', 'load_selection' => 'load', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_POWER')
array('table' => 'power', 'tables' => 'powers', 'fields' => array('extends' => 'GUID', 'extendsinterfaces' => 'ARRAY', 'implements' => 'ARRAY', 'use_selection' => 'use', 'load_selection' => 'load', 'system_name' => 'NAME'), 'linked' => 'COM_COMPONENTBUILDER_POWER')
)
);

View File

@@ -55,8 +55,8 @@ class Joomla_powerModel extends AdminModel
protected $tabLayoutFields = array(
'joomla_power' => array(
'fullwidth' => array(
'description',
'settings'
'settings',
'description'
),
'above' => array(
'system_name'

View File

@@ -62,6 +62,8 @@ class PowerModel extends AdminModel
'description',
'extends',
'extends_custom',
'extendsinterfaces',
'extendsinterfaces_custom',
'implements',
'implements_custom',
'namespace',
@@ -87,6 +89,12 @@ class PowerModel extends AdminModel
'power_version'
)
),
'composer' => array(
'fullwidth' => array(
'autoload_composer_note',
'composer'
)
),
'licensing' => array(
'fullwidth' => array(
'add_licensing_template',
@@ -101,12 +109,6 @@ class PowerModel extends AdminModel
'right' => array(
'note_approved_paths'
)
),
'composer' => array(
'fullwidth' => array(
'autoload_composer_note',
'composer'
)
)
);
@@ -257,14 +259,6 @@ class PowerModel extends AdminModel
$item->main_class_code = base64_decode($item->main_class_code);
}
if (!empty($item->method_selection))
{
// Convert the method_selection field to an array.
$method_selection = new Registry;
$method_selection->loadString($item->method_selection);
$item->method_selection = $method_selection->toArray();
}
if (!empty($item->load_selection))
{
// Convert the load_selection field to an array.
@@ -281,6 +275,14 @@ class PowerModel extends AdminModel
$item->composer = $composer->toArray();
}
if (!empty($item->implements))
{
// Convert the implements field to an array.
$implements = new Registry;
$implements->loadString($item->implements);
$item->implements = $implements->toArray();
}
if (!empty($item->property_selection))
{
// Convert the property_selection field to an array.
@@ -289,12 +291,20 @@ class PowerModel extends AdminModel
$item->property_selection = $property_selection->toArray();
}
if (!empty($item->implements))
if (!empty($item->extendsinterfaces))
{
// Convert the implements field to an array.
$implements = new Registry;
$implements->loadString($item->implements);
$item->implements = $implements->toArray();
// Convert the extendsinterfaces field to an array.
$extendsinterfaces = new Registry;
$extendsinterfaces->loadString($item->extendsinterfaces);
$item->extendsinterfaces = $extendsinterfaces->toArray();
}
if (!empty($item->method_selection))
{
// Convert the method_selection field to an array.
$method_selection = new Registry;
$method_selection->loadString($item->method_selection);
$item->method_selection = $method_selection->toArray();
}
if (!empty($item->use_selection))
@@ -1145,19 +1155,6 @@ class PowerModel extends AdminModel
$data['guid'] = (string) GuidHelper::get();
}
// Set the method_selection items to data.
if (isset($data['method_selection']) && is_array($data['method_selection']))
{
$method_selection = new Registry;
$method_selection->loadArray($data['method_selection']);
$data['method_selection'] = (string) $method_selection;
}
elseif (!isset($data['method_selection']))
{
// Set the empty method_selection to data
$data['method_selection'] = '';
}
// Set the load_selection items to data.
if (isset($data['load_selection']) && is_array($data['load_selection']))
{
@@ -1184,6 +1181,19 @@ class PowerModel extends AdminModel
$data['composer'] = '';
}
// Set the implements items to data.
if (isset($data['implements']) && is_array($data['implements']))
{
$implements = new Registry;
$implements->loadArray($data['implements']);
$data['implements'] = (string) $implements;
}
elseif (!isset($data['implements']))
{
// Set the empty implements to data
$data['implements'] = '';
}
// Set the property_selection items to data.
if (isset($data['property_selection']) && is_array($data['property_selection']))
{
@@ -1197,17 +1207,30 @@ class PowerModel extends AdminModel
$data['property_selection'] = '';
}
// Set the implements items to data.
if (isset($data['implements']) && is_array($data['implements']))
// Set the extendsinterfaces items to data.
if (isset($data['extendsinterfaces']) && is_array($data['extendsinterfaces']))
{
$implements = new Registry;
$implements->loadArray($data['implements']);
$data['implements'] = (string) $implements;
$extendsinterfaces = new Registry;
$extendsinterfaces->loadArray($data['extendsinterfaces']);
$data['extendsinterfaces'] = (string) $extendsinterfaces;
}
elseif (!isset($data['implements']))
elseif (!isset($data['extendsinterfaces']))
{
// Set the empty implements to data
$data['implements'] = '';
// Set the empty extendsinterfaces to data
$data['extendsinterfaces'] = '';
}
// Set the method_selection items to data.
if (isset($data['method_selection']) && is_array($data['method_selection']))
{
$method_selection = new Registry;
$method_selection->loadArray($data['method_selection']);
$data['method_selection'] = (string) $method_selection;
}
elseif (!isset($data['method_selection']))
{
// Set the empty method_selection to data
$data['method_selection'] = '';
}
// Set the use_selection items to data.

View File

@@ -494,7 +494,7 @@ class PowersModel extends ListModel
else
{
$search = $db->quote('%' . $db->escape($search) . '%');
$query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.approved_paths LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.name LIKE '.$search.')');
$query->where('(a.system_name LIKE '.$search.' OR a.type LIKE '.$search.' OR a.description LIKE '.$search.' OR a.extendsinterfaces_custom LIKE '.$search.' OR a.extends LIKE '.$search.' OR a.extends_custom LIKE '.$search.' OR a.extendsinterfaces LIKE '.$search.' OR a.approved_paths LIKE '.$search.' OR a.guid LIKE '.$search.' OR a.name LIKE '.$search.')');
}
}