-
Notifications
You must be signed in to change notification settings - Fork 0
/
fnord.module
75 lines (57 loc) · 1.5 KB
/
fnord.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Implementation of hook_block()
*/
function fnord_block($op = 'list', $delta = 0, $edit = array()) {
if ($op == 'list') {
$blocks[0] = array(
'info' => t('Fnord (block)'),
'weight' => 0,
'status' => 1,
'region' => 'left',
);
/* les lignes suivantes sont copiées/collées de api.drupal.org */
/* BLOCK_CACHE_PER_ROLE will be assumed for block 0. */
/** $blocks[1] = array(
* 'info' => t('Mymodule block #2 describes ...'),
* 'cache' => BLOCK_CACHE_PER_ROLE | BLOCK_CACHE_PER_PAGE,
* );
*/
return $blocks;
}
/*
else if ($op == 'configure' && $delta == 0) {
$form['items'] = array(
'#type' => 'select',
'#title' => t('Combien vous en voulez?'),
'#default_value' => variable_get('mymodule_block_items', 0),
'#options' => array('1', '2', '3'),
);
return $form;
}
*/
else if ($op == 'view') {
switch ($delta) {
case 0:
// Your module will need to define this function to render the block.
$block = array(
'subject' => t('Fnord #1'),
'content' => 'It works.', /* mymodule_display_block_1(),*/
);
return $block;
break;
}
}
/*
case 1:
// Your module will need to define this function to render the block.
$block = array(
'subject' => t('Title of block #2'),
'content' => mymodule_display_block_2(),
);
break;
}
*/
// return $block;
}
?>