1 <snippets license="LGPL v3+" filetypes="PHP/PHP;PHP (HTML)" authors="Daniel Wehner" name="drupal">
3 <displayprefix></displayprefix>
5 <displaypostfix></displaypostfix>
6 <displayarguments></displayarguments>
8 * Implements hook_${hook}().
10 function ${modulename}_${hook}(${params}) {
15 <displayprefix></displayprefix>
16 <match>hook_update_N</match>
17 <displaypostfix></displaypostfix>
18 <displayarguments></displayarguments>
20 * Implements hook_update_N().
24 function ${module}_update_6${number}() {
32 <displayprefix></displayprefix>
33 <match>menu_item</match>
34 <displaypostfix></displaypostfix>
35 <displayarguments></displayarguments>
36 <fillin>$items['${path}'] = array(
37 'title' => '${title}',
38 'page callback' => '${callback}',
39 'page arguments' => array(${arguments}),
40 'access arguments' => array(${access arguments}),
44 <displayprefix></displayprefix>
46 <displaypostfix></displaypostfix>
47 <displayarguments></displayarguments>
53 <displayprefix></displayprefix>
54 <match>simpletest</match>
55 <displaypostfix></displaypostfix>
56 <displayarguments></displayarguments>
57 <fillin>class ${class} extends ${DrupalWebTestCase} {
58 public static function getInfo() {
61 'description' => '${description}',
62 'group' => '${group}',
66 public function setUp() {
67 parent::setUp(); ${cursor_0}
74 <displayprefix></displayprefix>
75 <match>simpletest_method</match>
76 <displaypostfix></displaypostfix>
77 <displayarguments></displayarguments>
78 <fillin>public function test${name}() {
83 <displayprefix></displayprefix>
85 <displaypostfix></displaypostfix>
86 <displayarguments>(cacheid, result)</displayarguments>
87 <fillin>$cache = cache_get('${cacheid}');
91 cache_set('${cacheid}', $${result}, 'cache', CACHE_TEMPORARY);
94 $${result} = $cache->data;
99 <displayprefix></displayprefix>
100 <match>hook_update_weight</match>
101 <displaypostfix></displaypostfix>
102 <displayarguments></displayarguments>
104 * Implements hook_update_N().
106 * Change weight of ${module} to ${weight}
108 function ${module}_update_6${number}() {
110 update_sql($ret, "UPDATE {system} set weight = ${weight} WHERE type = 'module' AND name = '${module}'");
116 <displayprefix></displayprefix>
117 <match>form_item</match>
118 <displaypostfix></displaypostfix>
119 <displayarguments></displayarguments>
120 <fillin> $form['${element}'] = array(
121 '#type' => '${type}',
122 '#title' => t('${title}'),
123 '#default_value' => ${default_value},
124 '#description' => t('${description}'),
128 <displayprefix></displayprefix>
130 <displaypostfix></displaypostfix>
131 <displayarguments></displayarguments>
132 <fillin>$result = db_query("${query}", ${arguments});
133 while ($item = ${db_fetch_object}($result)) {
138 <displayprefix></displayprefix>
139 <match>hook_form_alter</match>
140 <displaypostfix></displaypostfix>
141 <displayarguments></displayarguments>
143 * Implements hook_form_alter().
145 function ${modulename}_form_alter(&$form, &$form_state) {
151 <displayprefix></displayprefix>
152 <match>hook_preprocess</match>
153 <displaypostfix></displaypostfix>
154 <displayarguments></displayarguments>
156 * Implements hook_preprocess_${hook}().
160 function ${module}_preprocess_${hook}(&$vars) {