Release of v5.0.3-alpha1

Add push option to powers area.
This commit is contained in:
2024-08-20 22:34:47 +02:00
parent 2fab51f611
commit 29fef2cbea
29 changed files with 1480 additions and 106 deletions

View File

@@ -13,6 +13,8 @@ namespace VDM\Joomla\Componentbuilder\Utilities;
use Joomla\CMS\Factory;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\ArrayHelper;
/**
@@ -45,6 +47,7 @@ abstract class RepoHelper
'username',
'target',
'access_repo',
'addplaceholders',
'guid'
)))
->from($db->quoteName('#__componentbuilder_repository'))
@@ -66,13 +69,43 @@ abstract class RepoHelper
unset($item->token);
}
unset($item->access_repo);
$item->placeholders = self::setPlaceholders($item->addplaceholders ?? '');
unset($item->addplaceholders);
$path = $item->organisation . '/' . $item->repository;
$options[$path] = $item;
}
return $options;
}
return null;
}
/**
* set the placeholders for this repo
*
* @param string $placeholders The repo placeholders
*
* @return array The result set
* @since 5.0.3
**/
protected static function setPlaceholders(string $placeholders): array
{
$bucket = [];
if (JsonHelper::check($placeholders))
{
$placeholders = json_decode((string) $placeholders, true);
if (ArrayHelper::check($placeholders))
{
foreach ($placeholders as $row)
{
$bucket[$row['target']] = $row['value'];
}
}
}
return $bucket;
}
}