Endpoint dodaj pojem deluje.
parent
da9ac824c9
commit
163f6c5d43
|
@ -49,3 +49,12 @@ Nato poženemo izgrajevalnik / strežnik:
|
||||||
Dodatne testne vsebine lahko definiramo v modulu `yufu_data`, v poddirektoriju `content`. Pazit moramo na ime - vsak fajl se mora končati s `.content.yml`.
|
Dodatne testne vsebine lahko definiramo v modulu `yufu_data`, v poddirektoriju `content`. Pazit moramo na ime - vsak fajl se mora končati s `.content.yml`.
|
||||||
|
|
||||||
Navodila za konstruiranje fajlov pa so tukaj: https://www.drupal.org/docs/contributed-modules/yaml-content/examples
|
Navodila za konstruiranje fajlov pa so tukaj: https://www.drupal.org/docs/contributed-modules/yaml-content/examples
|
||||||
|
|
||||||
|
|
||||||
|
# Dokumentacija
|
||||||
|
|
||||||
|
## Backend
|
||||||
|
|
||||||
|
### Endpoint za dodajanje pojmov
|
||||||
|
|
||||||
|
V modulu [yufu_concept](web/modules/custom/yufu_concept/yufu_concept.info.yml "yufu_concept").
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"composer/installers": "^2.0",
|
"composer/installers": "^2.0",
|
||||||
|
"cweagans/composer-patches": "^1.7",
|
||||||
"drupal/cer": "^5.0@beta",
|
"drupal/cer": "^5.0@beta",
|
||||||
"drupal/content_as_config": "^1.0",
|
"drupal/content_as_config": "^1.0",
|
||||||
"drupal/core-composer-scaffold": "^10.0",
|
"drupal/core-composer-scaffold": "^10.0",
|
||||||
|
@ -24,7 +25,9 @@
|
||||||
"drupal/gin": "^3.0@RC",
|
"drupal/gin": "^3.0@RC",
|
||||||
"drupal/gin_toolbar": "^1.0@RC",
|
"drupal/gin_toolbar": "^1.0@RC",
|
||||||
"drupal/jsonapi_menu_items": "^1.2",
|
"drupal/jsonapi_menu_items": "^1.2",
|
||||||
|
"drupal/restui": "^1.21",
|
||||||
"drupal/single_content_sync": "^1.3",
|
"drupal/single_content_sync": "^1.3",
|
||||||
|
"drupal/token": "^1.12",
|
||||||
"drupal/yaml_content": "^1.0@dev",
|
"drupal/yaml_content": "^1.0@dev",
|
||||||
"drush/drush": "^11.4"
|
"drush/drush": "^11.4"
|
||||||
},
|
},
|
||||||
|
@ -39,11 +42,17 @@
|
||||||
"drupal/core-composer-scaffold": true,
|
"drupal/core-composer-scaffold": true,
|
||||||
"drupal/core-project-message": true,
|
"drupal/core-project-message": true,
|
||||||
"phpstan/extension-installer": true,
|
"phpstan/extension-installer": true,
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
"dealerdirect/phpcodesniffer-composer-installer": true,
|
||||||
|
"cweagans/composer-patches": true
|
||||||
},
|
},
|
||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
"patches": {
|
||||||
|
"drupal/restui": {
|
||||||
|
"#3337894: Get class methods wrong argument.": "https://www.drupal.org/files/issues/2023-06-23/type-error-class-3337894-10.patch"
|
||||||
|
}
|
||||||
|
},
|
||||||
"drupal-scaffold": {
|
"drupal-scaffold": {
|
||||||
"locations": {
|
"locations": {
|
||||||
"web-root": "web/"
|
"web-root": "web/"
|
||||||
|
|
|
@ -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": "f739ff77797412cd5de7292408a1d098",
|
"content-hash": "d5d4122da2b7a3502081e8d79d06641a",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asm89/stack-cors",
|
"name": "asm89/stack-cors",
|
||||||
|
@ -870,6 +870,54 @@
|
||||||
},
|
},
|
||||||
"time": "2022-12-06T17:57:16+00:00"
|
"time": "2022-12-06T17:57:16+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "cweagans/composer-patches",
|
||||||
|
"version": "1.7.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/cweagans/composer-patches.git",
|
||||||
|
"reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db",
|
||||||
|
"reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"composer-plugin-api": "^1.0 || ^2.0",
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"composer/composer": "~1.0 || ~2.0",
|
||||||
|
"phpunit/phpunit": "~4.6"
|
||||||
|
},
|
||||||
|
"type": "composer-plugin",
|
||||||
|
"extra": {
|
||||||
|
"class": "cweagans\\Composer\\Patches"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"cweagans\\Composer\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Cameron Eagans",
|
||||||
|
"email": "me@cweagans.net"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides a way to patch Composer packages.",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/cweagans/composer-patches/issues",
|
||||||
|
"source": "https://github.com/cweagans/composer-patches/tree/1.7.3"
|
||||||
|
},
|
||||||
|
"time": "2022-12-20T22:53:13+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "dflydev/dot-access-data",
|
"name": "dflydev/dot-access-data",
|
||||||
"version": "v3.0.2",
|
"version": "v3.0.2",
|
||||||
|
@ -1348,6 +1396,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"includes/bootstrap.inc"
|
||||||
|
],
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Drupal\\Core\\": "lib/Drupal/Core",
|
"Drupal\\Core\\": "lib/Drupal/Core",
|
||||||
"Drupal\\Component\\": "lib/Drupal/Component"
|
"Drupal\\Component\\": "lib/Drupal/Component"
|
||||||
|
@ -1374,20 +1425,17 @@
|
||||||
"lib/Drupal/Core/DrupalKernelInterface.php",
|
"lib/Drupal/Core/DrupalKernelInterface.php",
|
||||||
"lib/Drupal/Core/Installer/InstallerRedirectTrait.php",
|
"lib/Drupal/Core/Installer/InstallerRedirectTrait.php",
|
||||||
"lib/Drupal/Core/Site/Settings.php"
|
"lib/Drupal/Core/Site/Settings.php"
|
||||||
],
|
|
||||||
"files": [
|
|
||||||
"includes/bootstrap.inc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"pre-autoload-dump": [
|
|
||||||
"Drupal\\Core\\Composer\\Composer::preAutoloadDump"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-2.0-or-later"
|
"GPL-2.0-or-later"
|
||||||
],
|
],
|
||||||
"description": "Drupal is an open source content management platform powering millions of websites and applications."
|
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/drupal/core/tree/10.0.3"
|
||||||
|
},
|
||||||
|
"time": "2023-02-01T18:23:27+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/core-composer-scaffold",
|
"name": "drupal/core-composer-scaffold",
|
||||||
|
@ -1425,6 +1473,7 @@
|
||||||
"Drupal\\Composer\\Plugin\\Scaffold\\": ""
|
"Drupal\\Composer\\Plugin\\Scaffold\\": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-2.0-or-later"
|
"GPL-2.0-or-later"
|
||||||
],
|
],
|
||||||
|
@ -1432,7 +1481,11 @@
|
||||||
"homepage": "https://www.drupal.org/project/drupal",
|
"homepage": "https://www.drupal.org/project/drupal",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"drupal"
|
"drupal"
|
||||||
]
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/drupal/core-composer-scaffold/tree/10.0.3"
|
||||||
|
},
|
||||||
|
"time": "2022-07-01T08:33:05+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/core-project-message",
|
"name": "drupal/core-project-message",
|
||||||
|
@ -1461,6 +1514,7 @@
|
||||||
"Drupal\\Composer\\Plugin\\ProjectMessage\\": "."
|
"Drupal\\Composer\\Plugin\\ProjectMessage\\": "."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-2.0-or-later"
|
"GPL-2.0-or-later"
|
||||||
],
|
],
|
||||||
|
@ -1468,7 +1522,11 @@
|
||||||
"homepage": "https://www.drupal.org/project/drupal",
|
"homepage": "https://www.drupal.org/project/drupal",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"drupal"
|
"drupal"
|
||||||
]
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/drupal/core-project-message/tree/10.0.3"
|
||||||
|
},
|
||||||
|
"time": "2022-07-01T08:33:05+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/core-recommended",
|
"name": "drupal/core-recommended",
|
||||||
|
@ -1539,10 +1597,15 @@
|
||||||
"webflo/drupal-core-strict": "*"
|
"webflo/drupal-core-strict": "*"
|
||||||
},
|
},
|
||||||
"type": "metapackage",
|
"type": "metapackage",
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-2.0-or-later"
|
"GPL-2.0-or-later"
|
||||||
],
|
],
|
||||||
"description": "Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core."
|
"description": "Core and its dependencies with known-compatible minor versions. Require this project INSTEAD OF drupal/core.",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/drupal/core-recommended/tree/10.0.3"
|
||||||
|
},
|
||||||
|
"time": "2023-02-01T18:23:27+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/gin",
|
"name": "drupal/gin",
|
||||||
|
@ -1785,6 +1848,62 @@
|
||||||
"source": "https://git.drupalcode.org/project/jsonapi_resources"
|
"source": "https://git.drupalcode.org/project/jsonapi_resources"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "drupal/restui",
|
||||||
|
"version": "1.21.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.drupalcode.org/project/restui.git",
|
||||||
|
"reference": "8.x-1.21"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://ftp.drupal.org/files/projects/restui-8.x-1.21.zip",
|
||||||
|
"reference": "8.x-1.21",
|
||||||
|
"shasum": "2a67dc2c1953dced0bddaff25e5c60784ee0178c"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"drupal/core": "^8.7.7 || ^9 || ^10"
|
||||||
|
},
|
||||||
|
"type": "drupal-module",
|
||||||
|
"extra": {
|
||||||
|
"drupal": {
|
||||||
|
"version": "8.x-1.21",
|
||||||
|
"datestamp": "1659086914",
|
||||||
|
"security-coverage": {
|
||||||
|
"status": "covered",
|
||||||
|
"message": "Covered by Drupal's security advisory policy"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packages.drupal.org/8/downloads",
|
||||||
|
"license": [
|
||||||
|
"GPL-2.0-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "-enzo-",
|
||||||
|
"homepage": "https://www.drupal.org/user/294937"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "clemens.tolboom",
|
||||||
|
"homepage": "https://www.drupal.org/user/125814"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "juampynr",
|
||||||
|
"homepage": "https://www.drupal.org/user/682736"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "klausi",
|
||||||
|
"homepage": "https://www.drupal.org/user/262198"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides a user interface to manage REST resources.",
|
||||||
|
"homepage": "https://www.drupal.org/project/restui",
|
||||||
|
"support": {
|
||||||
|
"source": "https://git.drupalcode.org/project/restui"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/single_content_sync",
|
"name": "drupal/single_content_sync",
|
||||||
"version": "1.3.13",
|
"version": "1.3.13",
|
||||||
|
@ -1838,6 +1957,75 @@
|
||||||
"issues": "https://drupal.org/project/issues/single_content_sync"
|
"issues": "https://drupal.org/project/issues/single_content_sync"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "drupal/token",
|
||||||
|
"version": "1.12.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.drupalcode.org/project/token.git",
|
||||||
|
"reference": "8.x-1.12"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://ftp.drupal.org/files/projects/token-8.x-1.12.zip",
|
||||||
|
"reference": "8.x-1.12",
|
||||||
|
"shasum": "cefe1b203b793682f74ea43e18d0a814cf768763"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"drupal/core": "^9.2 || ^10"
|
||||||
|
},
|
||||||
|
"type": "drupal-module",
|
||||||
|
"extra": {
|
||||||
|
"drupal": {
|
||||||
|
"version": "8.x-1.12",
|
||||||
|
"datestamp": "1688015262",
|
||||||
|
"security-coverage": {
|
||||||
|
"status": "covered",
|
||||||
|
"message": "Covered by Drupal's security advisory policy"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"drush": {
|
||||||
|
"services": {
|
||||||
|
"drush.services.yml": "^9 || ^10"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packages.drupal.org/8/downloads",
|
||||||
|
"license": [
|
||||||
|
"GPL-2.0-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Berdir",
|
||||||
|
"homepage": "https://www.drupal.org/user/214652"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Dave Reid",
|
||||||
|
"homepage": "https://www.drupal.org/user/53892"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "eaton",
|
||||||
|
"homepage": "https://www.drupal.org/user/16496"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fago",
|
||||||
|
"homepage": "https://www.drupal.org/user/16747"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "greggles",
|
||||||
|
"homepage": "https://www.drupal.org/user/36762"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mikeryan",
|
||||||
|
"homepage": "https://www.drupal.org/user/4420"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides a user interface for the Token API, some missing core tokens.",
|
||||||
|
"homepage": "https://www.drupal.org/project/token",
|
||||||
|
"support": {
|
||||||
|
"source": "https://git.drupalcode.org/project/token"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "drupal/yaml_content",
|
"name": "drupal/yaml_content",
|
||||||
"version": "dev-1.x",
|
"version": "dev-1.x",
|
||||||
|
@ -1858,8 +2046,8 @@
|
||||||
"dev-1.x": "1.x-dev"
|
"dev-1.x": "1.x-dev"
|
||||||
},
|
},
|
||||||
"drupal": {
|
"drupal": {
|
||||||
"version": "8.x-1.0-alpha8+1-dev",
|
"version": "8.x-1.0-alpha8+4-dev",
|
||||||
"datestamp": "1666891400",
|
"datestamp": "1690395239",
|
||||||
"security-coverage": {
|
"security-coverage": {
|
||||||
"status": "not-covered",
|
"status": "not-covered",
|
||||||
"message": "Project has not opted into security advisory coverage!"
|
"message": "Project has not opted into security advisory coverage!"
|
||||||
|
|
|
@ -8,7 +8,9 @@ dependencies:
|
||||||
- field.field.node.concept.field_related_concept
|
- field.field.node.concept.field_related_concept
|
||||||
- field.field.node.concept.field_tags
|
- field.field.node.concept.field_tags
|
||||||
- node.type.concept
|
- node.type.concept
|
||||||
|
- workflows.workflow.concept_workflow
|
||||||
module:
|
module:
|
||||||
|
- content_moderation
|
||||||
- media_library
|
- media_library
|
||||||
- path
|
- path
|
||||||
- text
|
- text
|
||||||
|
@ -19,7 +21,7 @@ mode: default
|
||||||
content:
|
content:
|
||||||
body:
|
body:
|
||||||
type: text_textarea_with_summary
|
type: text_textarea_with_summary
|
||||||
weight: 121
|
weight: 1
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
rows: 9
|
rows: 9
|
||||||
|
@ -29,20 +31,20 @@ content:
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
created:
|
created:
|
||||||
type: datetime_timestamp
|
type: datetime_timestamp
|
||||||
weight: 10
|
weight: 9
|
||||||
region: content
|
region: content
|
||||||
settings: { }
|
settings: { }
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
field_media:
|
field_media:
|
||||||
type: media_library_widget
|
type: media_library_widget
|
||||||
weight: 122
|
weight: 5
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
media_types: { }
|
media_types: { }
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
field_related_concept:
|
field_related_concept:
|
||||||
type: entity_reference_autocomplete
|
type: entity_reference_autocomplete
|
||||||
weight: 123
|
weight: 2
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
match_operator: CONTAINS
|
match_operator: CONTAINS
|
||||||
|
@ -52,7 +54,7 @@ content:
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
field_tags:
|
field_tags:
|
||||||
type: entity_reference_autocomplete
|
type: entity_reference_autocomplete
|
||||||
weight: 124
|
weight: 4
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
match_operator: CONTAINS
|
match_operator: CONTAINS
|
||||||
|
@ -62,41 +64,47 @@ content:
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
langcode:
|
langcode:
|
||||||
type: language_select
|
type: language_select
|
||||||
weight: 2
|
weight: 3
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
include_locked: true
|
include_locked: true
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
|
moderation_state:
|
||||||
|
type: moderation_state_default
|
||||||
|
weight: 6
|
||||||
|
region: content
|
||||||
|
settings: { }
|
||||||
|
third_party_settings: { }
|
||||||
path:
|
path:
|
||||||
type: path
|
type: path
|
||||||
weight: 30
|
weight: 13
|
||||||
region: content
|
region: content
|
||||||
settings: { }
|
settings: { }
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
promote:
|
promote:
|
||||||
type: boolean_checkbox
|
type: boolean_checkbox
|
||||||
weight: 15
|
weight: 11
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
display_label: true
|
display_label: true
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
status:
|
status:
|
||||||
type: boolean_checkbox
|
type: boolean_checkbox
|
||||||
weight: 120
|
weight: 7
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
display_label: true
|
display_label: true
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
sticky:
|
sticky:
|
||||||
type: boolean_checkbox
|
type: boolean_checkbox
|
||||||
weight: 16
|
weight: 12
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
display_label: true
|
display_label: true
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
title:
|
title:
|
||||||
type: string_textfield
|
type: string_textfield
|
||||||
weight: -5
|
weight: 0
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
size: 60
|
size: 60
|
||||||
|
@ -109,7 +117,7 @@ content:
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
uid:
|
uid:
|
||||||
type: entity_reference_autocomplete
|
type: entity_reference_autocomplete
|
||||||
weight: 5
|
weight: 8
|
||||||
region: content
|
region: content
|
||||||
settings:
|
settings:
|
||||||
match_operator: CONTAINS
|
match_operator: CONTAINS
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: be4c3be6-4cc3-4c4a-9c5e-d58e55903e85
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- block
|
||||||
|
id: block.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: block
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: b57556dc-3181-40a4-83b6-ee55e3c2f942
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- block_content
|
||||||
|
id: block_content.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: block_content
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 45f19d69-ef2b-4758-a9f8-e31279d31317
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- comment
|
||||||
|
id: comment.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: comment
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 655d18e2-71f8-49bf-ac6c-e0526bdd049e
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- content_moderation
|
||||||
|
id: content_moderation_state.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: content_moderation_state
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 6f5ca935-a97f-41ba-ad0e-3f284cf5e536
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- file
|
||||||
|
id: file.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: file
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 194fc976-a674-4d3f-b70f-087e97ab7e25
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- media
|
||||||
|
id: media.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: media
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 984fe3ef-e532-4bd9-8937-af7001e7a3bd
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- menu_link_content
|
||||||
|
id: menu_link_content.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: menu_link_content
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: f9b3366d-d376-41b1-8c3f-06edb76a96fb
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- node
|
||||||
|
id: node.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: node
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 600d4fed-e248-4be2-818a-4442c5f9e07a
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- path_alias
|
||||||
|
id: path_alias.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: path_alias
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: 5e3cc117-bf76-406a-ba35-cf9b5cfbe4b9
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- taxonomy
|
||||||
|
id: taxonomy_term.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: taxonomy_term
|
||||||
|
cache: true
|
|
@ -0,0 +1,10 @@
|
||||||
|
uuid: d8e3dde9-87a9-4209-ac1d-8961ff0a3ceb
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- user
|
||||||
|
id: user.token
|
||||||
|
label: Token
|
||||||
|
targetEntityType: user
|
||||||
|
cache: true
|
|
@ -42,12 +42,15 @@ module:
|
||||||
page_cache: 0
|
page_cache: 0
|
||||||
path: 0
|
path: 0
|
||||||
path_alias: 0
|
path_alias: 0
|
||||||
|
rest: 0
|
||||||
|
restui: 0
|
||||||
search: 0
|
search: 0
|
||||||
serialization: 0
|
serialization: 0
|
||||||
single_content_sync: 0
|
single_content_sync: 0
|
||||||
system: 0
|
system: 0
|
||||||
taxonomy: 0
|
taxonomy: 0
|
||||||
text: 0
|
text: 0
|
||||||
|
token: 0
|
||||||
toolbar: 0
|
toolbar: 0
|
||||||
update: 0
|
update: 0
|
||||||
user: 0
|
user: 0
|
||||||
|
@ -55,6 +58,7 @@ module:
|
||||||
workflows: 0
|
workflows: 0
|
||||||
yaml_content: 0
|
yaml_content: 0
|
||||||
yufu_admin: 0
|
yufu_admin: 0
|
||||||
|
yufu_concept: 0
|
||||||
yufu_data: 0
|
yufu_data: 0
|
||||||
content_translation: 10
|
content_translation: 10
|
||||||
views: 10
|
views: 10
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
_core:
|
_core:
|
||||||
default_config_hash: e883aGsrt1wFrsydlYU584PZONCSfRy0DtkZ9KzHb58
|
default_config_hash: e883aGsrt1wFrsydlYU584PZONCSfRy0DtkZ9KzHb58
|
||||||
row_limit: 1000
|
row_limit: 100000
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
display:
|
||||||
|
default:
|
||||||
|
display_title: Default
|
||||||
|
display_options:
|
||||||
|
fields:
|
||||||
|
title:
|
||||||
|
label: Naslov
|
||||||
|
type:
|
||||||
|
label: 'Tip vsebine'
|
||||||
|
name:
|
||||||
|
label: Author
|
||||||
|
changed:
|
||||||
|
label: Updated
|
||||||
|
operations:
|
||||||
|
label: Operations
|
||||||
|
exposed_form:
|
||||||
|
options:
|
||||||
|
submit_button: Filter
|
||||||
|
reset_button_label: Reset
|
||||||
|
filters:
|
||||||
|
title:
|
||||||
|
expose:
|
||||||
|
label: Naslov
|
||||||
|
type:
|
||||||
|
expose:
|
||||||
|
label: 'Tip vsebine'
|
||||||
|
langcode:
|
||||||
|
expose:
|
||||||
|
label: Language
|
|
@ -0,0 +1,29 @@
|
||||||
|
display:
|
||||||
|
default:
|
||||||
|
display_title: Default
|
||||||
|
display_options:
|
||||||
|
fields:
|
||||||
|
title:
|
||||||
|
label: Naslov
|
||||||
|
type:
|
||||||
|
label: 'Tip vsebine'
|
||||||
|
name:
|
||||||
|
label: Author
|
||||||
|
changed:
|
||||||
|
label: Updated
|
||||||
|
operations:
|
||||||
|
label: Operations
|
||||||
|
exposed_form:
|
||||||
|
options:
|
||||||
|
submit_button: Filter
|
||||||
|
reset_button_label: Reset
|
||||||
|
filters:
|
||||||
|
title:
|
||||||
|
expose:
|
||||||
|
label: Naslov
|
||||||
|
type:
|
||||||
|
expose:
|
||||||
|
label: 'Tip vsebine'
|
||||||
|
langcode:
|
||||||
|
expose:
|
||||||
|
label: Language
|
|
@ -0,0 +1,29 @@
|
||||||
|
display:
|
||||||
|
default:
|
||||||
|
display_title: Default
|
||||||
|
display_options:
|
||||||
|
fields:
|
||||||
|
title:
|
||||||
|
label: Naslov
|
||||||
|
type:
|
||||||
|
label: 'Tip vsebine'
|
||||||
|
name:
|
||||||
|
label: Author
|
||||||
|
changed:
|
||||||
|
label: Updated
|
||||||
|
operations:
|
||||||
|
label: Operations
|
||||||
|
exposed_form:
|
||||||
|
options:
|
||||||
|
submit_button: Filter
|
||||||
|
reset_button_label: Reset
|
||||||
|
filters:
|
||||||
|
title:
|
||||||
|
expose:
|
||||||
|
label: Naslov
|
||||||
|
type:
|
||||||
|
expose:
|
||||||
|
label: 'Tip vsebine'
|
||||||
|
langcode:
|
||||||
|
expose:
|
||||||
|
label: Language
|
|
@ -0,0 +1,18 @@
|
||||||
|
uuid: 589ee957-7efd-45d3-979b-93b5b1018761
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
module:
|
||||||
|
- serialization
|
||||||
|
- user
|
||||||
|
- yufu_concept
|
||||||
|
id: add_concept_rest_resource
|
||||||
|
plugin_id: add_concept_rest_resource
|
||||||
|
granularity: resource
|
||||||
|
configuration:
|
||||||
|
methods:
|
||||||
|
- POST
|
||||||
|
formats:
|
||||||
|
- json
|
||||||
|
authentication:
|
||||||
|
- cookie
|
|
@ -1,3 +1,3 @@
|
||||||
_core:
|
_core:
|
||||||
default_config_hash: u3-njszl92FaxjrCMiq0yDcjAfcdx72w1zT1O9dx6aA
|
default_config_hash: u3-njszl92FaxjrCMiq0yDcjAfcdx72w1zT1O9dx6aA
|
||||||
error_level: hide
|
error_level: some
|
||||||
|
|
|
@ -4,11 +4,13 @@ status: true
|
||||||
dependencies:
|
dependencies:
|
||||||
config:
|
config:
|
||||||
- node.type.concept
|
- node.type.concept
|
||||||
|
- rest.resource.add_concept_rest_resource
|
||||||
- workflows.workflow.concept_workflow
|
- workflows.workflow.concept_workflow
|
||||||
module:
|
module:
|
||||||
- content_moderation
|
- content_moderation
|
||||||
- media
|
- media
|
||||||
- node
|
- node
|
||||||
|
- rest
|
||||||
- system
|
- system
|
||||||
_core:
|
_core:
|
||||||
default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow
|
default_config_hash: j5zLMOdJBqC0bMvSdth5UebkprJB8g_2FXHqhfpJzow
|
||||||
|
@ -19,5 +21,7 @@ is_admin: false
|
||||||
permissions:
|
permissions:
|
||||||
- 'access content'
|
- 'access content'
|
||||||
- 'create concept content'
|
- 'create concept content'
|
||||||
|
- 'edit any concept content'
|
||||||
|
- 'restful post add_concept_rest_resource'
|
||||||
- 'use concept_workflow transition create_new_draft'
|
- 'use concept_workflow transition create_new_draft'
|
||||||
- 'view media'
|
- 'view media'
|
||||||
|
|
|
@ -5,12 +5,14 @@ dependencies:
|
||||||
config:
|
config:
|
||||||
- node.type.article
|
- node.type.article
|
||||||
- node.type.concept
|
- node.type.concept
|
||||||
|
- rest.resource.add_concept_rest_resource
|
||||||
- taxonomy.vocabulary.tags
|
- taxonomy.vocabulary.tags
|
||||||
- workflows.workflow.concept_workflow
|
- workflows.workflow.concept_workflow
|
||||||
module:
|
module:
|
||||||
- content_moderation
|
- content_moderation
|
||||||
- media
|
- media
|
||||||
- node
|
- node
|
||||||
|
- rest
|
||||||
- system
|
- system
|
||||||
- taxonomy
|
- taxonomy
|
||||||
- yufu_admin
|
- yufu_admin
|
||||||
|
@ -26,6 +28,8 @@ permissions:
|
||||||
- 'create concept content'
|
- 'create concept content'
|
||||||
- 'create media'
|
- 'create media'
|
||||||
- 'create terms in tags'
|
- 'create terms in tags'
|
||||||
|
- 'edit any concept content'
|
||||||
|
- 'restful post add_concept_rest_resource'
|
||||||
- 'use concept_workflow transition create_new_draft'
|
- 'use concept_workflow transition create_new_draft'
|
||||||
- 'use jsonapi operation link'
|
- 'use jsonapi operation link'
|
||||||
- 'view any unpublished content'
|
- 'view any unpublished content'
|
||||||
|
|
|
@ -11,6 +11,7 @@ dependencies:
|
||||||
- node.type.article
|
- node.type.article
|
||||||
- node.type.concept
|
- node.type.concept
|
||||||
- node.type.page
|
- node.type.page
|
||||||
|
- rest.resource.add_concept_rest_resource
|
||||||
- taxonomy.vocabulary.tags
|
- taxonomy.vocabulary.tags
|
||||||
- workflows.workflow.concept_workflow
|
- workflows.workflow.concept_workflow
|
||||||
module:
|
module:
|
||||||
|
@ -23,6 +24,7 @@ dependencies:
|
||||||
- media
|
- media
|
||||||
- node
|
- node
|
||||||
- path
|
- path
|
||||||
|
- rest
|
||||||
- taxonomy
|
- taxonomy
|
||||||
- toolbar
|
- toolbar
|
||||||
id: editor
|
id: editor
|
||||||
|
@ -85,6 +87,7 @@ permissions:
|
||||||
- 'edit terms in tags'
|
- 'edit terms in tags'
|
||||||
- 'export configuration'
|
- 'export configuration'
|
||||||
- 'import configuration'
|
- 'import configuration'
|
||||||
|
- 'restful post add_concept_rest_resource'
|
||||||
- 'revert article revisions'
|
- 'revert article revisions'
|
||||||
- 'revert concept revisions'
|
- 'revert concept revisions'
|
||||||
- 'revert page revisions'
|
- 'revert page revisions'
|
||||||
|
|
|
@ -2,7 +2,10 @@ uuid: 8347c43e-4379-4de8-9577-a481a608a372
|
||||||
langcode: en
|
langcode: en
|
||||||
status: true
|
status: true
|
||||||
dependencies:
|
dependencies:
|
||||||
|
config:
|
||||||
|
- workflows.workflow.concept_workflow
|
||||||
module:
|
module:
|
||||||
|
- content_moderation
|
||||||
- node
|
- node
|
||||||
- user
|
- user
|
||||||
enforced:
|
enforced:
|
||||||
|
@ -677,18 +680,18 @@ display:
|
||||||
plugin_id: moderation_state_filter
|
plugin_id: moderation_state_filter
|
||||||
operator: 'not in'
|
operator: 'not in'
|
||||||
value:
|
value:
|
||||||
editorial-published: editorial-published
|
concept_workflow-published: concept_workflow-published
|
||||||
group: 1
|
group: 1
|
||||||
exposed: false
|
exposed: false
|
||||||
expose:
|
expose:
|
||||||
operator_id: ''
|
operator_id: moderation_state_1_op
|
||||||
label: ''
|
label: 'Moderation state'
|
||||||
description: ''
|
description: null
|
||||||
use_operator: false
|
use_operator: false
|
||||||
operator: ''
|
operator: moderation_state_1_op
|
||||||
operator_limit_selection: false
|
operator_limit_selection: false
|
||||||
operator_list: { }
|
operator_list: { }
|
||||||
identifier: ''
|
identifier: moderation_state_1
|
||||||
required: false
|
required: false
|
||||||
remember: false
|
remember: false
|
||||||
multiple: false
|
multiple: false
|
||||||
|
@ -811,7 +814,8 @@ display:
|
||||||
- url.query_args
|
- url.query_args
|
||||||
- 'user.node_grants:view'
|
- 'user.node_grants:view'
|
||||||
- user.permissions
|
- user.permissions
|
||||||
tags: { }
|
tags:
|
||||||
|
- 'config:workflow_list'
|
||||||
moderated_content:
|
moderated_content:
|
||||||
id: moderated_content
|
id: moderated_content
|
||||||
display_title: 'Moderated content'
|
display_title: 'Moderated content'
|
||||||
|
@ -830,4 +834,5 @@ display:
|
||||||
- url.query_args
|
- url.query_args
|
||||||
- 'user.node_grants:view'
|
- 'user.node_grants:view'
|
||||||
- user.permissions
|
- user.permissions
|
||||||
tags: { }
|
tags:
|
||||||
|
- 'config:workflow_list'
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Yufu Concept
|
||||||
|
|
||||||
|
Vsebuje funkcionalnosti povezane s pojmi - osnovnimi gradniki manifesta.
|
||||||
|
|
||||||
|
## Endpoint /api/pojem/dodaj
|
||||||
|
|
||||||
|
Post request endpoint za dodajanje pojmov.
|
||||||
|
|
||||||
|
## Autocomplete za (povezane) pojme
|
||||||
|
|
||||||
|
@TODO: To be implemented.
|
||||||
|
|
||||||
|
## Posiljanje emailov
|
||||||
|
|
||||||
|
https://drupal.stackexchange.com/questions/235157/message-not-being-sent-in-the-body-of-the-mail
|
|
@ -1,20 +1,21 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Drupal\yufu_concept\src\Plugin\rest\resource;
|
namespace Drupal\yufu_concept\Plugin\rest\resource;
|
||||||
|
|
||||||
|
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||||
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
use Drupal\Core\Entity\EntityTypeManagerInterface;
|
||||||
|
use Drupal\Core\Mail\MailManagerInterface;
|
||||||
|
use Drupal\Core\Session\AccountProxyInterface;
|
||||||
|
use Drupal\Core\StringTranslation\StringTranslationTrait;
|
||||||
use Drupal\Core\TypedData\Exception\MissingDataException;
|
use Drupal\Core\TypedData\Exception\MissingDataException;
|
||||||
use Drupal\rest\Plugin\ResourceBase;
|
use Drupal\rest\Plugin\ResourceBase;
|
||||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
|
||||||
use Drupal\Core\Mail\MailManagerInterface;
|
|
||||||
use Drupal\rest\ResourceResponse;
|
use Drupal\rest\ResourceResponse;
|
||||||
use Drupal\Core\Session\AccountProxyInterface;
|
use Psr\Log\LogLevel;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates post endpoint to create new concept.
|
* Creates post endpoint to create new concept.
|
||||||
*
|
*
|
||||||
|
@ -22,12 +23,16 @@ use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
* id = "add_concept_rest_resource",
|
* id = "add_concept_rest_resource",
|
||||||
* label = @Translation("Create or edit a concept"),
|
* label = @Translation("Create or edit a concept"),
|
||||||
* uri_paths = {
|
* uri_paths = {
|
||||||
* "canonical" = "/api/pojem/dodaj"
|
* "canonical" = "/api/pojem/dodaj",
|
||||||
|
* "create" = "/api/pojem/dodaj",
|
||||||
* }
|
* }
|
||||||
|
* )
|
||||||
*/
|
*/
|
||||||
class AddConcept extends ResourceBase {
|
class AddConcept extends ResourceBase {
|
||||||
|
|
||||||
/**
|
use StringTranslationTrait;
|
||||||
|
|
||||||
|
/**
|
||||||
* A current user instance.
|
* A current user instance.
|
||||||
*
|
*
|
||||||
* @var \Drupal\Core\Session\AccountProxyInterface
|
* @var \Drupal\Core\Session\AccountProxyInterface
|
||||||
|
@ -77,8 +82,8 @@ class AddConcept extends ResourceBase {
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
array $configuration,
|
array $configuration,
|
||||||
$plugin_id,
|
string $plugin_id,
|
||||||
$plugin_definition,
|
array $plugin_definition,
|
||||||
array $serializer_formats,
|
array $serializer_formats,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
AccountProxyInterface $current_user,
|
AccountProxyInterface $current_user,
|
||||||
|
@ -88,7 +93,7 @@ class AddConcept extends ResourceBase {
|
||||||
parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger);
|
parent::__construct($configuration, $plugin_id, $plugin_definition, $serializer_formats, $logger);
|
||||||
$this->currentUser = $current_user;
|
$this->currentUser = $current_user;
|
||||||
$this->mailManager = $mailManager;
|
$this->mailManager = $mailManager;
|
||||||
$this->config = $configFactory->get('system.site');
|
$this->config = $configFactory;
|
||||||
$this->entityTypeManager = $entity_type_manager;
|
$this->entityTypeManager = $entity_type_manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +106,7 @@ class AddConcept extends ResourceBase {
|
||||||
$plugin_id,
|
$plugin_id,
|
||||||
$plugin_definition,
|
$plugin_definition,
|
||||||
$container->getParameter('serializer.formats'),
|
$container->getParameter('serializer.formats'),
|
||||||
$container->get('logger.factory')->get('custom_rest'),
|
$container->get('logger.factory')->get('yufu_concept'),
|
||||||
$container->get('current_user'),
|
$container->get('current_user'),
|
||||||
$container->get('plugin.manager.mail'),
|
$container->get('plugin.manager.mail'),
|
||||||
$container->get('config.factory'),
|
$container->get('config.factory'),
|
||||||
|
@ -110,16 +115,17 @@ class AddConcept extends ResourceBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send a test email.
|
* Ustvari nov koncept.
|
||||||
*
|
*
|
||||||
* @param $data
|
* @param \Symfony\Component\HttpFoundation\Request;
|
||||||
* Post date.
|
* Post request.
|
||||||
*
|
*
|
||||||
* @return \Drupal\rest\ResourceResponse
|
* @return \Drupal\rest\ResourceResponse
|
||||||
* Returns rest resource.
|
* Returns rest resource.
|
||||||
*/
|
*/
|
||||||
public function post($data) {
|
public function post(Request $request) {
|
||||||
$response_status['status'] = FALSE;
|
$response_status['status'] = FALSE;
|
||||||
|
$data = json_decode($request->getContent(), TRUE);
|
||||||
// You must to implement the logic of your REST Resource here.
|
// You must to implement the logic of your REST Resource here.
|
||||||
// Use current user after pass authentication to validate access.
|
// Use current user after pass authentication to validate access.
|
||||||
if (!$this->currentUser->hasPermission('access content')) {
|
if (!$this->currentUser->hasPermission('access content')) {
|
||||||
|
@ -133,26 +139,37 @@ class AddConcept extends ResourceBase {
|
||||||
$concept = [
|
$concept = [
|
||||||
'type' => 'concept',
|
'type' => 'concept',
|
||||||
'title' => $data['title'],
|
'title' => $data['title'],
|
||||||
'body' => $data['text'],
|
'body' => $data['body'],
|
||||||
];
|
];
|
||||||
|
$this->logger->log(LogLevel::NOTICE, $this->t('Creating concept: @title', [
|
||||||
|
'@title' => $concept['title'],
|
||||||
|
]));
|
||||||
// @TODO Check if related concepts are set and add them to the concept.
|
// @TODO Check if related concepts are set and add them to the concept.
|
||||||
// @TODO Check language and add set it on concept if exists.
|
// @TODO Check language and add set it on concept if exists.
|
||||||
$concept = $this->entityTypeManger->getStorage('node')->create($concept);
|
/** @var \Drupal\node\Entity\NodeInterface $concept */
|
||||||
|
$concept = $this->entityTypeManager->getStorage('node')->create($concept);
|
||||||
$concept->save();
|
$concept->save();
|
||||||
|
$response_status['concept'] = [
|
||||||
|
'title' => $concept->label(),
|
||||||
|
'id' => $concept->id(),
|
||||||
|
'uuid' => $concept->uuid(),
|
||||||
|
];
|
||||||
|
|
||||||
if (!empty($data['email'])) {
|
if (!empty($data['email'])) {
|
||||||
// @TODO Poslji mail uporabniku, da se lahko registrira.
|
// @TODO Poslji mail uporabniku, da se lahko registrira.
|
||||||
$site_email = $this->config->get('mail');
|
$site_email = $this->config->get('system.site')->get('mail');
|
||||||
$module = 'yufu_concept';
|
$module = 'yufu_concept';
|
||||||
$key = 'notice';
|
$key = 'add_concept_rest_resource';
|
||||||
$to = $site_email;
|
$to = $site_email;
|
||||||
// Send email to user to make him register to the website.
|
// Send email to user to make him register to the website.
|
||||||
$params['message'] = $data['message']['value'];
|
$params['message'] = $this->t('Creating concept: @title', [
|
||||||
$params['title'] = $data['subject']['value'];
|
'@title' => $concept->label(),
|
||||||
$params['from'] = $data['email']['value'];
|
]);
|
||||||
$langcode = $data['lang']['value'];
|
$params['subject'] = $data['title'];
|
||||||
|
$params['from'] = $data['email'];
|
||||||
|
// @TODO Add validation for langode (must be from system configured endpoints).
|
||||||
|
$langcode = $data['lang'] ?? 'en';
|
||||||
$send = TRUE;
|
$send = TRUE;
|
||||||
|
|
||||||
$result = $this->mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);
|
$result = $this->mailManager->mail($module, $key, $to, $langcode, $params, NULL, $send);
|
||||||
$response_status['status'] = $result['result'];
|
$response_status['status'] = $result['result'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,10 @@
|
||||||
POST https://yufu-manifest.ddev.site/api/pojem/dodaj
|
POST https://yufu-manifest.ddev.site/api/pojem/dodaj
|
||||||
User-Agent: Emacs Restclient
|
User-Agent: Emacs Restclient
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
Cookies: "SSESSb6f5da6ef565138b872e3e58509d8150=0z6Zk4tRwTF4WAR%2CSO6rH0K5F7hqKpbe28XRRHwvTxo%2CUnpC"
|
||||||
|
|
||||||
{
|
{
|
||||||
"title": "Emacs restclient test",
|
"title": "Emacs restclient test 102",
|
||||||
"body": "O wau. Emacs restclient. How nice."
|
"body": "O wau. Emacs restclient. How nice.",
|
||||||
}
|
"email": "lio.novelli@radiostudent.si"
|
||||||
|
}
|
||||||
|
|
|
@ -4,3 +4,21 @@
|
||||||
* @file
|
* @file
|
||||||
* Primary module hooks for Yufu Concept module.
|
* Primary module hooks for Yufu Concept module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements hook_mail().
|
||||||
|
*/
|
||||||
|
function yufu_concept_mail($key, &$message, $params) {
|
||||||
|
$options = [
|
||||||
|
'langcode' => $message['langcode'],
|
||||||
|
];
|
||||||
|
|
||||||
|
switch ($key) {
|
||||||
|
case 'add_concept_rest_resource':
|
||||||
|
// This is just a test implementation for sending emails.
|
||||||
|
$message['from'] = $params['from'];
|
||||||
|
$message['subject'] = $params['subject'];
|
||||||
|
$message['body'][] = $params['message'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue