Commit c62384ff authored by Gorodkov Denis's avatar Gorodkov Denis

commit

parent a86088c0
......@@ -16,16 +16,19 @@
"drupal/admin_toolbar": "^3.1",
"drupal/backup_migrate": "^5.0",
"drupal/better_exposed_filters": "^5.0",
"drupal/bootstrap": "^3.24",
"drupal/config_ignore": "^2.3",
"drupal/config_pages": "^2.9",
"drupal/core": "^9.1",
"drupal/core-composer-scaffold": "^9",
"drupal/devel": "^4.1",
"drupal/devel_kint_extras": "^1.0",
"drupal/devel_php": "^1.5",
"drupal/entityreference_filter": "^1.4",
"drupal/facets": "^2.0",
"drupal/field_group": "^3.2",
"drupal/fontawesome_menu_icons": "^1.9",
"drupal/jquery_ui_tabs": "^1.1",
"drupal/media_library_block": "^1.0",
"drupal/media_library_form_element": "^2.0",
"drupal/metatag": "^1.19",
......@@ -39,6 +42,7 @@
"drupal/redirect": "^1.7",
"drupal/rest_api_access_token": "^1.6",
"drupal/restui": "^1.20",
"drupal/schema": "^2.0@alpha",
"drupal/search_api": "^1.23",
"drupal/search_api_autocomplete": "^1.6",
"drupal/search_api_exclude": "^2.0",
......
This diff is collapsed.
<?php
/**
* Implements hook_schema().
*/
function mymodule_schema() {
$schema['aaaa'] = array( // Название таблицы
'description' => 'Database example', // Описание таблицы
'fields' => array( // Массив с колонками таблицы
'id' => array( // Название колонки
'description' => 'ID', // Описание колонки
'type' => 'serial', // Тип данных
'unsigned' => TRUE, // Unsigned, по умолчанию FALSE
'not null' => TRUE, // Проверка на 0
),
'uid' => array(
'description' => 'UID user',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0, // Значение по умолчанию
),
'text' => array(
'description' => 'Text',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('id'),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
/*function mymodule_uninstall() {
\Drupal::state()->delete('mymodule.mymodule');
}*/
......@@ -11,3 +11,9 @@ mymdoule.test:
_title_callback: '\Drupal\Core\Entity\Controller\EntityController::title'
requirements:
_permission: 'administer content types'
mymodule.ajax_form:
path: '/ajax-form'
defaults:
_form: '\Drupal\mymodule\Form\AjaxForm'
requirements:
_permission: 'access content'
<?php
namespace Drupal\mymodule\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class AjaxForm extends FormBase {
public function getFormId() {
return 'mymodule_ajax_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form['name'] = array(
'#type' => 'textfield',
'#title' => 'Name',
'#required' => TRUE
);
$form['email'] = array(
'#type' => 'email',
'#title' => 'Email',
'#required' => TRUE
);
$form['url'] = array(
'#type' => 'textfield',
'#title' => 'URL',
'#required' => TRUE
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Import'
);
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}
type: theme
base theme: bootstrap
core: 8.x
core_version_requirement: ^8 || ^9
name: 'DrupalJedi'
description: 'A Drupal Bootstrap 3 based sub-theme.'
package: 'Bootstrap'
regions:
navigation: 'Navigation'
navigation_collapsible: 'Navigation (Collapsible)'
header: 'Top Bar'
highlighted: 'Highlighted'
help: 'Help'
content: 'Content'
sidebar_first: 'Primary'
sidebar_second: 'Secondary'
footer: 'Footer'
page_top: 'Page top'
page_bottom: 'Page bottom'
libraries-extend:
bootstrap/framework:
- DrupalJedi/framework
framework:
css:
theme:
css/style.css: {}
# Uncomment for LESS source JavaScript files.
# js:
# bootstrap/js/affix.js: {}
# bootstrap/js/alert.js: {}
# bootstrap/js/button.js: {}
# bootstrap/js/carousel.js: {}
# bootstrap/js/collapse.js: {}
# bootstrap/js/dropdown.js: {}
# bootstrap/js/modal.js: {}
# bootstrap/js/tooltip.js: {}
# bootstrap/js/popover.js: {}
# bootstrap/js/scrollspy.js: {}
# bootstrap/js/tab.js: {}
# bootstrap/js/transition.js: {}
# Uncomment for SASS source JavaScript files.
# js:
# bootstrap/assets/javascripts/bootstrap/affix.js: {}
# bootstrap/assets/javascripts/bootstrap/alert.js: {}
# bootstrap/assets/javascripts/bootstrap/button.js: {}
# bootstrap/assets/javascripts/bootstrap/carousel.js: {}
# bootstrap/assets/javascripts/bootstrap/collapse.js: {}
# bootstrap/assets/javascripts/bootstrap/dropdown.js: {}
# bootstrap/assets/javascripts/bootstrap/modal.js: {}
# bootstrap/assets/javascripts/bootstrap/tooltip.js: {}
# bootstrap/assets/javascripts/bootstrap/popover.js: {}
# bootstrap/assets/javascripts/bootstrap/scrollspy.js: {}
# bootstrap/assets/javascripts/bootstrap/tab.js: {}
# bootstrap/assets/javascripts/bootstrap/transition.js: {}
<?php
/**
* @file
* Bootstrap sub-theme.
*
* Place your custom PHP code in this file.
*/
function DrupalJedi_preprocess_node(&$variables) {
$node = $variables["node"];
// Установить для ноыд cachecontext = ['url.query_args']
}
function DrupalJedi_preprocess(&$variables, $hook) {
if ($hook == 'details' and $variables["element"]["#bundle"] == 'people' and $variables["element"]["#group_name"] == 'group_films') {
$get = \Drupal::request()->query->get('tab');
if ($get == 'films') {
$variables["tab_films"] = "true";
}
}
}
# Default settings should not be located here. This file is only used to
# install initial setting values. If your theme is the one that introduces a
# new theme setting, it should use the Drupal Bootstrap base theme's
# @BootstrapSetting annotation discovery process. This ensures that sub-theme
# settings are inherited from base themes themes properly and to determine when
# a setting should be saved to config as "overridden".
#
# @see \Drupal\bootstrap\Plugin\SettingBase
# @see \Drupal\bootstrap\Plugin\SettingInterface
# @see \Drupal\bootstrap\Plugin\SettingManager
# @see \Drupal\bootstrap\Plugin\Form\SystemThemeSettings
# @see \Drupal\bootstrap\ThemeSettings
# This file cannot be empty, so install an initial empty array for "schemas".
# @see https://www.drupal.org/node/2813829
schemas: []
# Disable the CDN provider so compiled source files can be used.
#cdn_provider: ''
# Schema for the theme setting configuration file of the THEMETITLE theme.
DrupalJedi.settings:
type: theme_settings
label: 'DrupalJedi settings'
/**
* If using a CSS pre-processor, tell it to overwrite this file. If not, place
* your custom CSS modifications here.
*/
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill="#EE0000" d="M0,7.562l1.114-3.438c2.565,0.906,4.43,1.688,5.59,2.35C6.398,3.553,6.237,1.544,6.22,0.447h3.511 c-0.05,1.597-0.234,3.6-0.558,6.003c1.664-0.838,3.566-1.613,5.714-2.325L16,7.562c-2.05,0.678-4.06,1.131-6.028,1.356 c0.984,0.856,2.372,2.381,4.166,4.575l-2.906,2.059c-0.935-1.274-2.041-3.009-3.316-5.206c-1.194,2.275-2.244,4.013-3.147,5.206 l-2.856-2.059c1.872-2.307,3.211-3.832,4.017-4.575C3.849,8.516,1.872,8.062,0,7.562"/></svg>
<svg
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="32px" height="32px"
viewBox="0 0 32 32" preserveAspectRatio="none">
<g>
<image width="32" height="32" xlink:href="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
bWFnZVJlYWR5ccllPAAAAohJREFUeNrEl1tIVGEQx12L0BQjoXwpoRfxIQUJuhAIvVRLIRQELYj1
oKDgpQgVNQhBChQfLFDLoovVS0RQYuqLPUgFgTcQia5CSBBERUiKuv0+GGGJPd/l7Nkc+DNn98w3
8/++mXNmTigajaasp4T8Ejhx+GIWavOTkbaviRBITWBtIbgDkfT1InAGHAGDkNj2X1NAwFLU3ZgN
fATnSMezpBIgcAaqWRBPHoFLEJlNVgpWRC943D8FJiDaA3IDOQEc5aNK5Ocou3vDf3u5HgFbNEu/
gzrs7/smQKAa1BWQEfN3L06ruFcmdWCSa+A8a1acUkCAetTVf4IrqeReBIf3pPhMojbR41QDBDiO
atc4LRU9ZVk7FXKaZgLyhus2OExbS6FDAV+OV5jxTqAa7DQ4e4qzTegiBwKZoFFLAKdqZ+UGR8Pk
vwu9A7i+AU8TY6vuBNTjtcvgJB0nJyGhCvAgeO9AIBsc0hHYb+GkGDyGxG1ITHIdlmfeVop1BAoc
HJ2FxENIqBOodVhXoCOw3TGnEfVCgsQDrmcc0uBJYNVHR20S3R/EPDDvw0c+p6AK94Wl/aKOwLTP
uSIPfAHLFrYfdAReJzBZ2abvpY7ABHjrg8AcyAEbDXZL4LknAapZGdxyDD4vpPdZ2A7JC0zbC3pl
R7bSJ70+YjFNtVoNJNKObQbMcXAA7AFjhhGvA6INVvMAhgOoBkNwNQsck5Z8wxB8wGuQ9VwEiQ7U
BSmcWPkGOiXnv2QS3q0Jru6rCWrZ71BaKH0/JLXxCmd/+F8RuKkJ/gO0YNsd6IcJgcPSfI56mLxT
3RJcJ/jnoD9MNsg3oZobcqWxqGf/J/gkdTFJ4N9J/zoOSv4KMAC++teHNUg1rQAAAABJRU5ErkJg
gg==
"/>
</g>
</svg>
This directory is used to implement various Bootstrap annotated plugins.
Please refer to the [Plugin System](<!-- @url plugins -->) topic for more info.
This directory is used to implement various core, contrib, Bootstrap and custom
templates.
Please refer to the [Templates](<!-- @url templates -->) topic for more info.
{#
/**
* @file
* Default theme implementation to display a Bootstrap Panel component.
*
* Available variables:
* - attributes: An array of HTML attributes intended to be added to the main
* container tag of this template.
* - id: A valid HTML ID and guaranteed to be unique.
* - body: The primary content of the panel.
* - body_attributes: (optional) Same as attributes, except applied to the body
* container that appears in the template.
* - collapsible: Flag indicating whether the panel is collapsible.
* - collapsed: Flag indicating whether the panel is collapsed.
* - description: (optional) A list of description properties containing:
* - content: (optional) A description of the form element, may not be set.
* - attributes: (optional) A list of HTML attributes to apply to the
* description content wrapper. Will only be set when description is set.
* - position: (optional) A display setting that can have these values:
* - before: The description is output before the element. This is the
* default value.
* - after: The description is output after the element.
* - invisible: The description is output after the element, hidden
* visually but available to screen readers.
* - errors: (optional) Any errors for panel, may not be set.
* - footer: (optional) Additional contents intended to be placed at the bottom.
* - footer_attributes: (optional) Same as attributes, except applied to the
* footer container that appears in the template.
* - heading: (optional) The title of the panel, may not be set.
* - heading_attributes: (optional) Same as attributes, except applied to the
* heading container that appears in the template.
* - panel_type: (optional) A contextual state. Will be one of these values:
* - danger
* - default (default value)
* - info
* - primary
* - success
* - warning
* - target: (optional) The target of the collapsible container.
*
* @ingroup templates
*/
#}
{%
set classes = [
'panel',
errors ? 'panel-danger' : 'panel-' ~ panel_type|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
{# Heading #}
{% if heading %}
{% block heading %}
<div class="panel-heading">
{%
set heading_classes = [
'panel-title',
required ? 'form-required' : '',
]
%}
{% if collapsible %}
<a{{ heading_attributes.addClass(heading_classes) }} href="{{ target }}">{{ heading }}</a>
{% else %}
<div{{ heading_attributes.addClass(heading_classes) }}>{{ heading }}</div>
{% endif %}
</div>
{% endblock %}
{% endif %}
{# Body #}
{% block body %}
{% set tab_class = 'fade' %}
{% if tab_films == 'true' %}
{% set tab_class = 'fade in' %}
{% endif %}
{%
set body_classes = [
'panel-body',
collapsible ? 'panel-collapse',
collapsible ? 'collapse',
collapsible ? tab_class,
errors or collapsible and not collapsed ? 'in',
]
%}
{%
set description_classes = [
'help-block',
description and description.position == 'invisible' ? 'sr-only',
]
%}
{% if errors %}
<div class="alert alert-danger" role="alert">
<strong>{{ errors }}</strong>
</div>
{% endif %}
<div{{ body_attributes.addClass(body_classes) }}>
{% if description and description.position == 'before' %}
<p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
{% endif %}
{{ body }}
{% if description and description.position == 'after' or description.position == 'invisible' %}
<p{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</p>
{% endif %}
</div>
{% endblock %}
{# Footer #}
{% if footer %}
{% block footer %}
{%
set footer_classes = [
'panel-footer',
]
%}
<div{{ footer_attributes.addClass(footer_classes) }}>{{ footer }}</div>
{% endblock %}
{% endif %}
</div>
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