You are here

function responsive_preview_block_view in Responsive Theme Preview 7

Implements hook_block_view().

File

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

Code

function responsive_preview_block_view($delta = '') {
  $block = array();
  if ($delta = 'controls') {
    $block['subject'] = t('Device preview');
    $block['content'] = array(
      'device_options' => array(
        '#cache' => array(
          'cid' => 'responsive_preview_device_options',
          'bin' => 'cache',
        ),
        '#theme' => 'item_list',
        '#items' => responsive_preview_get_devices_list(),
        '#attributes' => array(
          'class' => array(
            'responsive-preview-options',
          ),
        ),
        '#attached' => array(
          'library' => array(
            array(
              'responsive_preview',
              'responsive-preview',
            ),
          ),
        ),
      ),
    );
  }
  return $block;
}