function system_get_module_admin_tasks

Same name in other branches
  1. 7.x modules/system/system.module \system_get_module_admin_tasks()
  2. 9 core/modules/system/system.module \system_get_module_admin_tasks()
  3. 8.9.x core/modules/system/system.module \system_get_module_admin_tasks()

Generate a list of tasks offered by a specified module.

Parameters

string $module: Module name.

string|array $module_name: The module's display name. Passing information, as provided by \Drupal::service('extension.list.module')->getExtensionInfo() is deprecated in drupal:10.2.0. Pass only $info["name"] instead.

Return value

array An array of task links.

Deprecated

in drupal:10.2.0 and is removed from drupal:11.0.0. Use the 'system.module_admin_links_helper' service with the getModuleAdminLinks() method and 'user.module_permissions_link_helper' service with the ::getModulePermissionsLink() method instead.

See also

https://www.drupal.org/node/3038972

1 call to system_get_module_admin_tasks()
SystemFunctionsLegacyTest::testSystemGetModuleAdminTasksDeprecation in core/modules/system/tests/src/Kernel/System/SystemFunctionsLegacyTest.php
Tests system_get_module_admin_tasks() deprecation.
2 string references to 'system_get_module_admin_tasks'
drupal_static_reset in core/includes/bootstrap.inc
Resets one or all centrally stored static variable(s).
SystemFunctionsLegacyTest::testSystemGetModuleAdminTasksDeprecation in core/modules/system/tests/src/Kernel/System/SystemFunctionsLegacyTest.php
Tests system_get_module_admin_tasks() deprecation.

File

core/modules/system/system.module, line 990

Code

function system_get_module_admin_tasks($module, string|array $module_name) {
    @trigger_error("system_get_module_admin_tasks() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use the 'system.module_admin_links_helper' service with the getModuleAdminLinks() method and 'user.module_permissions_link_helper' service with the ::getModulePermissionsLink() method instead. See https://www.drupal.org/node/3038972", E_USER_DEPRECATED);
    $module_admin_links = \Drupal::service('system.module_admin_links_helper')->getModuleAdminLinks($module);
    if ($module_permissions_link = \Drupal::service('user.module_permissions_link_helper')->getModulePermissionsLink($module, $module_name)) {
        $module_admin_links["user.admin_permissions.{$module}"] = $module_permissions_link;
    }
    return $module_admin_links;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.