update 2023-10-24 10:36:32

This commit is contained in:
Robot 2023-10-24 10:36:39 +02:00
parent 1ba2cdbd9d
commit 3e3cd1e212
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
38 changed files with 4094 additions and 2434 deletions

View File

@ -109,8 +109,8 @@ class Power implements ServiceProviderInterface
{
return new Superpower(
$container->get('Power.Grep'),
$container->get('Power.Insert'),
$container->get('Power.Update')
$container->get('Power.Database.Insert'),
$container->get('Power.Database.Update')
);
}

View File

@ -79,8 +79,8 @@
{
return new Superpower(
$container->get('Power.Grep'),
$container->get('Power.Insert'),
$container->get('Power.Update')
$container->get('Power.Database.Insert'),
$container->get('Power.Database.Update')
);
}

View File

@ -16,36 +16,55 @@ class Structure #Gold {
# Config $config
# Registry $registry
# Dispenser $dispenser
# EventInterface $event
# Event $event
# Counter $counter
# Folder $folder
# File $file
# Files $files
+ __construct(?Module $module = null, ?Component $component = null, ...)
# TemplateData $templatedata
+ __construct(Module $module, Component $component, ...)
+ build() : void
# getXML(object $module) : string
# getCustomScriptField(array $fieldScriptBucket) : string
# modulePath(object $module) : void
# setMainModFile(object $module) : void
# setCustomGet(object $module) : void
# setHelperFile(object $module) : void
# setMainXmlFile(object $module) : void
# setDefaultFile(object $module) : void
# setTemplateFiles(object $module) : void
# setInstallScript(object $module) : void
# setReadme(object $module) : void
# setCssJsForm(object $module) : void
# setCssForm(object $module, string $targetPath, ...) : void
# setJsForm(object $module, string $targetPath, ...) : void
# setForms(object $module) : void
# setSQL(object $module) : void
# setFiles(object $module) : void
# setFolders(object $module) : void
# setUrls(object $module) : void
}
note right of Structure::__construct
Constructor
Constructor.
since: 3.2.0
arguments:
?Module $module = null
?Component $component = null
?Config $config = null
?Registry $registry = null
?Dispenser $dispenser = null
?EventInterface $event = null
?Counter $counter = null
?Folder $folder = null
?File $file = null
?Files $files = null
Module $module
Component $component
Config $config
Registry $registry
Dispenser $dispenser
Event $event
Counter $counter
Folder $folder
File $file
Files $files
TemplateData $templatedata
end note
note right of Structure::build
note left of Structure::build
Build the Modules files, folders, url's and config
since: 3.2.0
@ -59,12 +78,141 @@ note right of Structure::getXML
return: string
end note
note right of Structure::getCustomScriptField
note left of Structure::getCustomScriptField
get the module admin custom script field
since: 3.2.0
return: string
end note
note right of Structure::modulePath
Set the module path
since: 3.2.0
return: void
end note
note left of Structure::setMainModFile
Set the main module file
since: 3.2.0
return: void
end note
note right of Structure::setCustomGet
Set the custom get file
since: 3.2.0
return: void
end note
note left of Structure::setHelperFile
Set the helper file
since: 3.2.0
return: void
end note
note right of Structure::setMainXmlFile
Set the main XML file
since: 3.2.0
return: void
end note
note left of Structure::setDefaultFile
Set the main default template file
since: 3.2.0
return: void
end note
note right of Structure::setTemplateFiles
Set the additional template files
since: 3.2.0
return: void
end note
note left of Structure::setInstallScript
Set the install script file
since: 3.2.0
return: void
end note
note right of Structure::setReadme
Set the readme file
since: 3.2.0
return: void
end note
note left of Structure::setCssJsForm
Set the css and javascript in form
since: 3.2.0
return: void
end note
note right of Structure::setCssForm
Set the css in form
since: 3.2.0
return: void
arguments:
object $module
string $targetPath
array $bucket
end note
note left of Structure::setJsForm
Set the javascript in form
since: 3.2.0
return: void
arguments:
object $module
string $targetPath
array $bucket
end note
note right of Structure::setForms
Set the form folders and files as needed
since: 3.2.0
return: void
end note
note left of Structure::setSQL
Set the sql stuff
since: 3.2.0
return: void
end note
note right of Structure::setFiles
Set the files
since: 3.2.0
return: void
end note
note left of Structure::setFolders
Set the folders
since: 3.2.0
return: void
end note
note right of Structure::setUrls
Set the urls
since: 3.2.0
return: void
end note
@enduml
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,61 +11,61 @@
"type": "class",
"use_selection": {
"use_selection0": {
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",
"as": "Compiler"
},
"use_selection1": {
"use": "cb11e8d9-69c2-4095-831c-59908ea402e7",
"as": "Module"
},
"use_selection2": {
"use_selection1": {
"use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0",
"as": "default"
},
"use_selection3": {
"use_selection2": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection4": {
"use_selection3": {
"use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6",
"as": "default"
},
"use_selection5": {
"use_selection4": {
"use": "f1dc6430-fb54-452e-aa53-ce32ae93db88",
"as": "default"
},
"use_selection6": {
"use_selection5": {
"use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d",
"as": "default"
"as": "Event"
},
"use_selection7": {
"use_selection6": {
"use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4",
"as": "default"
},
"use_selection8": {
"use_selection7": {
"use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1",
"as": "default"
},
"use_selection9": {
"use_selection8": {
"use": "5c75b455-3d4c-452a-867e-e90424a64c88",
"as": "default"
},
"use_selection10": {
"use_selection9": {
"use": "1d967151-7c20-4ca7-9400-65233cdcd4db",
"as": "default"
},
"use_selection11": {
"use_selection10": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection12": {
"use_selection11": {
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
"as": "default"
},
"use_selection13": {
"use_selection12": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
},
"use_selection13": {
"use": "8591f6db-dd3c-4a63-9b3f-574c0ec74ade",
"as": "default"
},
"use_selection14": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"

View File

@ -24,14 +24,14 @@ note right of Joomlamodule::register
end note
note right of Joomlamodule::getData
Get the Joomla Module Data
Get The Data Class.
since: 3.2.0
return: Data
end note
note right of Joomlamodule::getStructure
Get the Joomla Module Structure Builder
Get The Structure Class.
since: 3.2.0
return: Structure

View File

@ -43,7 +43,7 @@ class Joomlamodule implements ServiceProviderInterface
}
/**
* Get the Joomla Module Data
* Get The Data Class.
*
* @param Container $container The DI container.
*
@ -62,12 +62,13 @@ class Joomlamodule implements ServiceProviderInterface
$container->get('Field.Name'),
$container->get('Model.Filesfolders'),
$container->get('Model.Libraries'),
$container->get('Dynamicget.Data')
$container->get('Dynamicget.Data'),
$container->get('Templatelayout.Data')
);
}
/**
* Get the Joomla Module Structure Builder
* Get The Structure Class.
*
* @param Container $container The DI container.
*
@ -86,9 +87,9 @@ class Joomlamodule implements ServiceProviderInterface
$container->get('Utilities.Counter'),
$container->get('Utilities.Folder'),
$container->get('Utilities.File'),
$container->get('Utilities.Files')
$container->get('Utilities.Files'),
$container->get('Compiler.Builder.Template.Data')
);
}
}
}

View File

@ -16,7 +16,7 @@
}
/**
* Get the Joomla Module Data
* Get The Data Class.
*
* @param Container $container The DI container.
*
@ -35,12 +35,13 @@
$container->get('Field.Name'),
$container->get('Model.Filesfolders'),
$container->get('Model.Libraries'),
$container->get('Dynamicget.Data')
$container->get('Dynamicget.Data'),
$container->get('Templatelayout.Data')
);
}
/**
* Get the Joomla Module Structure Builder
* Get The Structure Class.
*
* @param Container $container The DI container.
*
@ -59,6 +60,7 @@
$container->get('Utilities.Counter'),
$container->get('Utilities.Folder'),
$container->get('Utilities.File'),
$container->get('Utilities.Files')
$container->get('Utilities.Files'),
$container->get('Compiler.Builder.Template.Data')
);
}
}

View File

@ -15,6 +15,8 @@ class Super << (F,LightGreen) >> #RoyalBlue {
# Insert $insert
# Update $update
+ __construct(Grep $grep, Insert $insert, ...)
+ init() : bool
+ reset(array $powers) : bool
+ load(string $guid, array $order = ['remote', 'local'], ...) : bool
- insert(object $power) : bool
- update(object $power) : bool
@ -32,6 +34,20 @@ note right of Super::__construct
Update $update
end note
note right of Super::init
Init all power not found in database
since: 3.2.0
return: bool
end note
note right of Super::reset
Reset the powers
since: 3.2.0
return: bool
end note
note right of Super::load
Load a superpower

View File

@ -65,6 +65,58 @@ final class Super
$this->update = $update;
}
/**
* Init all power not found in database
*
* @return bool
* @since 3.2.0
*/
public function init(): bool
{
if (($powers = $this->grep->getRemotePowersGuid()) !== null)
{
foreach($powers as $guid)
{
if ($this->action($guid) === 'insert' && ($power = $this->grep->get($guid, ['remote'])) !== null)
{
$this->insert($power);
}
}
return true;
}
return false;
}
/**
* Reset the powers
*
* @param array $powers The global unique ids of the powers
*
* @return bool
* @since 3.2.0
*/
public function reset(array $powers): bool
{
if ($powers === [])
{
return false;
}
$success = true;
foreach($powers as $guid)
{
if (!$this->load($guid, ['remote']))
{
$success = false;
}
}
return $success;
}
/**
* Load a superpower
*

View File

@ -38,6 +38,58 @@
$this->update = $update;
}
/**
* Init all power not found in database
*
* @return bool
* @since 3.2.0
*/
public function init(): bool
{
if (($powers = $this->grep->getRemotePowersGuid()) !== null)
{
foreach($powers as $guid)
{
if ($this->action($guid) === 'insert' && ($power = $this->grep->get($guid, ['remote'])) !== null)
{
$this->insert($power);
}
}
return true;
}
return false;
}
/**
* Reset the powers
*
* @param array $powers The global unique ids of the powers
*
* @return bool
* @since 3.2.0
*/
public function reset(array $powers): bool
{
if ($powers === [])
{
return false;
}
$success = true;
foreach($powers as $guid)
{
if (!$this->load($guid, ['remote']))
{
$success = false;
}
}
return $success;
}
/**
* Load a superpower
*

View File

@ -10,15 +10,15 @@
"system_name": "JCB.Power.Super",
"type": "final class",
"use_selection": {
"use_selection2": {
"use_selection0": {
"use": "6784dd52-0909-451a-a872-9a942a023c68",
"as": "default"
},
"use_selection0": {
"use_selection1": {
"use": "380bb7a3-cdcc-4336-a699-5070cbf521a5",
"as": "default"
},
"use_selection1": {
"use_selection2": {
"use": "e543c123-b1d9-4a0b-83b2-a9d371da5ff3",
"as": "default"
},

View File

@ -33,12 +33,18 @@ class Createdate
*/
public function get(&$item): string
{
if (isset($item['settings']->created)
if (is_array($item) && isset($item['settings']) && isset($item['settings']->created)
&& StringHelper::check($item['settings']->created))
{
// first set the main date
$date = strtotime((string) $item['settings']->created);
}
elseif (is_object($item) && isset($item->created)
&& StringHelper::check($item->created))
{
// first set the main date
$date = strtotime((string) $item->created);
}
else
{
// first set the main date

View File

@ -8,12 +8,18 @@
*/
public function get(&$item): string
{
if (isset($item['settings']->created)
if (is_array($item) && isset($item['settings']) && isset($item['settings']->created)
&& StringHelper::check($item['settings']->created))
{
// first set the main date
$date = strtotime((string) $item['settings']->created);
}
elseif (is_object($item) && isset($item->created)
&& StringHelper::check($item->created))
{
// first set the main date
$date = strtotime((string) $item->created);
}
else
{
// first set the main date

View File

@ -16,6 +16,7 @@ class Grep << (F,LightGreen) >> #RoyalBlue {
# Contents $contents
# CMSApplication $app
+ __construct(string $path, array $paths, ...)
+ getRemotePowersGuid() : ?array
+ get(string $guid, array $order = ['local', 'remote']) : ?object
- searchLocal(string $guid) : ?object
- searchRemote(string $guid) : ?object
@ -40,63 +41,70 @@ note right of Grep::__construct
?CMSApplication $app = null
end note
note left of Grep::get
note left of Grep::getRemotePowersGuid
Get all remote powers GUID's
since: 3.2.0
return: ?array
end note
note right of Grep::get
Get a power
since: 3.2.0
return: ?object
end note
note right of Grep::searchLocal
note left of Grep::searchLocal
Search for a local power
since: 3.2.0
return: ?object
end note
note left of Grep::searchRemote
note right of Grep::searchRemote
Search for a remote power
since: 3.2.0
return: ?object
end note
note right of Grep::getLocal
note left of Grep::getLocal
Get a local power
since: 3.2.0
return: ?object
end note
note left of Grep::getRemote
note right of Grep::getRemote
Get a remote power
since: 3.2.0
return: ?object
end note
note right of Grep::init
note left of Grep::init
Set path details
since: 3.2.0
return: void
end note
note left of Grep::localIndex
note right of Grep::localIndex
Load the local repository index of powers
since: 3.2.0
return: void
end note
note right of Grep::remoteIndex
note left of Grep::remoteIndex
Load the remote repository index of powers
since: 3.2.0
return: void
end note
note left of Grep::loadRemoteFile
note right of Grep::loadRemoteFile
Load the remote file
since: 3.2.0
@ -109,7 +117,7 @@ note left of Grep::loadRemoteFile
?string $branch
end note
note right of Grep::getFunctionName
note left of Grep::getFunctionName
Get function name
since: 3.2.0

View File

@ -86,6 +86,34 @@ final class Grep
$this->init();
}
/**
* Get all remote powers GUID's
*
* @return array|null
* @since 3.2.0
*/
public function getRemotePowersGuid(): ?array
{
if (!is_array($this->paths) || $this->paths === [])
{
return null;
}
$powers = [];
foreach ($this->paths as $path)
{
// Get local index
$this->remoteIndex($path);
if (isset($path->index) && is_object($path->index))
{
$powers = array_merge($powers, array_keys((array) $path->index));
}
}
return empty($powers) ? null : array_unique($powers);
}
/**
* Get a power
*
@ -316,10 +344,10 @@ final class Grep
{
$path->index = $this->contents->get($path->owner, $path->repo, 'super-powers.json', $path->branch);
}
catch (\DomainException $e)
catch (\Exception $e)
{
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BGITVDMDEVSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $path->path, $e->getMessage()),
Text::sprintf('COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path->path, $e->getMessage()),
'Error'
);
@ -344,10 +372,10 @@ final class Grep
{
$data = $this->contents->get($owner, $repo, $path, $branch);
}
catch (\DomainException $e)
catch (\Exception $e)
{
$this->app->enqueueMessage(
Text::sprintf('COM_COMPONENTBUILDER_PFILE_AT_BGITEAREMOTESB_GAVE_THE_FOLLOWING_ERRORBR_SP', $path, $e->getMessage()),
Text::sprintf('COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path, $e->getMessage()),
'Error'
);

View File

@ -51,6 +51,34 @@
$this->init();
}
/**
* Get all remote powers GUID's
*
* @return array|null
* @since 3.2.0
*/
public function getRemotePowersGuid(): ?array
{
if (!is_array($this->paths) || $this->paths === [])
{
return null;
}
$powers = [];
foreach ($this->paths as $path)
{
// Get local index
$this->remoteIndex($path);
if (isset($path->index) && is_object($path->index))
{
$powers = array_merge($powers, array_keys((array) $path->index));
}
}
return empty($powers) ? null : array_unique($powers);
}
/**
* Get a power
*
@ -281,10 +309,10 @@
{
$path->index = $this->contents->get($path->owner, $path->repo, 'super-powers.json', $path->branch);
}
catch (\DomainException $e)
catch (\Exception $e)
{
$this->app->enqueueMessage(
Text::sprintf('<p>Super Power</b> repository at <b>git.vdm.dev/%s</b> gave the following error!<br />%s</p>', $path->path, $e->getMessage()),
Text::sprintf('<p>Super Power</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>', $this->contents->api(), $path->path, $e->getMessage()),
'Error'
);
@ -309,10 +337,10 @@
{
$data = $this->contents->get($owner, $repo, $path, $branch);
}
catch (\DomainException $e)
catch (\Exception $e)
{
$this->app->enqueueMessage(
Text::sprintf('<p>File at <b>gitea.remote/%s</b> gave the following error!<br />%s</p>', $path, $e->getMessage()),
Text::sprintf('<p>File at <b>%s/%s</b> gave the following error!<br />%s</p>', $this->contents->api(), $path, $e->getMessage()),
'Error'
);

View File

@ -12,7 +12,7 @@
@startuml
interface Cryptinterface #Lavender {
+ encrypt(string $string, string $key) : string
+ decrypt(string $string, string $key) : string
+ decrypt(string $string, string $key) : ?string
}
note right of Cryptinterface::encrypt
@ -26,7 +26,7 @@ note right of Cryptinterface::decrypt
Decrypt a string as needed
since: 3.2.0
return: string
return: ?string
end note
@enduml

View File

@ -34,10 +34,10 @@ interface Cryptinterface
* @param string $string The string to decrypt
* @param string $key The decryption key
*
* @return string
* @return string|null
* @since 3.2.0
**/
public function decrypt(string $string, string $key): string;
public function decrypt(string $string, string $key): ?string;
}

View File

@ -15,7 +15,7 @@
* @param string $string The string to decrypt
* @param string $key The decryption key
*
* @return string
* @return string|null
* @since 3.2.0
**/
public function decrypt(string $string, string $key): string;
public function decrypt(string $string, string $key): ?string;

View File

@ -13,9 +13,11 @@
class Modifieddate #Gold {
# array $last
+ get(array $item) : string
# getDate(array $item) : int
# getModified(array $item) : int
# getKey(array $item) : string
# getDate(array|object $item) : int
# getModified(array|object $item) : int
# getKey(array|object $item) : string
# getKeyFromArray(array $item) : string
# getKeyFromObject(object $item) : string
}
note right of Modifieddate::get
@ -45,6 +47,20 @@ note right of Modifieddate::getKey
since: 3.2.0
return: string
end note
note right of Modifieddate::getKeyFromArray
Get the key for an item (array)
since: 3.2.0
return: string
end note
note right of Modifieddate::getKeyFromObject
Get the key for an item (object)
since: 3.2.0
return: string
end note
@enduml
```

View File

@ -60,19 +60,25 @@ class Modifieddate
/**
* Get the last modified date of an item
*
* @param array $item The item data
* @param array|object $item The item data
*
* @return int The modified date as int
* @since 3.2.0
*/
protected function getDate(array $item): int
protected function getDate($item): int
{
if (isset($item['settings']) && isset($item['settings']->modified)
if (is_array($item) && isset($item['settings']) && isset($item['settings']->modified)
&& StringHelper::check($item['settings']->modified)
&& '0000-00-00 00:00:00' !== $item['settings']->modified)
{
return strtotime((string) $item['settings']->modified);
}
elseif (is_object($item) && isset($item->modified)
&& StringHelper::check($item->modified)
&& '0000-00-00 00:00:00' !== $item->modified)
{
return strtotime((string) $item->modified);
}
return strtotime("now");
}
@ -80,17 +86,17 @@ class Modifieddate
/**
* Get the last modified date of an item's sub items
*
* @param array $item The item data
* @param array|object $item The item data
*
* @return int The modified date as int
* @since 3.2.0
*/
protected function getModified(array $item): int
protected function getModified($item): int
{
$date = 0;
// if not settings is found
if (!isset($item['settings']) || !ObjectHelper::check($item['settings']))
if (!is_array($item) || !isset($item['settings']) || !ObjectHelper::check($item['settings']))
{
return $date;
}
@ -128,12 +134,34 @@ class Modifieddate
/**
* Get the key for an item
*
* @param array|object $item The item data
*
* @return string The key
* @since 3.2.0
*/
protected function getKey($item): string
{
if (is_array($item))
{
return $this->getKeyFromArray($item);
}
elseif (is_object($item))
{
return $this->getKeyFromObject($item);
}
return 'error';
}
/**
* Get the key for an item (array)
*
* @param array $item The item data
*
* @return string The key
* @since 3.2.0
*/
protected function getKey(array $item): string
protected function getKeyFromArray(array $item): string
{
if (isset($item['adminview']))
{
@ -150,6 +178,23 @@ class Modifieddate
return 'error';
}
/**
* Get the key for an item (object)
*
* @param object $item The item data
*
* @return string The key
* @since 3.2.0
*/
protected function getKeyFromObject(object $item): string
{
if (isset($item->key))
{
return $item->key;
}
return 'error';
}
}

View File

@ -33,19 +33,25 @@
/**
* Get the last modified date of an item
*
* @param array $item The item data
* @param array|object $item The item data
*
* @return int The modified date as int
* @since 3.2.0
*/
protected function getDate(array $item): int
protected function getDate($item): int
{
if (isset($item['settings']) && isset($item['settings']->modified)
if (is_array($item) && isset($item['settings']) && isset($item['settings']->modified)
&& StringHelper::check($item['settings']->modified)
&& '0000-00-00 00:00:00' !== $item['settings']->modified)
{
return strtotime((string) $item['settings']->modified);
}
elseif (is_object($item) && isset($item->modified)
&& StringHelper::check($item->modified)
&& '0000-00-00 00:00:00' !== $item->modified)
{
return strtotime((string) $item->modified);
}
return strtotime("now");
}
@ -53,17 +59,17 @@
/**
* Get the last modified date of an item's sub items
*
* @param array $item The item data
* @param array|object $item The item data
*
* @return int The modified date as int
* @since 3.2.0
*/
protected function getModified(array $item): int
protected function getModified($item): int
{
$date = 0;
// if not settings is found
if (!isset($item['settings']) || !ObjectHelper::check($item['settings']))
if (!is_array($item) || !isset($item['settings']) || !ObjectHelper::check($item['settings']))
{
return $date;
}
@ -101,12 +107,34 @@
/**
* Get the key for an item
*
* @param array|object $item The item data
*
* @return string The key
* @since 3.2.0
*/
protected function getKey($item): string
{
if (is_array($item))
{
return $this->getKeyFromArray($item);
}
elseif (is_object($item))
{
return $this->getKeyFromObject($item);
}
return 'error';
}
/**
* Get the key for an item (array)
*
* @param array $item The item data
*
* @return string The key
* @since 3.2.0
*/
protected function getKey(array $item): string
protected function getKeyFromArray(array $item): string
{
if (isset($item['adminview']))
{
@ -123,3 +151,21 @@
return 'error';
}
/**
* Get the key for an item (object)
*
* @param object $item The item data
*
* @return string The key
* @since 3.2.0
*/
protected function getKeyFromObject(object $item): string
{
if (isset($item->key))
{
return $item->key;
}
return 'error';
}

View File

@ -16,35 +16,45 @@ class Structure #Gold {
# Config $config
# Registry $registry
# Dispenser $dispenser
# EventInterface $event
# Event $event
# Counter $counter
# Folder $folder
# File $file
# Files $files
+ __construct(?Plugin $plugin = null, ?Component $component = null, ...)
+ __construct(Plugin $plugin, Component $component, ...)
+ build() : void
# getXML($plugin) : string
# getXML(object $plugin) : string
# pluginPath(object $plugin) : void
# setMainClassFile(object $plugin) : void
# setMainXmlFile(mixed $plugin) : void
# setInstallScript(object $plugin) : void
# setReadme(object $plugin) : void
# setForms(object $plugin) : void
# setSQL(object $plugin) : void
# setFiles(object $plugin) : void
# setFolders(object $plugin) : void
# setUrls(object $plugin) : void
}
note right of Structure::__construct
Constructor
Constructor.
since: 3.2.0
arguments:
?Plugin $plugin = null
?Component $component = null
?Config $config = null
?Registry $registry = null
?Dispenser $dispenser = null
?EventInterface $event = null
?Counter $counter = null
?Folder $folder = null
?File $file = null
?Files $files = null
Plugin $plugin
Component $component
Config $config
Registry $registry
Dispenser $dispenser
Event $event
Counter $counter
Folder $folder
File $file
Files $files
end note
note right of Structure::build
note left of Structure::build
Build the Plugins files, folders, url's and config
since: 3.2.0
@ -57,6 +67,76 @@ note right of Structure::getXML
since: 3.2.0
return: string
end note
note left of Structure::pluginPath
set the plugin path
since: 3.2.0
return: void
end note
note right of Structure::setMainClassFile
set the main class path
since: 3.2.0
return: void
end note
note left of Structure::setMainXmlFile
set the main xml file
since: 3.2.0
return: void
end note
note right of Structure::setInstallScript
set the install script file
since: 3.2.0
return: void
end note
note left of Structure::setReadme
set the readme file
since: 3.2.0
return: void
end note
note right of Structure::setForms
set the form files and folders
since: 3.2.0
return: void
end note
note left of Structure::setSQL
set the sql stuff
since: 3.2.0
return: void
end note
note right of Structure::setFiles
set the files
since: 3.2.0
return: void
end note
note left of Structure::setFolders
set the folders
since: 3.2.0
return: void
end note
note right of Structure::setUrls
set the urls
since: 3.2.0
return: void
end note
@enduml
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,74 +11,70 @@
"type": "class",
"use_selection": {
"use_selection0": {
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",
"as": "Compiler"
},
"use_selection1": {
"use": "766a9524-37df-4604-91a7-b98a6150ee26",
"as": "Plugin"
},
"use_selection2": {
"use_selection1": {
"use": "e2472b22-a329-44d8-b4a2-ae3ba99e17a0",
"as": "default"
},
"use_selection3": {
"use_selection2": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection4": {
"use_selection3": {
"use": "e5d9804f-0eb0-4ee9-b406-ad4e8cdbc1f6",
"as": "default"
},
"use_selection5": {
"use_selection4": {
"use": "f1dc6430-fb54-452e-aa53-ce32ae93db88",
"as": "default"
},
"use_selection6": {
"use_selection5": {
"use": "20ed72b0-fcac-4344-aee1-8a65e3bf221d",
"as": "default"
"as": "Event"
},
"use_selection7": {
"use_selection6": {
"use": "e6d871a6-bbe7-497d-af01-68f6bb9a87f4",
"as": "default"
},
"use_selection8": {
"use_selection7": {
"use": "6bbb6ffe-3f09-4c21-aa9d-c93159afa1e1",
"as": "default"
},
"use_selection9": {
"use_selection8": {
"use": "5c75b455-3d4c-452a-867e-e90424a64c88",
"as": "default"
},
"use_selection10": {
"use_selection9": {
"use": "1d967151-7c20-4ca7-9400-65233cdcd4db",
"as": "default"
},
"use_selection11": {
"use_selection10": {
"use": "a68c010b-e92e-47d5-8a44-d23cfddeb6c6",
"as": "default"
},
"use_selection12": {
"use_selection11": {
"use": "500f3a7f-c16d-4dd4-81b2-2df6776b5388",
"as": "default"
},
"use_selection13": {
"use_selection12": {
"use": "4e6ff11d-bebf-42f5-8fd7-b2f882857222",
"as": "default"
},
"use_selection14": {
"use_selection13": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"
},
"use_selection15": {
"use_selection14": {
"use": "91004529-94a9-4590-b842-e7c6b624ecf5",
"as": "default"
},
"use_selection16": {
"use_selection15": {
"use": "1f28cb53-60d9-4db1-b517-3c7dc6b429ef",
"as": "default"
},
"use_selection17": {
"use_selection16": {
"use": "a223b31e-ea1d-4cdf-92ae-5f9becffaff0",
"as": "default"
}

View File

@ -18,7 +18,11 @@ class Config #Gold {
# getAddcustomgiteaurl() : int
# getCustomgiteaurl() : ?string
# getCustomgiteatoken() : ?string
# getSuperpowerscoreorganisation() : string
# getSuperpowersinitrepos() : array
# getTmppath() : string
# getAddsuperpowers() : bool
# getAddownpowers() : bool
# getLocalpowersrepositorypath() : string
# getApprovedpaths() : array
}
@ -62,6 +66,20 @@ note right of Config::getCustomgiteatoken
return: ?string
end note
note left of Config::getSuperpowerscoreorganisation
Get super power core organisation
since: 3.2.0
return: string
end note
note right of Config::getSuperpowersinitrepos
Get super power init repos
since: 3.2.0
return: array
end note
note left of Config::getTmppath
get temporary path
@ -69,6 +87,20 @@ note left of Config::getTmppath
return: string
end note
note right of Config::getAddsuperpowers
Get switch to add super powers
since: 3.2.0
return: bool
end note
note left of Config::getAddownpowers
Get switch to add own super powers
since: 3.2.0
return: bool
end note
note right of Config::getLocalpowersrepositorypath
Get local super powers repository path

View File

@ -111,6 +111,66 @@ class Config extends BaseConfig
return null;
}
/**
* Get super power core organisation
*
* @return string The super power core organisation
* @since 3.2.0
*/
protected function getSuperpowerscoreorganisation(): string
{
// the VDM default organisation is [joomla]
$organisation = 'joomla';
if ($this->add_custom_gitea_url == 2)
{
return $this->params->get('super_powers_core_organisation', $organisation);
}
return $organisation;
}
/**
* Get super power init repos
*
* @return array The init repositories on Gitea
* @since 3.2.0
*/
protected function getSuperpowersinitrepos(): array
{
// some defaults repos we need by JCB
$repos = [];
// only add custom init with custom gitea
$paths = null;
if ($this->add_custom_gitea_url == 2)
{
$paths = $this->params->get('super_powers_init_repos');
}
if (!empty($paths) && is_array($paths))
{
foreach ($paths as $path)
{
$owner = $path->owner ?? null;
$repo = $path->repo ?? null;
if ($owner !== null && $repo !== null)
{
// we make sure to get only the objects
$repos = ["{$owner}.{$repo}" => $path] + $repos;
}
}
}
else
{
$repos[$this->super_powers_core_organisation . '.super-powers'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'super-powers', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.gitea'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'gitea', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.openai'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'openai', 'branch' => 'master'];
}
return $repos;
}
/**
* get temporary path
*
@ -123,6 +183,33 @@ class Config extends BaseConfig
return $this->config->get('tmp_path');
}
/**
* Get switch to add super powers
*
* @return bool Switch to add super powers
* @since 3.2.0
*/
protected function getAddsuperpowers(): bool
{
return (bool) $this->params->get('powers_repository', 0);
}
/**
* Get switch to add own super powers
*
* @return bool Switch to add own super powers
* @since 3.2.0
*/
protected function getAddownpowers(): bool
{
if ($this->add_super_powers)
{
return (bool) $this->params->get('super_powers_repositories', 0);
}
return false;
}
/**
* Get local super powers repository path
*
@ -138,18 +225,7 @@ class Config extends BaseConfig
return $default;
}
$global = $this->params->get('local_powers_repository_path', $default);
if (!$this->show_advanced_options)
{
return $global;
}
$value = $this->input->post->get('powers_repository', 2, 'INT');
return $value == 1
? $this->input->post->get('local_powers_repository_path', $global, 'PATH')
: $global;
return $this->params->get('local_powers_repository_path', $default);
}
/**
@ -160,29 +236,31 @@ class Config extends BaseConfig
*/
protected function getApprovedpaths(): array
{
$default = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
// some defaults repos we need by JCB
$approved = $this->super_powers_init_repos;
if (!$this->add_own_powers)
{
return [$default];
return array_values($approved);
}
$paths = $this->params->get('approved_paths');
$approved = [];
if (!empty($paths))
{
foreach ($paths as $path)
{
// we make sure to get only the objects
$approved[] = $path;
$owner = $path->owner ?? null;
$repo = $path->repo ?? null;
if ($owner !== null && $repo !== null)
{
// we make sure to get only the objects
$approved = ["{$owner}.{$repo}" => $path] + $approved;
}
}
}
// finally we add the default
$approved[] = $default;
return $approved;
return array_values($approved);
}
}

View File

@ -77,6 +77,66 @@
return null;
}
/**
* Get super power core organisation
*
* @return string The super power core organisation
* @since 3.2.0
*/
protected function getSuperpowerscoreorganisation(): string
{
// the VDM default organisation is [joomla]
$organisation = 'joomla';
if ($this->add_custom_gitea_url == 2)
{
return $this->params->get('super_powers_core_organisation', $organisation);
}
return $organisation;
}
/**
* Get super power init repos
*
* @return array The init repositories on Gitea
* @since 3.2.0
*/
protected function getSuperpowersinitrepos(): array
{
// some defaults repos we need by JCB
$repos = [];
// only add custom init with custom gitea
$paths = null;
if ($this->add_custom_gitea_url == 2)
{
$paths = $this->params->get('super_powers_init_repos');
}
if (!empty($paths) && is_array($paths))
{
foreach ($paths as $path)
{
$owner = $path->owner ?? null;
$repo = $path->repo ?? null;
if ($owner !== null && $repo !== null)
{
// we make sure to get only the objects
$repos = ["{$owner}.{$repo}" => $path] + $repos;
}
}
}
else
{
$repos[$this->super_powers_core_organisation . '.super-powers'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'super-powers', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.gitea'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'gitea', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.openai'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'openai', 'branch' => 'master'];
}
return $repos;
}
/**
* get temporary path
*
@ -89,6 +149,33 @@
return $this->config->get('tmp_path');
}
/**
* Get switch to add super powers
*
* @return bool Switch to add super powers
* @since 3.2.0
*/
protected function getAddsuperpowers(): bool
{
return (bool) $this->params->get('powers_repository', 0);
}
/**
* Get switch to add own super powers
*
* @return bool Switch to add own super powers
* @since 3.2.0
*/
protected function getAddownpowers(): bool
{
if ($this->add_super_powers)
{
return (bool) $this->params->get('super_powers_repositories', 0);
}
return false;
}
/**
* Get local super powers repository path
*
@ -104,18 +191,7 @@
return $default;
}
$global = $this->params->get('local_powers_repository_path', $default);
if (!$this->show_advanced_options)
{
return $global;
}
$value = $this->input->post->get('powers_repository', 2, 'INT');
return $value == 1
? $this->input->post->get('local_powers_repository_path', $global, 'PATH')
: $global;
return $this->params->get('local_powers_repository_path', $default);
}
/**
@ -126,27 +202,29 @@
*/
protected function getApprovedpaths(): array
{
$default = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
// some defaults repos we need by JCB
$approved = $this->super_powers_init_repos;
if (!$this->add_own_powers)
{
return [$default];
return array_values($approved);
}
$paths = $this->params->get('approved_paths');
$approved = [];
if (!empty($paths))
{
foreach ($paths as $path)
{
// we make sure to get only the objects
$approved[] = $path;
$owner = $path->owner ?? null;
$repo = $path->repo ?? null;
if ($owner !== null && $repo !== null)
{
// we make sure to get only the objects
$approved = ["{$owner}.{$repo}" => $path] + $approved;
}
}
}
// finally we add the default
$approved[] = $default;
return $approved;
return array_values($approved);
}

View File

@ -18,33 +18,34 @@ class Data #Gold {
# Placeholder $placeholder
# Language $language
# Field $field
# FieldName $fieldName
# Filesfolders $filesFolders
# Fieldname $fieldname
# Filesfolders $filesfolders
# Libraries $libraries
# Dynamicget $dynamic
# \JDatabaseDriver $db
+ __construct(?Config $config = null, ?Customcode $customcode = null, ...)
# Dynamicget $dynamicget
# Templatelayout $templatelayout
+ __construct(Config $config, Customcode $customcode, ...)
+ get(int $id = null) : object|array|null
+ exists(int $id = null) : bool
+ set(int $id) : bool
}
note right of Data::__construct
Constructor
Constructor.
since: 3.2.0
arguments:
?Config $config = null
?Customcode $customcode = null
?Gui $gui = null
?Placeholder $placeholder = null
?Language $language = null
?Field $field = null
?FieldName $fieldName = null
?Filesfolders $filesFolders = null
?Libraries $libraries = null
?Dynamicget $dynamic = null
Config $config
Customcode $customcode
Gui $gui
Placeholder $placeholder
Language $language
Field $field
Fieldname $fieldname
Filesfolders $filesfolders
Libraries $libraries
Dynamicget $dynamicget
Templatelayout $templatelayout
?\JDatabaseDriver $db = null
end note

View File

@ -14,17 +14,17 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Joomlamodule;
use Joomla\CMS\Factory;
use Joomla\CMS\Filter\OutputFilter;
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
use VDM\Joomla\Componentbuilder\Compiler\Config;
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
use VDM\Joomla\Componentbuilder\Compiler\Language;
use VDM\Joomla\Componentbuilder\Compiler\Field;
use VDM\Joomla\Componentbuilder\Compiler\Field\Name as FieldName;
use VDM\Joomla\Componentbuilder\Compiler\Field\Name as Fieldname;
use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders;
use VDM\Joomla\Componentbuilder\Compiler\Model\Libraries;
use VDM\Joomla\Componentbuilder\Compiler\Dynamicget\Data as Dynamicget;
use VDM\Joomla\Componentbuilder\Compiler\Templatelayout\Data as Templatelayout;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\String\ClassfunctionHelper;
use VDM\Joomla\Utilities\JsonHelper;
@ -48,126 +48,129 @@ class Data
protected array $data = [];
/**
* Compiler Config
* The Config Class.
*
* @var Config
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Compiler Customcode
* The Customcode Class.
*
* @var Customcode
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Compiler Customcode in Gui
* The Gui Class.
*
* @var Gui
* @var Gui
* @since 3.2.0
**/
*/
protected Gui $gui;
/**
* Compiler Placeholder
* The Placeholder Class.
*
* @var Placeholder
* @var Placeholder
* @since 3.2.0
**/
*/
protected Placeholder $placeholder;
/**
* Compiler Language
* The Language Class.
*
* @var Language
* @var Language
* @since 3.2.0
**/
*/
protected Language $language;
/**
* Compiler Field
* The Field Class.
*
* @var Field
* @var Field
* @since 3.2.0
*/
protected Field $field;
/**
* Compiler field name
* The Name Class.
*
* @var FieldName
* @var Fieldname
* @since 3.2.0
*/
protected FieldName $fieldName;
protected Fieldname $fieldname;
/**
* Compiler Files Folders
* The Filesfolders Class.
*
* @var Filesfolders
* @var Filesfolders
* @since 3.2.0
*/
protected Filesfolders $filesFolders;
protected Filesfolders $filesfolders;
/**
* Compiler Libraries Model
* The Libraries Class.
*
* @var Libraries
* @var Libraries
* @since 3.2.0
*/
protected Libraries $libraries;
/**
* Compiler Dynamic Get Data
* The Data Class.
*
* @var Dynamicget
* @var Dynamicget
* @since 3.2.0
*/
protected Dynamicget $dynamic;
protected Dynamicget $dynamicget;
/**
* Database object to query local DB
* The Data Class.
*
* @var \JDatabaseDriver
* @var Templatelayout
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
*/
protected Templatelayout $templatelayout;
/**
* Constructor
* Constructor.
*
* @param Config|null $config The compiler config object.
* @param Customcode|null $customcode The compiler customcode object.
* @param Gui|null $gui The compiler customcode gui.
* @param Placeholder|null $placeholder The compiler placeholder object.
* @param Language|null $language The compiler Language object.
* @param Field|null $field The compiler field data object.
* @param FieldName|null $fieldName The compiler field name object.
* @param Filesfolders|null $filesFolders The compiler files folders object.
* @param Libraries|null $libraries The compiler libraries model object.
* @param Dynamicget|null $dynamic The compiler dynamic get data object.
* @param Config $config The Config Class.
* @param Customcode $customcode The Customcode Class.
* @param Gui $gui The Gui Class.
* @param Placeholder $placeholder The Placeholder Class.
* @param Language $language The Language Class.
* @param Field $field The Field Class.
* @param Fieldname $fieldname The Name Class.
* @param Filesfolders $filesfolders The Filesfolders Class.
* @param Libraries $libraries The Libraries Class.
* @param Dynamicget $dynamicget The Data Class.
* @param Templatelayout $templatelayout The Data Class.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Customcode $customcode = null,
?Gui $gui = null, ?Placeholder $placeholder = null,
?Language $language = null, ?Field $field = null, ?FieldName $fieldName = null,
?Filesfolders $filesFolders = null, ?Libraries $libraries = null,
?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null)
public function __construct(Config $config, Customcode $customcode, Gui $gui,
Placeholder $placeholder, Language $language,
Field $field, Fieldname $fieldname,
Filesfolders $filesfolders, Libraries $libraries,
Dynamicget $dynamicget, Templatelayout $templatelayout,
?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->customcode = $customcode ?: Compiler::_('Customcode');
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
$this->language = $language ?: Compiler::_('Language');
$this->field = $field ?: Compiler::_('Field');
$this->fieldName = $fieldName ?: Compiler::_('Field.Name');
$this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders');
$this->libraries = $libraries ?: Compiler::_('Model.Libraries');
$this->dynamic = $dynamic ?: Compiler::_('Dynamicget.Data');
$this->config = $config;
$this->customcode = $customcode;
$this->gui = $gui;
$this->placeholder = $placeholder;
$this->language = $language;
$this->field = $field;
$this->fieldname = $fieldname;
$this->filesfolders = $filesfolders;
$this->libraries = $libraries;
$this->dynamicget = $dynamicget;
$this->templatelayout = $templatelayout;
$this->db = $db ?: Factory::getDbo();
}
@ -520,6 +523,11 @@ class Data
),
$guiMapper
);
// check if we have template or layouts to load
$this->templatelayout->set(
$module->mod_code , $module->code_name
);
}
else
{
@ -570,6 +578,11 @@ class Data
),
$guiMapper
);
// check if we have template or layouts to load
$this->templatelayout->set(
$module->default , $module->code_name
);
}
else
{
@ -760,7 +773,7 @@ class Data
foreach ($form['fields'] as $field)
{
// so first we lock the field name in
$this->fieldName->get(
$this->fieldname->get(
$field, $module->key, $unique
);
// add the fields to the global form file builder
@ -787,7 +800,7 @@ class Data
foreach ($form['fields'] as $field)
{
// so first we lock the field name in
$this->fieldName->get(
$this->fieldname->get(
$field, $module->key, $unique
);
// add the fields to the config builder
@ -807,7 +820,7 @@ class Data
unset($module->fields);
// set files and folders
$this->filesFolders->set($module);
$this->filesfolders->set($module);
// set libraries
$this->libraries->set($module->code_name, $module);
@ -920,7 +933,7 @@ class Data
else
{
$module->{$server} = 0;
// only change this for sales server (update server can be added loacaly to the zip file)
// only change this for sales server (update server can be added locally to the zip file)
if ('sales_server' === $server)
{
$module->{'add_' . $server} = 0;
@ -951,7 +964,6 @@ class Data
}
return false;
}
}
}

View File

@ -7,126 +7,129 @@
protected array $data = [];
/**
* Compiler Config
* The Config Class.
*
* @var Config
* @var Config
* @since 3.2.0
*/
protected Config $config;
/**
* Compiler Customcode
* The Customcode Class.
*
* @var Customcode
* @var Customcode
* @since 3.2.0
*/
protected Customcode $customcode;
/**
* Compiler Customcode in Gui
* The Gui Class.
*
* @var Gui
* @var Gui
* @since 3.2.0
**/
*/
protected Gui $gui;
/**
* Compiler Placeholder
* The Placeholder Class.
*
* @var Placeholder
* @var Placeholder
* @since 3.2.0
**/
*/
protected Placeholder $placeholder;
/**
* Compiler Language
* The Language Class.
*
* @var Language
* @var Language
* @since 3.2.0
**/
*/
protected Language $language;
/**
* Compiler Field
* The Field Class.
*
* @var Field
* @var Field
* @since 3.2.0
*/
protected Field $field;
/**
* Compiler field name
* The Name Class.
*
* @var FieldName
* @var Fieldname
* @since 3.2.0
*/
protected FieldName $fieldName;
protected Fieldname $fieldname;
/**
* Compiler Files Folders
* The Filesfolders Class.
*
* @var Filesfolders
* @var Filesfolders
* @since 3.2.0
*/
protected Filesfolders $filesFolders;
protected Filesfolders $filesfolders;
/**
* Compiler Libraries Model
* The Libraries Class.
*
* @var Libraries
* @var Libraries
* @since 3.2.0
*/
protected Libraries $libraries;
/**
* Compiler Dynamic Get Data
* The Data Class.
*
* @var Dynamicget
* @var Dynamicget
* @since 3.2.0
*/
protected Dynamicget $dynamic;
protected Dynamicget $dynamicget;
/**
* Database object to query local DB
* The Data Class.
*
* @var \JDatabaseDriver
* @var Templatelayout
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
*/
protected Templatelayout $templatelayout;
/**
* Constructor
* Constructor.
*
* @param Config|null $config The compiler config object.
* @param Customcode|null $customcode The compiler customcode object.
* @param Gui|null $gui The compiler customcode gui.
* @param Placeholder|null $placeholder The compiler placeholder object.
* @param Language|null $language The compiler Language object.
* @param Field|null $field The compiler field data object.
* @param FieldName|null $fieldName The compiler field name object.
* @param Filesfolders|null $filesFolders The compiler files folders object.
* @param Libraries|null $libraries The compiler libraries model object.
* @param Dynamicget|null $dynamic The compiler dynamic get data object.
* @param Config $config The Config Class.
* @param Customcode $customcode The Customcode Class.
* @param Gui $gui The Gui Class.
* @param Placeholder $placeholder The Placeholder Class.
* @param Language $language The Language Class.
* @param Field $field The Field Class.
* @param Fieldname $fieldname The Name Class.
* @param Filesfolders $filesfolders The Filesfolders Class.
* @param Libraries $libraries The Libraries Class.
* @param Dynamicget $dynamicget The Data Class.
* @param Templatelayout $templatelayout The Data Class.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Customcode $customcode = null,
?Gui $gui = null, ?Placeholder $placeholder = null,
?Language $language = null, ?Field $field = null, ?FieldName $fieldName = null,
?Filesfolders $filesFolders = null, ?Libraries $libraries = null,
?Dynamicget $dynamic = null, ?\JDatabaseDriver $db = null)
public function __construct(Config $config, Customcode $customcode, Gui $gui,
Placeholder $placeholder, Language $language,
Field $field, Fieldname $fieldname,
Filesfolders $filesfolders, Libraries $libraries,
Dynamicget $dynamicget, Templatelayout $templatelayout,
?\JDatabaseDriver $db = null)
{
$this->config = $config ?: Compiler::_('Config');
$this->customcode = $customcode ?: Compiler::_('Customcode');
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
$this->language = $language ?: Compiler::_('Language');
$this->field = $field ?: Compiler::_('Field');
$this->fieldName = $fieldName ?: Compiler::_('Field.Name');
$this->filesFolders = $filesFolders ?: Compiler::_('Model.Filesfolders');
$this->libraries = $libraries ?: Compiler::_('Model.Libraries');
$this->dynamic = $dynamic ?: Compiler::_('Dynamicget.Data');
$this->config = $config;
$this->customcode = $customcode;
$this->gui = $gui;
$this->placeholder = $placeholder;
$this->language = $language;
$this->field = $field;
$this->fieldname = $fieldname;
$this->filesfolders = $filesfolders;
$this->libraries = $libraries;
$this->dynamicget = $dynamicget;
$this->templatelayout = $templatelayout;
$this->db = $db ?: Factory::getDbo();
}
@ -479,6 +482,11 @@
),
$guiMapper
);
// check if we have template or layouts to load
$this->templatelayout->set(
$module->mod_code , $module->code_name
);
}
else
{
@ -529,6 +537,11 @@
),
$guiMapper
);
// check if we have template or layouts to load
$this->templatelayout->set(
$module->default , $module->code_name
);
}
else
{
@ -719,7 +732,7 @@
foreach ($form['fields'] as $field)
{
// so first we lock the field name in
$this->fieldName->get(
$this->fieldname->get(
$field, $module->key, $unique
);
// add the fields to the global form file builder
@ -746,7 +759,7 @@
foreach ($form['fields'] as $field)
{
// so first we lock the field name in
$this->fieldName->get(
$this->fieldname->get(
$field, $module->key, $unique
);
// add the fields to the config builder
@ -766,7 +779,7 @@
unset($module->fields);
// set files and folders
$this->filesFolders->set($module);
$this->filesfolders->set($module);
// set libraries
$this->libraries->set($module->code_name, $module);
@ -879,7 +892,7 @@
else
{
$module->{$server} = 0;
// only change this for sales server (update server can be added loacaly to the zip file)
// only change this for sales server (update server can be added locally to the zip file)
if ('sales_server' === $server)
{
$module->{'add_' . $server} = 0;
@ -910,4 +923,4 @@
}
return false;
}
}

View File

@ -11,49 +11,49 @@
"type": "class",
"use_selection": {
"use_selection0": {
"use": "d910d8b8-4c23-4f3e-8cda-438f2d2bd7ac",
"as": "Compiler"
},
"use_selection1": {
"use": "fa4bf18e-301e-42e3-91fb-6e0096c07adc",
"as": "default"
},
"use_selection2": {
"use_selection1": {
"use": "313b43c4-98c3-4f62-9177-2d73ec8eba31",
"as": "default"
},
"use_selection3": {
"use_selection2": {
"use": "1bd48df2-4f7e-4581-9fe9-4b54e59105e3",
"as": "default"
},
"use_selection4": {
"use_selection3": {
"use": "06453ada-e370-49f0-b262-e3f5a8ed0c2c",
"as": "default"
},
"use_selection5": {
"use_selection4": {
"use": "8eee7df5-2775-41a9-9372-c46c5939a252",
"as": "default"
},
"use_selection6": {
"use_selection5": {
"use": "d7ba2d5d-10b6-470d-978d-9f91ea65ee75",
"as": "default"
},
"use_selection7": {
"use_selection6": {
"use": "9387215f-a965-4421-acf3-5e8f9d11382f",
"as": "FieldName"
"as": "Fieldname"
},
"use_selection8": {
"use_selection7": {
"use": "f4578c04-a81e-4218-b80d-b0612196eaf0",
"as": "default"
},
"use_selection9": {
"use_selection8": {
"use": "59895f37-50c8-4af3-9dad-230e18841953",
"as": "default"
},
"use_selection10": {
"use_selection9": {
"use": "05c49a1f-ba5b-4be1-b3d0-4a74c42f7a46",
"as": "Dynamicget"
},
"use_selection10": {
"use": "39ea8150-f124-4e47-909d-641bf1c96d5e",
"as": "Templatelayout"
},
"use_selection11": {
"use": "0a59c65c-9daf-4bc9-baf4-e063ff9e6a8a",
"as": "default"

View File

@ -18,6 +18,8 @@ class Config #Gold {
# getAddcustomgiteaurl() : int
# getCustomgiteaurl() : ?string
# getCustomgiteatoken() : ?string
# getSuperpowerscoreorganisation() : string
# getSuperpowerscorerepos() : array
# getAddcontributors() : bool
# getAddajax() : bool
# getAddsiteajax() : bool
@ -118,6 +120,20 @@ note right of Config::getCustomgiteatoken
return: ?string
end note
note left of Config::getSuperpowerscoreorganisation
Get super power core organisation
since: 3.2.0
return: string
end note
note right of Config::getSuperpowerscorerepos
Get super power core repos
since: 3.2.0
return: array
end note
note left of Config::getAddcontributors
get add contributors switch

View File

@ -111,6 +111,73 @@ class Config extends BaseConfig
return null;
}
/**
* Get super power core organisation
*
* @return string The super power core organisation
* @since 3.2.0
*/
protected function getSuperpowerscoreorganisation(): string
{
// the VDM default organisation is [joomla]
$organisation = 'joomla';
if ($this->add_custom_gitea_url == 2)
{
return $this->params->get('super_powers_core_organisation', $organisation);
}
return $organisation;
}
/**
* Get super power core repos
*
* @return array The core repositories on Gitea
* @since 3.2.0
*/
protected function getSuperpowerscorerepos(): array
{
// some defaults repos we need by JCB
$repos = [];
// only add custom init with custom gitea
$paths = null;
if ($this->add_custom_gitea_url == 2)
{
$paths = $this->params->get('super_powers_core_repos');
}
if (!empty($paths) && is_array($paths))
{
foreach ($paths as $path)
{
$owner = $path->owner ?? null;
$repo = $path->repo ?? null;
if ($owner !== null && $repo !== null)
{
// we make sure to get only the objects
$repos = ["{$owner}.{$repo}" => $path] + $repos;
}
}
}
else
{
$repos[$this->super_powers_core_organisation . '.super-powers'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'super-powers', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.jcb-compiler'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'jcb-compiler', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.jcb-packager'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'jcb-packager', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.phpseclib'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'phpseclib', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.search'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'search', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.gitea'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'gitea', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.openai'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'openai', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.minify'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'minify', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.psr'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'psr', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.fof'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'fof', 'branch' => 'master'];
}
return $repos;
}
/**
* get add contributors switch
*
@ -630,20 +697,11 @@ class Config extends BaseConfig
protected function getApprovedpaths(): array
{
// some defaults repos we need by JCB
$approved = [];
$approved['joomla.super-powers'] = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
$approved['joomla.jcb-compiler'] = (object) ['owner' => 'joomla', 'repo' => 'jcb-compiler', 'branch' => 'master'];
$approved['joomla.phpseclib'] = (object) ['owner' => 'joomla', 'repo' => 'phpseclib', 'branch' => 'master'];
$approved['joomla.search'] = (object) ['owner' => 'joomla', 'repo' => 'search', 'branch' => 'master'];
$approved['joomla.gitea'] = (object) ['owner' => 'joomla', 'repo' => 'gitea', 'branch' => 'master'];
$approved['joomla.openai'] = (object) ['owner' => 'joomla', 'repo' => 'openai', 'branch' => 'master'];
$approved['joomla.minify'] = (object) ['owner' => 'joomla', 'repo' => 'minify', 'branch' => 'master'];
$approved['joomla.psr'] = (object) ['owner' => 'joomla', 'repo' => 'psr', 'branch' => 'master'];
$approved['joomla.fof'] = (object) ['owner' => 'joomla', 'repo' => 'fof', 'branch' => 'master'];
$approved = $this->super_powers_core_repos;
if (!$this->add_own_powers)
{
return $approved;
return array_values($approved);
}
$paths = $this->params->get('approved_paths');
@ -762,6 +820,7 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('add_placeholders', 2, 'INT');
// get global value
if ($value > 1)
{
@ -780,6 +839,7 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('powers', 2, 'INT');
// get global value
if ($value > 1)
{
@ -945,7 +1005,6 @@ class Config extends BaseConfig
protected function getFootableversion(): int
{
return 2; // default is version 2
}
}
}

View File

@ -77,6 +77,73 @@
return null;
}
/**
* Get super power core organisation
*
* @return string The super power core organisation
* @since 3.2.0
*/
protected function getSuperpowerscoreorganisation(): string
{
// the VDM default organisation is [joomla]
$organisation = 'joomla';
if ($this->add_custom_gitea_url == 2)
{
return $this->params->get('super_powers_core_organisation', $organisation);
}
return $organisation;
}
/**
* Get super power core repos
*
* @return array The core repositories on Gitea
* @since 3.2.0
*/
protected function getSuperpowerscorerepos(): array
{
// some defaults repos we need by JCB
$repos = [];
// only add custom init with custom gitea
$paths = null;
if ($this->add_custom_gitea_url == 2)
{
$paths = $this->params->get('super_powers_core_repos');
}
if (!empty($paths) && is_array($paths))
{
foreach ($paths as $path)
{
$owner = $path->owner ?? null;
$repo = $path->repo ?? null;
if ($owner !== null && $repo !== null)
{
// we make sure to get only the objects
$repos = ["{$owner}.{$repo}" => $path] + $repos;
}
}
}
else
{
$repos[$this->super_powers_core_organisation . '.super-powers'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'super-powers', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.jcb-compiler'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'jcb-compiler', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.jcb-packager'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'jcb-packager', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.phpseclib'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'phpseclib', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.search'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'search', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.gitea'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'gitea', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.openai'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'openai', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.minify'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'minify', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.psr'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'psr', 'branch' => 'master'];
$repos[$this->super_powers_core_organisation . '.fof'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'fof', 'branch' => 'master'];
}
return $repos;
}
/**
* get add contributors switch
*
@ -596,20 +663,11 @@
protected function getApprovedpaths(): array
{
// some defaults repos we need by JCB
$approved = [];
$approved['joomla.super-powers'] = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
$approved['joomla.jcb-compiler'] = (object) ['owner' => 'joomla', 'repo' => 'jcb-compiler', 'branch' => 'master'];
$approved['joomla.phpseclib'] = (object) ['owner' => 'joomla', 'repo' => 'phpseclib', 'branch' => 'master'];
$approved['joomla.search'] = (object) ['owner' => 'joomla', 'repo' => 'search', 'branch' => 'master'];
$approved['joomla.gitea'] = (object) ['owner' => 'joomla', 'repo' => 'gitea', 'branch' => 'master'];
$approved['joomla.openai'] = (object) ['owner' => 'joomla', 'repo' => 'openai', 'branch' => 'master'];
$approved['joomla.minify'] = (object) ['owner' => 'joomla', 'repo' => 'minify', 'branch' => 'master'];
$approved['joomla.psr'] = (object) ['owner' => 'joomla', 'repo' => 'psr', 'branch' => 'master'];
$approved['joomla.fof'] = (object) ['owner' => 'joomla', 'repo' => 'fof', 'branch' => 'master'];
$approved = $this->super_powers_core_repos;
if (!$this->add_own_powers)
{
return $approved;
return array_values($approved);
}
$paths = $this->params->get('approved_paths');
@ -728,6 +786,7 @@
{
// get posted value
$value = $this->input->post->get('add_placeholders', 2, 'INT');
// get global value
if ($value > 1)
{
@ -746,6 +805,7 @@
{
// get posted value
$value = $this->input->post->get('powers', 2, 'INT');
// get global value
if ($value > 1)
{
@ -911,4 +971,4 @@
protected function getFootableversion(): int
{
return 2; // default is version 2
}
}