You are here

function responsive_preview_navbar in Responsive Theme Preview 7

Implements hook_navbar().

File

./responsive_preview.module, line 197
Provides a component that previews the a page in various device dimensions.

Code

function responsive_preview_navbar() {
  $items['responsive_preview'] = array(
    '#type' => 'navbar_item',
    'tab' => array(
      'trigger' => array(
        '#theme' => 'html_tag',
        '#tag' => 'button',
        '#value' => t('Layout preview'),
        '#value_prefix' => '<span class="element-invisible">',
        '#value_suffix' => '</span>',
        '#attributes' => array(
          'title' => t('Preview page layout'),
          'class' => array(
            'responsive-preview-icon',
            'responsive-preview-icon-responsive-preview',
            'responsive-preview-trigger',
          ),
        ),
      ),
      'device_options' => array(
        '#theme' => 'item_list',
        '#items' => responsive_preview_get_devices_list(),
        '#attributes' => array(
          'class' => array(
            'responsive-preview-options',
            'item-list',
          ),
        ),
      ),
    ),
    '#wrapper_attributes' => array(
      'id' => 'responsive-preview-navbar-tab',
      'class' => array(
        'navbar-tab-responsive-preview',
      ),
    ),
    '#attached' => array(
      'library' => array(
        array(
          'responsive_preview',
          'responsive-preview',
        ),
      ),
    ),
    '#weight' => 200,
    '#access' => responsive_preview_access(),
  );
  return $items;
}