function toolbar_test_toolbar

Implements hook_toolbar().

File

drupal/core/modules/toolbar/tests/modules/toolbar_test/toolbar_test.module, line 11
A dummy module to test API interaction with the Toolbar module.

Code

function toolbar_test_toolbar() {
  $items['testing'] = array(
    '#type' => 'toolbar_item',
    'tab' => array(
      '#type' => 'link',
      '#title' => t('Test tab'),
      '#href' => '',
      '#options' => array(
        'html' => FALSE,
        'attributes' => array(
          'id' => 'toolbar-tab-testing',
          'title' => t('Test tab'),
        ),
      ),
    ),
    'tray' => array(
      '#wrapper_attributes' => array(
        'id' => 'toolbar-tray-testing',
      ),
      'content' => array(
        '#theme' => 'item_list',
        '#items' => array(
          l(t('link 1'), '<front>'),
          l(t('link 2'), '<front>'),
          l(t('link 3'), '<front>'),
        ),
        '#prefix' => '<h2 class="element-invisible">' . t('Test tray') . '</h2>',
        '#attributes' => array(
          'class' => array(
            'menu',
          ),
        ),
      ),
    ),
    '#weight' => 50,
  );
  return $items;
}