|
1 | 1 | ;;; drupal/autoinsert.el --- Drupal-mode support for `auto-insert-mode' |
2 | 2 |
|
3 | | -;; Copyright (C) 2012, 2013, 2014 Arne Jørgensen |
| 3 | +;; Copyright (C) 2012, 2013, 2014, 2015, 2016 Arne Jørgensen |
4 | 4 |
|
5 | 5 | ;; Author: Arne Jørgensen <[email protected]> |
6 | 6 | ;; Keywords: |
|
31 | 31 | (define-auto-insert '("\\.install" . "Drupal install file") 'drupal/autoinsert-insert-install-skeleton) |
32 | 32 | (define-auto-insert '("\\.test" . "Drupal test file") 'drupal/autoinsert-insert-test-skeleton) |
33 | 33 | (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) |
34 | 35 |
|
35 | 36 | (define-skeleton drupal/autoinsert-insert-info-skeleton |
36 | 37 | "Drupal info file skeleton." |
|
117 | 118 | " * @} End of \"addtogroup hooks\".\n" |
118 | 119 | " */\n") |
119 | 120 |
|
| 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 | + |
120 | 167 |
|
121 | 168 |
|
122 | 169 | (provide 'drupal/autoinsert) |
|
0 commit comments