Requests | Blesta

Requests

Pass service to getClientTabs and getAdminTabs

Aleksa Djordjic shared this idea 1 month ago
Declined

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)

Comments (1)

photo
1

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.