Pass service to getClientTabs and getAdminTabs

by Aleksa Djordjic · 2 years ago

Currently, the getClientTabs and getAdminTabs functions only receive the $package, despite the function calling them having the $service available too.

The suggestion is to pass the $service too.

This would allow modules that have support for configurable options to do logic of displaying/hiding tabs based on the configurable options set.
Configurable options can not modify the package individually as main function that's calling the tabs fetches the package itself.

Lines to take a look at:
/components/modules/module.php - getAdminServiceTabs() - Line 1055
/components/modules/module.php - getClientServiceTabs() - Line 1079

For backwards compatibility, this could perhaps be done with a default value of null so that the functions don't require it? Ex.
public function getAdminTabs($package) becomes public function getAdminTabs($package, $service = null)

Status Timeline
Declined — Jul 24, 2024
by Jonathan Reismueller
Comments (1)
Jonathan Reismueller Staff 2 years ago

getAdminTabs() should be deprecated. It was replaced by getAdminServiceTabs() which can be implemented directly by the module. https://github.com/blesta/plugin-extension_generator/issues/62 has been created to update this in the extension generator.

2

2 voters

Status Declined
Category Modules