created materio_sapi module and draft of search form block

This commit is contained in:
Bachir Soussi Chiadmi 2019-05-28 17:56:34 +02:00
parent 42fc4e290e
commit ddd80ec288
29 changed files with 256 additions and 46 deletions

76
composer.lock generated
View File

@ -12505,7 +12505,7 @@
},
{
"name": "symfony/config",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
@ -12569,16 +12569,16 @@
},
{
"name": "symfony/console",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "15a9104356436cb26e08adab97706654799d31d8"
"reference": "8e1d1e406dd31727fa70cd5a99cda202e9d6a5c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/15a9104356436cb26e08adab97706654799d31d8",
"reference": "15a9104356436cb26e08adab97706654799d31d8",
"url": "https://api.github.com/repos/symfony/console/zipball/8e1d1e406dd31727fa70cd5a99cda202e9d6a5c6",
"reference": "8e1d1e406dd31727fa70cd5a99cda202e9d6a5c6",
"shasum": ""
},
"require": {
@ -12637,7 +12637,7 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2019-04-08T09:29:13+00:00"
"time": "2019-05-09T08:42:51+00:00"
},
{
"name": "symfony/contracts",
@ -12712,7 +12712,7 @@
},
{
"name": "symfony/css-selector",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
@ -12765,16 +12765,16 @@
},
{
"name": "symfony/debug",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9"
"reference": "671fc55bd14800668b1d0a3708c3714940e30a8c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/681afbb26488903c5ac15e63734f1d8ac430c9b9",
"reference": "681afbb26488903c5ac15e63734f1d8ac430c9b9",
"url": "https://api.github.com/repos/symfony/debug/zipball/671fc55bd14800668b1d0a3708c3714940e30a8c",
"reference": "671fc55bd14800668b1d0a3708c3714940e30a8c",
"shasum": ""
},
"require": {
@ -12817,20 +12817,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2019-04-11T09:48:14+00:00"
"time": "2019-05-18T13:32:47+00:00"
},
{
"name": "symfony/dependency-injection",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf"
"reference": "8f2a0452f086a66f6d6cf53a432867b575887768"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/be0feb3fa202aedfd8d1956f2dafd563fb13acbf",
"reference": "be0feb3fa202aedfd8d1956f2dafd563fb13acbf",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8f2a0452f086a66f6d6cf53a432867b575887768",
"reference": "8f2a0452f086a66f6d6cf53a432867b575887768",
"shasum": ""
},
"require": {
@ -12888,11 +12888,11 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2019-04-20T15:32:49+00:00"
"time": "2019-05-19T14:11:39+00:00"
},
{
"name": "symfony/dom-crawler",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
@ -12949,7 +12949,7 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
@ -13012,7 +13012,7 @@
},
{
"name": "symfony/filesystem",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
@ -13062,16 +13062,16 @@
},
{
"name": "symfony/finder",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98"
"reference": "fa5d962a71f2169dfe1cbae217fa5a2799859f6c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/61af5ce0b34b942d414fe8f1b11950d0e9a90e98",
"reference": "61af5ce0b34b942d414fe8f1b11950d0e9a90e98",
"url": "https://api.github.com/repos/symfony/finder/zipball/fa5d962a71f2169dfe1cbae217fa5a2799859f6c",
"reference": "fa5d962a71f2169dfe1cbae217fa5a2799859f6c",
"shasum": ""
},
"require": {
@ -13107,20 +13107,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2019-04-02T19:54:57+00:00"
"time": "2019-05-24T12:25:55+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "fa02215233be8de1c2b44617088192f9e8db3512"
"reference": "677ae5e892b081e71a665bfa7dd90fe61800c00e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/fa02215233be8de1c2b44617088192f9e8db3512",
"reference": "fa02215233be8de1c2b44617088192f9e8db3512",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/677ae5e892b081e71a665bfa7dd90fe61800c00e",
"reference": "677ae5e892b081e71a665bfa7dd90fe61800c00e",
"shasum": ""
},
"require": {
@ -13161,7 +13161,7 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2019-05-01T08:04:33+00:00"
"time": "2019-05-27T05:50:24+00:00"
},
{
"name": "symfony/http-kernel",
@ -13598,16 +13598,16 @@
},
{
"name": "symfony/process",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "a9c4dfbf653023b668c282e4e02609d131f4057a"
"reference": "afe411c2a6084f25cff55a01d0d4e1474c97ff13"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/a9c4dfbf653023b668c282e4e02609d131f4057a",
"reference": "a9c4dfbf653023b668c282e4e02609d131f4057a",
"url": "https://api.github.com/repos/symfony/process/zipball/afe411c2a6084f25cff55a01d0d4e1474c97ff13",
"reference": "afe411c2a6084f25cff55a01d0d4e1474c97ff13",
"shasum": ""
},
"require": {
@ -13643,7 +13643,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2019-04-08T16:15:54+00:00"
"time": "2019-05-22T12:54:11+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
@ -13867,7 +13867,7 @@
},
{
"name": "symfony/translation",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
@ -14022,7 +14022,7 @@
},
{
"name": "symfony/var-dumper",
"version": "v4.2.8",
"version": "v4.2.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
@ -14158,7 +14158,7 @@
},
{
"name": "symfony/yaml",
"version": "v3.4.27",
"version": "v3.4.28",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",

View File

@ -0,0 +1,20 @@
uuid: f45bc656-0e27-4f8a-82d2-b3c9e62c72f3
langcode: en
status: true
dependencies:
module:
- materio_sapi
theme:
- materiotheme
id: materiosapisearchblock
theme: materiotheme
region: content_top
weight: 0
provider: null
plugin: materio_sapi_search_block
settings:
id: materio_sapi_search_block
label: 'Materio sapi search block'
provider: materio_sapi
label_display: '0'
visibility: { }

View File

@ -92,6 +92,7 @@ module:
materio_jsonapi: 0
materio_migrate: 0
materio_samples: 0
materio_sapi: 0
matomo: 0
maxlength: 0
menu_block: 0

View File

@ -0,0 +1 @@
label: Variations

View File

@ -3,8 +3,10 @@ default_config:
page_breaker:
pages:
prefix_label: Page
first: «
previous:
next:
last: »
page_current_title: 'Page courante'
page_title: 'Aller à la page @number'
first_title: 'Aller à la première page'
@ -19,12 +21,16 @@ default_config:
last_reader: 'Dernière page'
items:
prefix_label: Élément
first: «
previous:
next:
last: »
page_reader: Élément
first_reader: 'Premier élément'
item_ranges:
prefix_label: Éléments
first: «
previous:
next:
last: »
page_reader: Éléments

View File

@ -1,8 +1,10 @@
default_config:
tags:
pages:
first: «
previous:
next:
last: »
first_title: 'Aller à la première page'
previous_title: 'Aller à la page précédente'
next_title: 'Aller à la page suivante'
@ -12,9 +14,13 @@ default_config:
next_reader: 'Page suivante'
last_reader: 'Dernière page'
items:
first: «
previous:
next:
last: »
first_reader: 'Premier élément'
item_ranges:
first: «
previous:
next:
last: »

View File

@ -2,8 +2,10 @@ default_config:
tags:
pages:
prefix_label: Page
first: «
previous:
next:
last: »
page_current_title: 'Page courante'
first_title: 'Aller à la première page'
previous_title: 'Aller à la page précédente'
@ -16,6 +18,8 @@ default_config:
last_reader: 'Dernière page'
items:
prefix_label: Élément
first: «
previous:
next:
last: »
first_reader: 'Premier élément'

View File

@ -3,8 +3,10 @@ default_config:
page_breaker:
pages:
prefix_label: Page
first: «
previous:
next:
last: »
page_current_title: 'Page courante'
page_title: 'Aller à la page @number'
first_title: 'Aller à la première page'
@ -19,12 +21,16 @@ default_config:
last_reader: 'Dernière page'
items:
prefix_label: Élément
first: «
previous:
next:
last: »
page_reader: Élément
first_reader: 'Premier élément'
item_ranges:
prefix_label: Éléments
first: «
previous:
next:
last: »
page_reader: Éléments

View File

@ -2,8 +2,10 @@ default_config:
tags:
pages:
prefix_label: Page
first: «
previous:
next:
last: »
page_current_title: 'Page courante'
page_title: 'Aller à la page @number'
first_title: 'Aller à la première page'
@ -18,12 +20,16 @@ default_config:
last_reader: 'Dernière page'
items:
prefix_label: Élément
first: «
previous:
next:
last: »
page_reader: Élément
first_reader: 'Premier élément'
item_ranges:
prefix_label: Éléments
first: «
previous:
next:
last: »
page_reader: Éléments

View File

@ -2,8 +2,10 @@ default_config:
tags:
pages:
prefix_label: Page
first: «
previous:
next:
last: »
page_current_title: 'Page courante'
first_title: 'Aller à la première page'
previous_title: 'Aller à la page précédente'
@ -16,10 +18,14 @@ default_config:
last_reader: 'Dernière page'
items:
prefix_label: Élément
first: «
previous:
next:
last: »
first_reader: 'Premier élément'
item_ranges:
prefix_label: Éléments
first: «
previous:
next:
last: »

View File

@ -18,7 +18,7 @@ register_pending_approval_admin:
subject: 'Détails du compte [user:display-name] sur [site:name] (en attente de validation d''un administrateur)'
status_activated:
body: "[user:display-name],\r\n\r\nVotre compte sur [site:name] a été activé.\r\n\r\nVous pouvez maintenant vous connecter en cliquant sur le lien ci-dessous ou en le copiant dans votre navigateur : \r\n\r\n[user:one-time-login-url]\r\n\r\nCe lien ne peut être utilisé qu'une seule fois et vous redirigera vers une page où vous pourrez choisir votre mot de passe.\r\n\r\nAprès avoir choisi votre mot de passe, vous pourrez vous connecter sur [site:login-url] en utilisant :\r\n\r\nnom d'utilisateur : [user:account-name]\r\nmot de passe : Votre mot de passe\r\n\r\n-- L'équipe de [site:name]"
subject: 'Détails du compte [user:display-name] sur [site:name] (validé)'
subject: 'Détails du compte pour [user:display-name] sur [site:name]'
status_blocked:
body: "[user:display-name],\r\n\r\nVotre compte sur [site:name] a été bloqué.\r\n\r\n-- L'équipe [site:name]"
subject: 'Détails du compte [user:display-name] sur [site:name] (bloqué)'

View File

@ -25,6 +25,7 @@ display:
commerce_order_bulk_form:
action_title: 'Pour cette sélection'
order_number:
label: '#'
separator: ', '
placed:
label: Date

View File

@ -21,6 +21,8 @@ display:
first: "«\_premier"
last: "dernier\_»"
fields:
idmaillog:
label: '#'
sent_date:
label: Date
subject:

View File

@ -58,7 +58,7 @@ display:
title: '307 Redirection Temporaire'
language:
expose:
label: 'Langue d''origine'
label: 'Langue initiale'
title: Rediriger
page_1:
display_title: Page

View File

@ -1,5 +1,5 @@
label: 'Bloc "Qui est connecté"'
description: 'Affiche les noms des utilisateurs les plus actifs récemment, et le nombre total d''utilisateurs actifs.'
description: 'Affiche les noms des utilisateurs les plus actifs récemment et le nombre total d''utilisateurs actifs.'
display:
default:
display_title: Maître

View File

@ -7,6 +7,7 @@ label: Adhérent
weight: -3
is_admin: null
permissions:
- 'access materio search'
- 'create member profile'
- 'update own member profile'
- 'view own member profile'

View File

@ -15,6 +15,7 @@ permissions:
- 'access commerce_license overview'
- 'access commerce_order overview'
- 'access files overview'
- 'access materio search'
- 'access profile overview'
- 'access site in maintenance mode'
- 'access synonyms entity autocomplete'

View File

@ -6,4 +6,5 @@ id: admin_showroom
label: 'Admin Showroom'
weight: 0
is_admin: null
permissions: { }
permissions:
- 'access materio search'

View File

@ -7,6 +7,7 @@ label: 'Alpha Testeur'
weight: -5
is_admin: null
permissions:
- 'access materio search'
- 'create member profile'
- 'update own member profile'
- 'view own member profile'

View File

@ -7,6 +7,7 @@ label: Student
weight: -4
is_admin: null
permissions:
- 'access materio search'
- 'create member profile'
- 'update own member profile'
- 'view own member profile'

View File

@ -6,4 +6,5 @@ id: translator
label: Translator
weight: -1
is_admin: null
permissions: { }
permissions:
- 'access materio search'

View File

@ -0,0 +1,7 @@
name: Materio Serach API
type: module
description: 'Search Api Materio module'
core: 8.x
package: 'Materio'
dependencies:
- search_api

View File

@ -0,0 +1,24 @@
<?php
/**
* @file
* Contains materio_sapi.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function materio_sapi_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the materio_sapi module.
case 'help.page.materio_sapi':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Search Api Materio module') . '</p>';
return $output;
default:
}
}

View File

@ -0,0 +1,4 @@
access materio search:
title: 'Access materio search'
description: 'Allow access to materio search'

View File

@ -0,0 +1,9 @@
#
# materio_sapi.materio_sapi_search_form:
# path: '/materio_sapi/form/materio_sapi_search'
# defaults:
# _form: '\Drupal\materio_sapi\Form\MaterioSapiSearchForm'
# _title: 'MaterioSapiSearchForm'
# requirements:
# _access: 'TRUE'
#

View File

@ -0,0 +1,58 @@
<?php
namespace Drupal\materio_sapi\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Class MaterioSapiSearchForm.
*/
class MaterioSapiSearchForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'materio_sapi_search_form';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['search'] = [
'#type' => 'textfield',
'#title' => $this->t('Search'),
'#maxlength' => 64,
'#size' => 64,
'#weight' => '0',
];
$form['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Submit'),
];
return $form;
}
/**
* {@inheritdoc}
*/
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// Display result.
foreach ($form_state->getValues() as $key => $value) {
drupal_set_message($key . ': ' . $value);
}
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace Drupal\materio_sapi\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Access\AccessResult;
/**
* Provides a 'MaterioSapiSearchBlock' block.
*
* @Block(
* id = "materio_sapi_search_block",
* admin_label = @Translation("Materio sapi search block"),
* )
*/
class MaterioSapiSearchBlock extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
$build = [];
// $build['materio_sapi_search_block']['#markup'] = 'Implement MaterioSapiSearchBlock.';
$form = \Drupal::formBuilder()->getForm('Drupal\materio_sapi\Form\MaterioSapiSearchForm');
$build['materio_sapi_search_block'] = $form;
return $build;
}
/**
* {@inheritdoc}
*/
protected function blockAccess(AccountInterface $account) {
return AccessResult::allowedIfHasPermission($account, 'access materio search');
}
}

View File

@ -10,9 +10,10 @@ libraries:
regions:
header: Header
header_left: Header left
header_middle: Header middle
header_right: Header right
header_left: 'Header left'
header_middle: 'Header middle'
header_right: 'Header right'
content_top: 'Content Top'
content: Content
footer_left: 'Footer Left'
footer_center: 'Footer Center'

View File

@ -66,6 +66,12 @@
</aside>
{% endif %}
{% if page.content_top %}
<div class="content-top">
{{ page.content_top }}
</div>
{% endif %}
<div id="main-content">
{{ page.content|without('messages') }}
</div>{# /.layout-content #}