You are here

function _rc_assets_test_view_block in Render cache 7.2

1 call to _rc_assets_test_view_block()
rc_assets_test_block_view in tests/modules/rc_assets_test/rc_assets_test.module
Implements hook_block_view().

File

tests/modules/rc_assets_test/rc_assets_test.module, line 32

Code

function _rc_assets_test_view_block($name) {
  $path = drupal_get_path('module', 'rc_assets_test');
  if ($name == 'js_css') {
    $build['#markup'] = t('Real time data: ' . microtime(TRUE));
    $build['#attached']['css'][] = $path . '/css/block-foo.css';
    $build['#attached']['js'][] = $path . '/js/block-foo.js';
    return $build;
  }
  if ($name == 'entity') {
    $node = node_load(1);
    $build = render_cache_entity_view_single('node', $node, 'rc_assets_view_mode');
    $build['#attached']['css'][] = $path . '/css/entity-outer.css';
    $build['#attached']['js'][] = $path . '/js/entity-outer.js';
    return $build;
  }
}