cshs.module in Client-side Hierarchical Select 8
Same filename and directory in other branches
Client-side Hierarchical Select.
File
cshs.moduleView source
<?php
/**
* @file
* Client-side Hierarchical Select.
*/
use Drupal\cshs\Element\CshsElement;
use Drupal\cshs\Plugin\views\filter\CshsTaxonomyIndexTid;
use Drupal\cshs\Plugin\views\filter\CshsTaxonomyIndexTidDepth;
/**
* Implements hook_help().
*
* @internal
*/
function cshs_help(string $route_name) : ?array {
if ($route_name === 'help.page.cshs') {
return [
'#theme' => 'cshs_help',
];
}
return NULL;
}
/**
* Implements hook_theme().
*
* @internal
*/
function cshs_theme() : array {
$info = [];
$info['cshs_help'] = [
'render element' => 'element',
];
$info[CshsElement::ID] = [
'variables' => [
'attributes' => [],
'options' => [],
],
];
$info['cshs_term_group'] = [
'variables' => [
'title' => '',
'terms' => [],
],
];
return $info;
}
/**
* Implements hook_config_schema_info_alter().
*
* @internal
*/
function cshs_config_schema_info_alter(array &$definitions) : void {
/* @noinspection AdditionOperationOnArraysInspection */
$parent = $definitions['views.filter.' . CshsTaxonomyIndexTid::ID]['mapping'] += CshsTaxonomyIndexTid::getConfigSchema();
// The `depth` plugin extends the default one and
// the `taxonomy.views.schema.yml` does not define
// the configuration the parent provides.
/* @noinspection AdditionOperationOnArraysInspection */
$definitions['views.filter.' . CshsTaxonomyIndexTidDepth::ID]['mapping'] += $parent + CshsTaxonomyIndexTidDepth::getConfigSchema();
}
Functions
Name | Description |
---|---|
cshs_config_schema_info_alter | Implements hook_config_schema_info_alter(). |
cshs_help | Implements hook_help(). |
cshs_theme | Implements hook_theme(). |