194892bb8917eaee5aadefc05a998e43cc590b59
[yaffs-website] / web / modules / contrib / layouter / modules / layouter_extension_example / layouter_extension_example.module
1 <?php
2 /**
3  * @file
4  * Contains hook implementations.
5  *
6  * @see hook_form_alter().
7  * @see hook_layouter_templates_info().
8  * @see hook_theme().
9  */
10
11 /**
12  * Implements hook_form_alter().
13  */
14 function layouter_extension_example_form_alter(&$form, &$form_state, $form_id) {
15   if ($form_id == 'layouter_multistep_form') {
16     $form['#attached']['library'][] = 'layouter_extension_example/css';
17   }
18 }
19
20 /**
21  * Implements hook_layouter_templates_info().
22  */
23 function layouter_extension_example_layouter_templates_info() {
24   $templates = [
25     'one_column_width_500' => [
26       'title' => t('Single column of text 500px wide'),
27       'fields' => [
28         'text' => [
29           'type' => 'text',
30           'title' => t('Your text'),
31           'description' => t('This text will be 500px wide.'),
32         ],
33       ],
34       'theme' => 'layouter_extension_example_one_column_width_500',
35     ],
36   ];
37
38   return $templates;
39 }
40
41 /**
42  * Implements hook_theme().
43  */
44 function layouter_extension_example_theme($existing, $type, $theme, $path) {
45   return [
46     'layouter_extension_example_one_column_width_500' => [
47       'variables' => ['text' => NULL],
48       'template' => 'one_column_width_500',
49     ],
50   ];
51 }