diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 865103162b03dadfe690930a85a6bc5a5497c71b..db1ec50b41c0b85e88ba8d40667765cfc101f4ee 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -965,7 +965,7 @@ class userinfo /* Usual workflow */ $infos = objects::infos($type); $prefix = $infos['aclCategory'].'/'; - $tabs = $config->data['TABS'][$infos['tabGroup']]; + $tabs = $infos['tabClass']::getPotentialTabList($type, $infos); } foreach ($tabs as $tab) { $acls = pluglist::pluginInfos($tab['CLASS'])['plProvidedAcls']; diff --git a/include/simpleplugin/class_simpleTabs.inc b/include/simpleplugin/class_simpleTabs.inc index b841681157b851e1d1b48221b6c16c716ac314d8..1f5b5ede549ab6f1daee11bd3ed29b3a1fe363a6 100644 --- a/include/simpleplugin/class_simpleTabs.inc +++ b/include/simpleplugin/class_simpleTabs.inc @@ -136,6 +136,16 @@ class simpleTabs } } + /*! + * \brief Returns the list of tabs which may appear for a given object type + */ + public static function getPotentialTabList (string $type, array $infos): array + { + global $config; + + return $config->data['TABS'][$infos['tabGroup']]; + } + /*! * \brief Sets the active tabs from this instance to an other one. Used by templates */ diff --git a/plugins/admin/groups/tabs_ogroups.inc b/plugins/admin/groups/tabs_ogroups.inc index b36091737f998b64d5f0bab92e33fcadf5384812..f0327420a0a6e322816db2940d7074e073040ae5 100644 --- a/plugins/admin/groups/tabs_ogroups.inc +++ b/plugins/admin/groups/tabs_ogroups.inc @@ -136,6 +136,24 @@ class ogrouptabs extends simpleTabs_noSpecial return parent::gen_tabs($disabled); } + /*! + * \brief Returns the list of tabs which may appear for a given object type + */ + public static function getPotentialTabList (string $type, array $infos): array + { + global $config; + + /* prefix will be OGROUP- for ogroup */ + $tabList = parent::getPotentialTabList($type, $infos); + $prefix = strtoupper($type).'-'; + foreach ($config->data['TABS'] as $tabgroup => $tabs) { + if (strpos($tabgroup, $prefix) === 0) { + $tabList = array_merge($tabList, $tabs); + } + } + return $tabList; + } + /*! * \brief Sets the active tabs from this instance to an other one. Used by templates */