jfu-1.0.x-dev/modules/jfu_examples/jfu_examples.module
modules/jfu_examples/jfu_examples.module
<?php
use \Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function jfu_examples_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the tecsup error page module.
case 'help.page.jfu_examples':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Allow saving JFU examples.') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function jfu_examples_theme($existing, $type, $theme, $path) {
return [
'jfu_examples_templates' => [
'template' => 'jfu-examples-templates',
'variables' => [
'values' => NULL,
'json_array' => NULL,
'components_config' => NULL,
'classes' => NULL,
],
],
];
}
/**
* Implements hook_jfu_add_components().
*/
function jfu_examples_jfu_add_components(array &$added_components) {
$added_components['example1'] = [
'image' => TRUE,
'responsive_image' => FALSE,
'allow_classes' => 0,
'allow_select_class' => 0,
'class_list' => '',
'module_name' => 'jfu_examples'
];
$added_components['example2'] = [
'image' => TRUE,
'responsive_image' => FALSE,
'allow_classes' => 0,
'allow_select_class' => 0,
'class_list' => '',
'module_name' => 'jfu_examples'
];
}
/**
* Implements hook_jfu_attached().
*/
function jfu_examples_jfu_attached(&$jfu_attached) {
$jfu_attached = 'jfu_examples/jfu_examples.jfu';
}
/**
* Implements hook_jfu_add_template().
*/
function jfu_examples_jfu_add_template(&$template) {
$template = 'jfu_examples_templates';
}