function esi_block_test_block_view in ESI: Edge Side Includes 7.3
Implements hook_block_view().
File
- modules/
esi_block/ tests/ esi_block_test.module, line 42 - Provide test esi_block_tests.
Code
function esi_block_test_block_view($delta = '') {
switch ($delta) {
case 'test1':
global $user;
return array(
'subject' => t('Test 1 - cache per user'),
'content' => t('User ID: @uid', array(
'@uid' => $user->uid,
)),
);
case 'test2':
global $user;
return array(
'subject' => t('Test 2 - cache per role'),
'content' => t('User roles: ' . implode(', ', $user->roles)),
);
case 'test3':
return array(
'subject' => t('Test 3 - cache per page'),
'content' => t('Page: @page', array(
'@page' => request_uri(),
)),
);
case 'test4':
global $user;
return array(
'subject' => t('Test 4 - cache per user per page'),
'content' => t('User ID: @uid', array(
'@uid' => $user->uid,
)) . '<br />' . t('Page: @page', array(
'@page' => request_uri(),
)),
);
case 'test5':
return array(
'subject' => t('Test 5 - cache global'),
'content' => t('This cache is global.'),
);
case 'test6':
return array(
'subject' => t('Test 6 - cache none'),
'content' => t('Random number: ' . rand(0, 100)),
);
}
}