Drupal添加下拉到管理工具栏

时间:2015-08-27 17:31:18

标签: php drupal menu

我正在尝试向自定义模块的管理工具栏添加下拉菜单,但它没有显示。我刷新了缓存并禁用/重新编写了模块,但没有用。我正在使用Drupal 7,我的代码是:

function reporter_workbench_menu() {
    $items = array();
    $items['admin/reporter'] = array(
        'title' => 'Reporter Workbench',
        'description' => 'Main menu item which should appear on the toolbar',
        'position' => 'left',
        'weight' => -100,
        'page callback' => 'system_admin_menu_block_page',
        'file' => 'system.admin.inc',
        'file path' => drupal_get_path('module', 'system'),
    );

    $items['admin/reporter/sub-menu-1'] = array(
        'title' => 'Sub menu item 1',
        'description' => 'Child of the menu appearing in toolbar.',
        'page callback' => 'reporter_workbench_section_edit',
        'type' => MENU_NORMAL_ITEM,
    );

    $items['admin/reporter/sub-menu-2'] = array(
        'title' => 'Sub menu item 2',
        'description' => 'Child of the menu appearing in toolbar.',
        'page callback' => 'reporter_workbench_section_edit',
        'type' => MENU_NORMAL_ITEM,
    );

    return $items;
}

如何正确地将下拉项添加到管理工具栏,例如将鼠标悬停在“内容”标签上?

0 个答案:

没有答案