Skip to content

Commit 9ee19e2

Browse files
committed
Add autoinsert skeleton for Variable module support
1 parent 2cca689 commit 9ee19e2

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

drupal/autoinsert.el

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; drupal/autoinsert.el --- Drupal-mode support for `auto-insert-mode'
22

3-
;; Copyright (C) 2012, 2013, 2014 Arne Jørgensen
3+
;; Copyright (C) 2012, 2013, 2014, 2015, 2016 Arne Jørgensen
44

55
;; Author: Arne Jørgensen <[email protected]>
66
;; Keywords:
@@ -31,6 +31,7 @@
3131
(define-auto-insert '("\\.install" . "Drupal install file") 'drupal/autoinsert-insert-install-skeleton)
3232
(define-auto-insert '("\\.test" . "Drupal test file") 'drupal/autoinsert-insert-test-skeleton)
3333
(define-auto-insert '("\\.api.php" . "Drupal API file") 'drupal/autoinsert-insert-api-skeleton)
34+
(define-auto-insert '("\\.variable.inc" . "Drupal variable module support file") 'drupal/autoinsert-insert-variable-module-skeleton)
3435

3536
(define-skeleton drupal/autoinsert-insert-info-skeleton
3637
"Drupal info file skeleton."
@@ -117,6 +118,52 @@
117118
" * @} End of \"addtogroup hooks\".\n"
118119
" */\n")
119120

121+
(define-skeleton drupal/autoinsert-insert-variable-module-skeleton
122+
"Drupal variable module support file."
123+
nil
124+
"<?php\n"
125+
"\n"
126+
"/**\n"
127+
" * @file\n"
128+
" * Variable module support for the " (drupal-module-name) " module.\n"
129+
" */\n"
130+
"\n"
131+
"/**\n"
132+
" * @addtogroup variables\n"
133+
" * @{\n"
134+
" */\n"
135+
"\n"
136+
"/**\n"
137+
" * Implements hook_variable_info().\n"
138+
" */\n"
139+
"function " (drupal-module-name) "_variable_info($options) {\n"
140+
" $variables['" @ - (drupal-module-name) "_some_variable'] = array(\n"
141+
" 'type' => 'string',\n"
142+
" 'title' => t('Some variable title', array(), $options),\n"
143+
" 'default' => 'uid',\n"
144+
" 'description' => t('Some variable description', array(), $options),\n"
145+
" 'group' => '" (drupal-module-name) "',\n"
146+
" );\n"
147+
"\n"
148+
" return $variables;\n"
149+
"}\n"
150+
"\n"
151+
"/**\n"
152+
" * Implements hook_variable_group_info().\n"
153+
" */\n"
154+
"function " (drupal-module-name) "_variable_group_info() {\n"
155+
" $groups['" (drupal-module-name) "'] = array(\n"
156+
" 'title' => t('Some group title'),\n"
157+
" 'description' => t('Some group description.'),\n"
158+
" );\n"
159+
"\n"
160+
" return $groups;\n"
161+
"}\n"
162+
"\n"
163+
"/**\n"
164+
" * @} End of \"addtogroup variables\".\n"
165+
" */\n")
166+
120167

121168

122169
(provide 'drupal/autoinsert)

0 commit comments

Comments
 (0)