system_get_module_admin_tasks

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 system_get_module_admin_tasks($module)

Generate a list of tasks offered by a specified module.

Übergabeparameter

$module Module name.

Rückgabewert

An array of task links.

▾ 2 functions call system_get_module_admin_tasks()

help_page in modules/help/help.admin.inc
Menu callback; prints a page listing general help for a module.
system_admin_by_module in modules/system/system.admin.inc
Menu callback; prints a listing of admin tasks for each installed module.

Code

modules/system/system.module, line 1236

<?php
function system_get_module_admin_tasks($module) {
  static $items;

  $admin_access = user_access('administer permissions');
  $admin_tasks = array();

  if (!isset($items)) {
    $result = db_query("
       SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, ml.*
       FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path WHERE ml.link_path LIKE 'admin/%' AND hidden >= 0 AND module = 'system' AND m.number_parts > 2");
    $items = array();
    while ($item = db_fetch_array($result)) {
      _menu_link_translate($item);
      if ($item['access']) {
        $items[$item['router_path']] = $item;
      }
    }
  }
  $admin_tasks = array();
  $admin_task_count = 0;
  // Check for permissions.
  if (module_hook($module, 'perm') && $admin_access) {
    $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array('fragment' => 'module-' . $module));
  }

  // Check for menu items that are admin links.
  if ($menu = module_invoke($module, 'menu')) {
    foreach (array_keys($menu) as $path) {
      if (isset($items[$path])) {
        $admin_tasks[$items[$path]['title'] . $admin_task_count++] = l($items[$path]['title'], $path);
      }
    }
  }

  return $admin_tasks;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen