Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / ctools / ctools.module
1 <?php
2
3 /**
4  * Implements hook_theme().
5  */
6 function ctools_theme($existing, $type, $theme, $path) {
7   return [
8     'ctools_wizard_trail' => [
9       'variables' => [
10         'wizard' => NULL,
11         'cached_values' => [],
12         'trail' => [],
13         'divider' => ' » ',
14         'step' => NULL,
15       ],
16     ],
17     'ctools_wizard_trail_links' => [
18       'variables' => [
19         'wizard' => NULL,
20         'cached_values' => [],
21         'trail' => [],
22         'divider' => ' » ',
23         'step' => NULL,
24       ],
25     ],
26   ];
27 }
28
29 function template_preprocess_ctools_wizard_trail(&$variables) {
30   /** @var $wizard \Drupal\ctools\Wizard\FormWizardInterface|\Drupal\ctools\Wizard\EntityFormWizardInterface */
31   $wizard = $variables['wizard'];
32   $cached_values = $variables['cached_values'];
33   $trail = $variables['trail'];
34   $variables['step'] = $wizard->getStep($cached_values);
35   foreach ($wizard->getOperations($cached_values) as $step => $operation) {
36     $trail[$step] = !empty($operation['title']) ? $operation['title'] : '';
37   }
38   $variables['trail'] = $trail;
39 }
40
41 function template_preprocess_ctools_wizard_trail_links(&$variables) {
42   /** @var $wizard \Drupal\ctools\Wizard\FormWizardInterface|\Drupal\ctools\Wizard\EntityFormWizardInterface */
43   $wizard = $variables['wizard'];
44   $cached_values = $variables['cached_values'];
45   $trail = $variables['trail'];
46   $variables['step'] = $wizard->getStep($cached_values);
47   foreach ($wizard->getOperations($cached_values) as $step => $operation) {
48     $parameters = $wizard->getNextParameters($cached_values);
49     // Override step to be the step we want.
50     $parameters['step'] = $step;
51     $trail[$step] = [
52       'title' => !empty($operation['title']) ? $operation['title'] : '',
53       'url' => new \Drupal\Core\Url($wizard->getRouteName(), $parameters),
54     ];
55   }
56   $variables['trail'] = $trail;
57 }
58
59 function ctools_condition_info_alter(&$definitions) {
60   // If the node_type's class is unaltered, use a custom ctools implementation.
61   if (isset($definitions['node_type']) && $definitions['node_type']['class'] == 'Drupal\node\Plugin\Condition\NodeType') {
62     $definitions['node_type']['class'] = 'Drupal\ctools\Plugin\Condition\NodeType';
63   }
64 }