Commit 4b7ae59c authored by Sergey Shadrin's avatar Sergey Shadrin

[#124455] Added modules from Drupal CMS

parent df72e05b
...@@ -109,6 +109,7 @@ ...@@ -109,6 +109,7 @@
"drupal/seckit": "^2.0", "drupal/seckit": "^2.0",
"drupal/security_review": "^3.1", "drupal/security_review": "^3.1",
"drupal/select2": "^2.0", "drupal/select2": "^2.0",
"drupal/selective_better_exposed_filters": "^3.0",
"drupal/session_limit": "^2.0", "drupal/session_limit": "^2.0",
"drupal/simple_sitemap": "^4.2", "drupal/simple_sitemap": "^4.2",
"drupal/slick": "^3.0", "drupal/slick": "^3.0",
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8c9b44d9d6adb01f8dd6b18244c7c8b0", "content-hash": "0975441ec78248f67a205677381a6fb2",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
...@@ -9061,6 +9061,55 @@ ...@@ -9061,6 +9061,55 @@
"source": "https://git.drupalcode.org/project/select2" "source": "https://git.drupalcode.org/project/select2"
} }
}, },
{
"name": "drupal/selective_better_exposed_filters",
"version": "3.0.3",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/selective_better_exposed_filters.git",
"reference": "3.0.3"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/selective_better_exposed_filters-3.0.3.zip",
"reference": "3.0.3",
"shasum": "31890e23361bf22641b2355c78c5e21c02e2e1bc"
},
"require": {
"drupal/better_exposed_filters": "^4.0 || ^5.0 || ^6.0 || ^7.0",
"drupal/core": "^8 || ^9 || ^10 || ^11"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "3.0.3",
"datestamp": "1719744192",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "stomusic",
"homepage": "https://www.drupal.org/user/3405436"
}
],
"description": "Provide extra option for better exposed filters to show only used terms in filter.",
"homepage": "https://www.drupal.org/project/selective_better_exposed_filters",
"keywords": [
"Drupal"
],
"support": {
"source": "http://cgit.drupalcode.org/selective_better_exposed_filters",
"issues": "https://www.drupal.org/project/issues/selective_better_exposed_filters"
}
},
{ {
"name": "drupal/session_limit", "name": "drupal/session_limit",
"version": "2.0.2", "version": "2.0.2",
......
# Selective Better Exposed Filters
INTRODUCTION
------------
Provide extra option for better exposed filters to show only used terms.
This module is very simple and just add a part of fuctionality of
[Views Selective Filters](https://drupal.org/project/views_selective_filters)
to Better Exposed Filters module.
Module provide checkbox "Show only used items" and work only with field based
references provided by core, but don't work with "Has taxonomy term" filter.
REQUIREMENTS
------------
This module requires the following modules:
* [Better Exposed Filters](https://drupal.org/project/better_exposed_filters)
* [For any reference support - patch from issue]
(https://www.drupal.org/project/drupal/issues/2429699)
INSTALLATION
------------
It's very easy. You need just:
- Enable module
- Change settings of Better Exposed Filter in your view as usual
### Composer
If your site is [managed via Composer](https://www.drupal.org/node/2718229),
use Composer to download the module:
```sh
composer require "drupal/selective_better_exposed_filters"
```
CONFIGURATION
-------------
The module has no menu or modifiable settings. There is no configuration. When
enabled, the module will add few options to Better Exposed Filter settings
inside the View.
MAINTAINERS
-----------
Current maintainers:
* Aleksander Riumshin (stomusic) (https://www.drupal.org/u/stomusic)
{
"name": "drupal/selective_better_exposed_filters",
"description": "Provide extra option for better exposed filters to show only used terms in filter.",
"license": "GPL-2.0+",
"type": "drupal-module",
"keywords": [
"Drupal"
],
"homepage": "https://www.drupal.org/project/selective_better_exposed_filters",
"support": {
"issues": "https://www.drupal.org/project/issues/selective_better_exposed_filters",
"source": "http://cgit.drupalcode.org/selective_better_exposed_filters"
},
"require": {
"drupal/better_exposed_filters": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"minimum-stability": "dev"
}
name: 'Selective Better Exposed Filters'
type: module
description: 'Provide extra option for better exposed filters to show only used terms in filter.'
core_version_requirement: ^8 || ^9 || ^10 || ^11
package: Views
dependencies:
- better_exposed_filters:better_exposed_filters
# Information added by Drupal.org packaging script on 2024-06-30
version: '3.0.3'
project: 'selective_better_exposed_filters'
datestamp: 1719744194
<?php
/**
* @file
* Install, update, and uninstall functions for the SBEF module.
*/
/**
* Implements hook_install().
*/
function selective_better_exposed_filters_install() {
module_set_weight('selective_better_exposed_filters', 1);
}
/**
* Change module weight.
*/
function selective_better_exposed_filters_update_8102() {
selective_better_exposed_filters_install();
}
<?php
/**
* @file
* selective_better_exposed_filters.module
*/
use Drupal\Component\Utility\Html;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function selective_better_exposed_filters_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.selective_better_exposed_filters':
$text = file_get_contents(__DIR__ . '/README.md');
return '<pre>' . Html::escape($text) . '</pre>';
}
return NULL;
}
/**
* Implements hook_config_schema_info_alter().
*/
function selective_better_exposed_filters_config_schema_info_alter(&$definitions) {
$altered_widgets = ['default', 'bef_links', 'bef'];
foreach ($altered_widgets as $altered_widget) {
if (isset($definitions["better_exposed_filters.filter.$altered_widget"])) {
$definitions["better_exposed_filters.filter.$altered_widget"]['mapping']['options_show_only_used'] = [
'type' => 'boolean',
'label' => 'Show only used items',
];
$definitions["better_exposed_filters.filter.$altered_widget"]['mapping']['options_show_only_used_filtered'] = [
'type' => 'boolean',
'label' => 'Filter items based on filtered result set',
];
$definitions["better_exposed_filters.filter.$altered_widget"]['mapping']['options_hide_when_empty'] = [
'type' => 'boolean',
'label' => 'Hide filter, if no options',
];
}
}
}
<?php
namespace Drupal\selective_better_exposed_filters\Plugin\better_exposed_filters\filter;
use Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\DefaultWidget as DefaultWidgetBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Default widget implementation.
*
* @BetterExposedFiltersFilterWidget(
* id = "default",
* label = @Translation("Default"),
* )
*/
class DefaultWidget extends DefaultWidgetBase {
/**
* {@inheritdoc}
*/
public function defaultConfiguration(): array {
return parent::defaultConfiguration() + SelectiveFilterBase::defaultConfiguration();
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array {
/** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter */
$filter = $this->handler;
$form = parent::buildConfigurationForm($form, $form_state);
$form += SelectiveFilterBase::buildConfigurationForm($filter, $this->configuration);
return $form;
}
/**
* {@inheritdoc}
*/
public function exposedFormAlter(array &$form, FormStateInterface $form_state): void {
parent::exposedFormAlter($form, $form_state);
/** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter */
$filter = $this->handler;
SelectiveFilterBase::exposedFormAlter($this->view, $filter, $this->configuration, $form, $form_state);
}
}
<?php
namespace Drupal\selective_better_exposed_filters\Plugin\better_exposed_filters\filter;
use Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\Links as LinksBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Default widget implementation.
*
* @BetterExposedFiltersFilterWidget(
* id = "bef_links",
* label = @Translation("Links"),
* )
*/
class Links extends LinksBase {
/**
* {@inheritdoc}
*/
public function defaultConfiguration(): array {
return parent::defaultConfiguration() + SelectiveFilterBase::defaultConfiguration();
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array {
/** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter */
$filter = $this->handler;
$form = parent::buildConfigurationForm($form, $form_state);
$form += SelectiveFilterBase::buildConfigurationForm($filter, $this->configuration);
return $form;
}
/**
* {@inheritdoc}
*/
public function exposedFormAlter(array &$form, FormStateInterface $form_state): void {
parent::exposedFormAlter($form, $form_state);
/** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter */
$filter = $this->handler;
SelectiveFilterBase::exposedFormAlter($this->view, $filter, $this->configuration, $form, $form_state);
}
}
<?php
namespace Drupal\selective_better_exposed_filters\Plugin\better_exposed_filters\filter;
use Drupal\better_exposed_filters\Plugin\better_exposed_filters\filter\RadioButtons as RadioButtonsBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Default widget implementation.
*
* @BetterExposedFiltersFilterWidget(
* id = "bef",
* label = @Translation("Checkboxes/Radio Buttons"),
* )
*/
class RadioButtons extends RadioButtonsBase {
/**
* {@inheritdoc}
*/
public function defaultConfiguration(): array {
return parent::defaultConfiguration() + SelectiveFilterBase::defaultConfiguration();
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state): array {
/** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter */
$filter = $this->handler;
$form = parent::buildConfigurationForm($form, $form_state);
$form += SelectiveFilterBase::buildConfigurationForm($filter, $this->configuration);
return $form;
}
/**
* {@inheritdoc}
*/
public function exposedFormAlter(array &$form, FormStateInterface $form_state): void {
parent::exposedFormAlter($form, $form_state);
/** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter */
$filter = $this->handler;
SelectiveFilterBase::exposedFormAlter($this->view, $filter, $this->configuration, $form, $form_state);
}
}
...@@ -9467,6 +9467,58 @@ ...@@ -9467,6 +9467,58 @@
}, },
"install-path": "../../modules/contrib/select2" "install-path": "../../modules/contrib/select2"
}, },
{
"name": "drupal/selective_better_exposed_filters",
"version": "3.0.3",
"version_normalized": "3.0.3.0",
"source": {
"type": "git",
"url": "https://git.drupalcode.org/project/selective_better_exposed_filters.git",
"reference": "3.0.3"
},
"dist": {
"type": "zip",
"url": "https://ftp.drupal.org/files/projects/selective_better_exposed_filters-3.0.3.zip",
"reference": "3.0.3",
"shasum": "31890e23361bf22641b2355c78c5e21c02e2e1bc"
},
"require": {
"drupal/better_exposed_filters": "^4.0 || ^5.0 || ^6.0 || ^7.0",
"drupal/core": "^8 || ^9 || ^10 || ^11"
},
"type": "drupal-module",
"extra": {
"drupal": {
"version": "3.0.3",
"datestamp": "1719744192",
"security-coverage": {
"status": "covered",
"message": "Covered by Drupal's security advisory policy"
}
}
},
"installation-source": "dist",
"notification-url": "https://packages.drupal.org/8/downloads",
"license": [
"GPL-2.0+"
],
"authors": [
{
"name": "stomusic",
"homepage": "https://www.drupal.org/user/3405436"
}
],
"description": "Provide extra option for better exposed filters to show only used terms in filter.",
"homepage": "https://www.drupal.org/project/selective_better_exposed_filters",
"keywords": [
"Drupal"
],
"support": {
"source": "http://cgit.drupalcode.org/selective_better_exposed_filters",
"issues": "https://www.drupal.org/project/issues/selective_better_exposed_filters"
},
"install-path": "../../modules/contrib/selective_better_exposed_filters"
},
{ {
"name": "drupal/session_limit", "name": "drupal/session_limit",
"version": "2.0.2", "version": "2.0.2",
......
...@@ -1384,6 +1384,15 @@ ...@@ -1384,6 +1384,15 @@
'aliases' => array(), 'aliases' => array(),
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'drupal/selective_better_exposed_filters' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'reference' => '3.0.3',
'type' => 'drupal-module',
'install_path' => __DIR__ . '/../../modules/contrib/selective_better_exposed_filters',
'aliases' => array(),
'dev_requirement' => false,
),
'drupal/session_limit' => array( 'drupal/session_limit' => array(
'pretty_version' => '2.0.2', 'pretty_version' => '2.0.2',
'version' => '2.0.2.0', 'version' => '2.0.2.0',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment