Add module.getModuleAdminScopes (after) event

This commit is contained in:
Kijin Sung 2024-10-17 21:45:17 +09:00
parent a2e5434aec
commit 64b0d97fbb
2 changed files with 17 additions and 2 deletions

View file

@ -197,6 +197,8 @@ class ModuleAdminModel extends Module
// Extract admin ID set in the current module
$admin_member = ModuleModel::getAdminId($module_srl) ?: [];
Context::set('admin_member', $admin_member);
// Get defined scopes
Context::set('manager_scopes', $this->getModuleAdminScopes());
// Get a list of groups
$group_list = MemberModel::getGroups();
Context::set('group_list', $group_list);
@ -286,6 +288,19 @@ class ModuleAdminModel extends Module
$this->add('grantList', $grantList);
}
/**
* Get defined scopes of module admin.
*
* @return array
*/
public function getModuleAdminScopes(): array
{
$obj = new \stdClass;
$obj->scopes = lang('module.admin_scopes')->getArrayCopy();
ModuleHandler::triggerCall('module.getModuleAdminScopes', 'after', $obj);
return $obj->scopes;
}
/**
* @brief Common:: skin setting page for the module
*/