block_test.module 771 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Provide test blocks.
  5. */
  6. /**
  7. * Implements hook_system_theme_info().
  8. */
  9. function block_test_system_theme_info() {
  10. $themes['block_test_theme'] = drupal_get_path('module', 'block_test') . '/themes/block_test_theme/block_test_theme.info';
  11. return $themes;
  12. }
  13. /**
  14. * Implements hook_block_info().
  15. */
  16. function block_test_block_info() {
  17. $blocks['test_cache'] = array(
  18. 'info' => t('Test block caching'),
  19. 'cache' => variable_get('block_test_caching', DRUPAL_CACHE_PER_ROLE),
  20. );
  21. $blocks['test_html_id'] = array(
  22. 'info' => t('Test block html id'),
  23. );
  24. return $blocks;
  25. }
  26. /**
  27. * Implements hook_block_view().
  28. */
  29. function block_test_block_view($delta = 0) {
  30. return array('content' => variable_get('block_test_content', ''));
  31. }