update 2024-03-14

This commit is contained in:
Robot 2024-03-14 14:31:34 +02:00
parent 0c664e2d5a
commit 0f50f40925
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
8 changed files with 263 additions and 146 deletions

View File

@ -75,9 +75,9 @@ abstract class FormHelper
// element was not returned // element was not returned
return; return;
} }
switch (get_class($node))
if ($node instanceof \stdClass)
{ {
case 'stdClass':
if (property_exists($node, 'comment')) if (property_exists($node, 'comment'))
{ {
self::comment($xml, $node->comment); self::comment($xml, $node->comment);
@ -86,13 +86,13 @@ abstract class FormHelper
{ {
self::append($xml, $node->fieldXML); self::append($xml, $node->fieldXML);
} }
break; }
case 'SimpleXMLElement': elseif ($node instanceof \SimpleXMLElement)
{
$domXML = \dom_import_simplexml($xml); $domXML = \dom_import_simplexml($xml);
$domNode = \dom_import_simplexml($node); $domNode = \dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true)); $domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = \simplexml_import_dom($domXML); $xml = \simplexml_import_dom($domXML);
break;
} }
} }
@ -127,7 +127,7 @@ abstract class FormHelper
{ {
foreach ($attributes as $key => $value) foreach ($attributes as $key => $value)
{ {
$xml->addAttribute($key, $value); $xml->addAttribute($key, $value ?? '');
} }
} }
@ -145,7 +145,7 @@ abstract class FormHelper
foreach ($options as $key => $value) foreach ($options as $key => $value)
{ {
$addOption = $xml->addChild('option'); $addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key); $addOption->addAttribute('value', $key ?? '');
$addOption[] = $value; $addOption[] = $value;
} }
} }

View File

@ -50,9 +50,9 @@
// element was not returned // element was not returned
return; return;
} }
switch (get_class($node))
if ($node instanceof \stdClass)
{ {
case 'stdClass':
if (property_exists($node, 'comment')) if (property_exists($node, 'comment'))
{ {
self::comment($xml, $node->comment); self::comment($xml, $node->comment);
@ -61,13 +61,13 @@
{ {
self::append($xml, $node->fieldXML); self::append($xml, $node->fieldXML);
} }
break; }
case 'SimpleXMLElement': elseif ($node instanceof \SimpleXMLElement)
{
$domXML = \dom_import_simplexml($xml); $domXML = \dom_import_simplexml($xml);
$domNode = \dom_import_simplexml($node); $domNode = \dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true)); $domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = \simplexml_import_dom($domXML); $xml = \simplexml_import_dom($domXML);
break;
} }
} }
@ -102,7 +102,7 @@
{ {
foreach ($attributes as $key => $value) foreach ($attributes as $key => $value)
{ {
$xml->addAttribute($key, $value); $xml->addAttribute($key, $value ?? '');
} }
} }
@ -120,7 +120,7 @@
foreach ($options as $key => $value) foreach ($options as $key => $value)
{ {
$addOption = $xml->addChild('option'); $addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key); $addOption->addAttribute('value', $key ?? '');
$addOption[] = $value; $addOption[] = $value;
} }
} }

View File

@ -12,12 +12,13 @@
@startuml @startuml
abstract Helper #Orange { abstract Helper #Orange {
+ {static} getParams(?string $option = null) : Registry + {static} getParams(?string $option = null) : Registry
+ {static} getOption(string $default = 'empty') : ?string + {static} setOption(?string $option) : void
+ {static} getOption(?string $default = 'empty') : ?string
+ {static} getCode(?string $option = null, ?string $default = null) : ?string + {static} getCode(?string $option = null, ?string $default = null) : ?string
+ {static} get(string $option = null, string $default = null) : ?string + {static} get(?string $option = null, ?string $default = null) : ?string
+ {static} getNamespace(?string $option = null) : ?string + {static} getNamespace(?string $option = null) : ?string
+ {static} getManifest(?string $option = null) : ?object + {static} getManifest(?string $option = null) : ?object
+ {static} methodExists(string $method, string $option = null) : bool + {static} methodExists(string $method, ?string $option = null) : bool
+ {static} _(string $method, array $arguments = [], ...) : mixed + {static} _(string $method, array $arguments = [], ...) : mixed
} }
@ -28,49 +29,56 @@ note right of Helper::getParams
return: Registry return: Registry
end note end note
note left of Helper::getOption note left of Helper::setOption
Gets the component option Set the component option
since: 3.2.0
return: void
end note
note right of Helper::getOption
Get the component option
since: 3.0.11 since: 3.0.11
return: ?string return: ?string
end note end note
note right of Helper::getCode note left of Helper::getCode
Gets the component code name Gets the component code name
since: 3.0.11 since: 3.0.11
return: ?string return: ?string
end note end note
note left of Helper::get note right of Helper::get
Gets the component abstract helper class Gets the component abstract helper class
since: 3.0.11 since: 3.0.11
return: ?string return: ?string
end note end note
note right of Helper::getNamespace note left of Helper::getNamespace
Gets the component namespace if set Gets the component namespace if set
since: 3.0.11 since: 3.0.11
return: ?string return: ?string
end note end note
note left of Helper::getManifest note right of Helper::getManifest
Gets the component abstract helper class Gets the component abstract helper class
since: 3.0.11 since: 3.0.11
return: ?object return: ?object
end note end note
note right of Helper::methodExists note left of Helper::methodExists
Check if the helper class of this component has a method Check if the helper class of this component has a method
since: 3.0.11 since: 3.0.11
return: bool return: bool
end note end note
note left of Helper::_ note right of Helper::_
Check if the helper class of this component has a method, and call it with the arguments Check if the helper class of this component has a method, and call it with the arguments
since: 3.2.0 since: 3.2.0

View File

@ -77,14 +77,27 @@ abstract class Helper
} }
/** /**
* Gets the component option * Set the component option
*
* @param string|null $option The option
*
* @return void
* @since 3.2.0
*/
public static function setOption(?string $option): void
{
self::$option = $option;
}
/**
* Get the component option
* *
* @param string|null $default The default return value if none is found * @param string|null $default The default return value if none is found
* *
* @return string|null A component option * @return string|null A component option
* @since 3.0.11 * @since 3.0.11
*/ */
public static function getOption(string $default = 'empty'): ?string public static function getOption(?string $default = 'empty'): ?string
{ {
if (empty(self::$option)) if (empty(self::$option))
{ {
@ -147,7 +160,7 @@ abstract class Helper
* *
* @since 3.0.11 * @since 3.0.11
*/ */
public static function get(string $option = null, string $default = null): ?string public static function get(?string $option = null, ?string $default = null): ?string
{ {
// check that we have an option // check that we have an option
// and get the code name from it // and get the code name from it
@ -247,7 +260,7 @@ abstract class Helper
* *
* @since 3.0.11 * @since 3.0.11
*/ */
public static function methodExists(string $method, string $option = null): bool public static function methodExists(string $method, ?string $option = null): bool
{ {
// get the helper class // get the helper class
return ($helper = self::get($option, null)) !== null && return ($helper = self::get($option, null)) !== null &&

View File

@ -49,14 +49,27 @@
} }
/** /**
* Gets the component option * Set the component option
*
* @param string|null $option The option
*
* @return void
* @since 3.2.0
*/
public static function setOption(?string $option): void
{
self::$option = $option;
}
/**
* Get the component option
* *
* @param string|null $default The default return value if none is found * @param string|null $default The default return value if none is found
* *
* @return string|null A component option * @return string|null A component option
* @since 3.0.11 * @since 3.0.11
*/ */
public static function getOption(string $default = 'empty'): ?string public static function getOption(?string $default = 'empty'): ?string
{ {
if (empty(self::$option)) if (empty(self::$option))
{ {
@ -119,7 +132,7 @@
* *
* @since 3.0.11 * @since 3.0.11
*/ */
public static function get(string $option = null, string $default = null): ?string public static function get(?string $option = null, ?string $default = null): ?string
{ {
// check that we have an option // check that we have an option
// and get the code name from it // and get the code name from it
@ -219,7 +232,7 @@
* *
* @since 3.0.11 * @since 3.0.11
*/ */
public static function methodExists(string $method, string $option = null): bool public static function methodExists(string $method, ?string $option = null): bool
{ {
// get the helper class // get the helper class
return ($helper = self::get($option, null)) !== null && return ($helper = self::get($option, null)) !== null &&

View File

@ -67,23 +67,14 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'debug_linenr' => [ 'buildcompsql' => [
'name' => 'debug_linenr', 'name' => 'buildcompsql',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL',
'type' => 'radio', 'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_site_event' => [
'name' => 'php_site_event',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL',
'type' => 'editor',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'Libs & Helpers', 'tab_name' => 'Dynamic Build (beta)',
], ],
'translation_tool' => [ 'translation_tool' => [
'name' => 'translation_tool', 'name' => 'translation_tool',
@ -94,15 +85,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Dynamic Integration', 'tab_name' => 'Dynamic Integration',
], ],
'buildcompsql' => [
'name' => 'buildcompsql',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL',
'type' => 'textarea',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dynamic Build (beta)',
],
'add_sales_server' => [ 'add_sales_server' => [
'name' => 'add_sales_server', 'name' => 'add_sales_server',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL',
@ -112,18 +94,18 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Dynamic Integration', 'tab_name' => 'Dynamic Integration',
], ],
'php_preflight_install' => [ 'php_method_uninstall' => [
'name' => 'php_preflight_install', 'name' => 'php_method_uninstall',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL',
'type' => 'editor', 'type' => 'editor',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'Dash & Install', 'tab_name' => 'Dash & Install',
], ],
'php_method_uninstall' => [ 'php_preflight_install' => [
'name' => 'php_method_uninstall', 'name' => 'php_preflight_install',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL',
'type' => 'editor', 'type' => 'editor',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
@ -166,6 +148,24 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'debug_linenr' => [
'name' => 'debug_linenr',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_site_event' => [
'name' => 'php_site_event',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'description' => [ 'description' => [
'name' => 'description', 'name' => 'description',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL',
@ -175,6 +175,15 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'author' => [
'name' => 'author',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL',
'type' => 'text',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_postflight_install' => [ 'php_postflight_install' => [
'name' => 'php_postflight_install', 'name' => 'php_postflight_install',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL',
@ -184,9 +193,9 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'Dash & Install', 'tab_name' => 'Dash & Install',
], ],
'author' => [ 'email' => [
'name' => 'author', 'name' => 'email',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL',
'type' => 'text', 'type' => 'text',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
@ -202,19 +211,19 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'MySQL', 'tab_name' => 'MySQL',
], ],
'email' => [ 'website' => [
'name' => 'email', 'name' => 'website',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL',
'type' => 'text', 'type' => 'url',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'website' => [ 'add_license' => [
'name' => 'website', 'name' => 'add_license',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL',
'type' => 'url', 'type' => 'radio',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => NULL, 'store' => NULL,
@ -256,10 +265,10 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'Libs & Helpers', 'tab_name' => 'Libs & Helpers',
], ],
'add_license' => [ 'license_type' => [
'name' => 'add_license', 'name' => 'license_type',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL',
'type' => 'radio', 'type' => 'list',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => NULL, 'store' => NULL,
@ -283,15 +292,6 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'Libs & Helpers', 'tab_name' => 'Libs & Helpers',
], ],
'license_type' => [
'name' => 'license_type',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL',
'type' => 'list',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'php_helper_site' => [ 'php_helper_site' => [
'name' => 'php_helper_site', 'name' => 'php_helper_site',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL',
@ -301,15 +301,6 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'Libs & Helpers', 'tab_name' => 'Libs & Helpers',
], ],
'javascript' => [
'name' => 'javascript',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'whmcs_key' => [ 'whmcs_key' => [
'name' => 'whmcs_key', 'name' => 'whmcs_key',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_LABEL',
@ -319,9 +310,9 @@ class Table extends BaseTable implements Tableinterface
'store' => 'basic_encryption', 'store' => 'basic_encryption',
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'css_site' => [ 'javascript' => [
'name' => 'css_site', 'name' => 'javascript',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL',
'type' => 'editor', 'type' => 'editor',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
@ -337,6 +328,15 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'css_site' => [
'name' => 'css_site',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Libs & Helpers',
],
'whmcs_buy_link' => [ 'whmcs_buy_link' => [
'name' => 'whmcs_buy_link', 'name' => 'whmcs_buy_link',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_LABEL',
@ -346,15 +346,6 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'php_preflight_update' => [
'name' => 'php_preflight_update',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'license' => [ 'license' => [
'name' => 'license', 'name' => 'license',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL',
@ -364,9 +355,9 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'php_postflight_update' => [ 'php_preflight_update' => [
'name' => 'php_postflight_update', 'name' => 'php_preflight_update',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL',
'type' => 'editor', 'type' => 'editor',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
@ -382,6 +373,24 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Details', 'tab_name' => 'Details',
], ],
'php_postflight_update' => [
'name' => 'php_postflight_update',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'joomla_components',
'store' => 'base64',
'tab_name' => 'Dash & Install',
],
'image' => [
'name' => 'image',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL',
'type' => 'media',
'title' => false,
'list' => 'joomla_components',
'store' => NULL,
'tab_name' => 'Details',
],
'sql' => [ 'sql' => [
'name' => 'sql', 'name' => 'sql',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_LABEL',
@ -391,10 +400,10 @@ class Table extends BaseTable implements Tableinterface
'store' => 'base64', 'store' => 'base64',
'tab_name' => 'MySQL', 'tab_name' => 'MySQL',
], ],
'image' => [ 'copyright' => [
'name' => 'image', 'name' => 'copyright',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL',
'type' => 'media', 'type' => 'textarea',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => NULL, 'store' => NULL,
@ -409,10 +418,10 @@ class Table extends BaseTable implements Tableinterface
'store' => NULL, 'store' => NULL,
'tab_name' => 'Readme', 'tab_name' => 'Readme',
], ],
'copyright' => [ 'preferred_joomla_version' => [
'name' => 'copyright', 'name' => 'preferred_joomla_version',
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL',
'type' => 'textarea', 'type' => 'number',
'title' => false, 'title' => false,
'list' => 'joomla_components', 'list' => 'joomla_components',
'store' => NULL, 'store' => NULL,
@ -5145,6 +5154,80 @@ class Table extends BaseTable implements Tableinterface
'tab_name' => 'Menus', 'tab_name' => 'Menus',
], ],
], ],
'component_router' => [
'joomla_component' => [
'name' => 'joomla_component',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_JOOMLA_COMPONENT_LABEL',
'type' => 'joomlacomponents',
'title' => true,
'list' => 'components_routers',
'store' => NULL,
'tab_name' => 'Settings',
],
'mode_constructor_before_parent' => [
'name' => 'mode_constructor_before_parent',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_BEFORE_PARENT_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'components_routers',
'store' => NULL,
'tab_name' => 'Settings',
],
'mode_constructor_after_parent' => [
'name' => 'mode_constructor_after_parent',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_AFTER_PARENT_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'components_routers',
'store' => NULL,
'tab_name' => 'Settings',
],
'mode_methods' => [
'name' => 'mode_methods',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_METHODS_LABEL',
'type' => 'radio',
'title' => false,
'list' => 'components_routers',
'store' => NULL,
'tab_name' => 'Settings',
],
'methods_code' => [
'name' => 'methods_code',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_METHODS_CODE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'components_routers',
'store' => 'base64',
'tab_name' => 'Settings',
],
'constructor_after_parent_code' => [
'name' => 'constructor_after_parent_code',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_AFTER_PARENT_CODE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'components_routers',
'store' => 'base64',
'tab_name' => 'Settings',
],
'constructor_before_parent_manual' => [
'name' => 'constructor_before_parent_manual',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_MANUAL_LABEL',
'type' => 'subform',
'title' => false,
'list' => 'components_routers',
'store' => 'json',
'tab_name' => 'Settings',
],
'constructor_before_parent_code' => [
'name' => 'constructor_before_parent_code',
'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_CODE_LABEL',
'type' => 'editor',
'title' => false,
'list' => 'components_routers',
'store' => 'base64',
'tab_name' => 'Settings',
],
],
'component_config' => [ 'component_config' => [
'joomla_component' => [ 'joomla_component' => [
'name' => 'joomla_component', 'name' => 'joomla_component',

View File

@ -113,14 +113,14 @@ abstract class GetHelper
$where = Factory::getUser()->id; $where = Factory::getUser()->id;
} }
if(is_null($main)) if($main === null)
{ {
$main = Helper::getCode(); $main = Helper::getCode();
} }
if (!ArrayHelper::check($where) && $where > 0) if (!ArrayHelper::check($where) && $where > 0)
{ {
$where = array($where); $where = [$where];
} }
if (ArrayHelper::check($where)) if (ArrayHelper::check($where))

View File

@ -88,14 +88,14 @@
$where = Factory::getUser()->id; $where = Factory::getUser()->id;
} }
if(is_null($main)) if($main === null)
{ {
$main = Helper::getCode(); $main = Helper::getCode();
} }
if (!ArrayHelper::check($where) && $where > 0) if (!ArrayHelper::check($where) && $where > 0)
{ {
$where = array($where); $where = [$where];
} }
if (ArrayHelper::check($where)) if (ArrayHelper::check($where))