forked from saltonmassally/Drupal-CAC-Modules
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5f97acf
Showing
141 changed files
with
6,752 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Drupal-CAC-Modules |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: CAC Base | ||
type: module | ||
description: Provides custom utilities to the corporate affair commission modules | ||
package: Corporate Affairs Commission | ||
dependencies: | ||
- drupal:node | ||
- drupal:taxonomy | ||
- drupal:path | ||
- drupal:text | ||
- drupal:serialization | ||
- drupal:rest | ||
- basic_auth | ||
- hal | ||
- facets | ||
- search_api | ||
- search_api_db | ||
core: '8.x' | ||
project: 'cac' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Install file for cac_base. | ||
*/ | ||
|
||
/** | ||
* Implements hook_install(). | ||
* | ||
* We don't want users to be able to delete our company content | ||
* type. So therefore we have to tell Drupal that this is the case. This | ||
* can't be done in the content type's configuration YAML file, so we have to | ||
* do it in code, here. | ||
* | ||
* @ingroup cac_base | ||
*/ | ||
function cac_base_install() { | ||
// Do not allow the locked content type to be deleted. | ||
$locked = Drupal::state()->get('node.type.locked'); | ||
$locked['company_registration'] = 'company_registration'; | ||
$locked['company_contact'] = 'company_contact'; | ||
Drupal::state()->set('node.type.locked', $locked); | ||
} | ||
|
||
/** | ||
* Implements hook_uninstall(). | ||
* | ||
* Our content types will live on in the Drupal installation, even after this | ||
* module is uninstalled. This is a good thing, since it allows the user to | ||
* make decisions about their fate. Therefore we should give the user the | ||
* option of deleting them. | ||
* | ||
* Since we told Drupal that our company is locked, we now have | ||
* to tell it to unlock. | ||
* | ||
* @ingroup cac_base | ||
*/ | ||
function cac_base_uninstall() { | ||
// Allow company to be deleted. | ||
$locked = Drupal::state()->get('node.type.locked'); | ||
unset($locked['company_registration']); | ||
unset($locked['company_contact']); | ||
Drupal::state()->set('node.type.locked', $locked); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cac_base.description: | ||
title: Config Node Type Company | ||
route_name: config_cac_base.description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Module file for cac_base. | ||
*/ | ||
|
||
/** | ||
* @defgroup cac_base Example: Config Node Type | ||
* @ingroup examples | ||
* @{ | ||
* A basic example of defining a content type through configuration YAML files. | ||
* | ||
* In this example we create two content types for Drupal 8, using only YAML | ||
* files. Well, mostly only YAML files... One of our content types is locked, | ||
* so the user can't delete it while the module is installed. For this we need | ||
* a very tiny amount of support code. | ||
* | ||
* The simplest way to author the per-type YAML files is to create the content | ||
* types within Drupal and then take the YAML files from the configuration | ||
* directory. Like this: | ||
* | ||
* - Install Drupal 8. | ||
* - Create a new content type at admin/structure/types/add. Let's call it | ||
* 'Nifty Content Type'. | ||
* - Look in sites/default/files/config_[some hex codes]/active/. You'll see | ||
* a file called node.type.nifty_content_type.yml. | ||
* - Copy or move that file to your module's config/ directory. | ||
* - Make sure to remove the uuid information from the YAML files. | ||
* | ||
* You can see two of these YAML files in this module's config/ directory. | ||
* | ||
* If you want to lock a content type created in this way, you'll have to | ||
* implement hook_install() and hook_uninstall(). In hook_install(), you'll | ||
* set the content type to be locked. In hook_uninstall() you'll set the | ||
* content type to be unlocked. | ||
* | ||
* Content types created in this way will remain available after the user has | ||
* uninstalled the module. If you were to fail to set the content type as | ||
* unlocked, the user would not be able to delete it. | ||
* | ||
* @see https://drupal.org/node/2029519 | ||
* @} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
config_cac_base.description: | ||
path: 'cac/company_registration' | ||
defaults: | ||
_controller: '\Drupal\cac_base\Controller\NodeTypeCompanyRegistration::description' | ||
requirements: | ||
_permission: 'access content' |
Binary file not shown.
24 changes: 24 additions & 0 deletions
24
cac_base/config/install/core.base_field_override.node.company_contact.promote.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
uuid: 4f73ced1-e7fa-4b9d-ba8a-0963b0f5c96f | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_contact | ||
_core: | ||
default_config_hash: R7lix6ErXvXajfpks4FB24AIfLzQvzvku8Geqk1P52A | ||
id: node.company_contact.promote | ||
field_name: promote | ||
entity_type: node | ||
bundle: company_contact | ||
label: 'Promoted to front page' | ||
description: '' | ||
required: false | ||
translatable: true | ||
default_value: | ||
- | ||
value: 0 | ||
default_value_callback: '' | ||
settings: | ||
on_label: 'On' | ||
off_label: 'Off' | ||
field_type: boolean |
24 changes: 24 additions & 0 deletions
24
cac_base/config/install/core.base_field_override.node.company_contact.status.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
uuid: 47e961a7-e5da-425e-968c-56f77e4b5538 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_contact | ||
_core: | ||
default_config_hash: zgi7SKjCoj4R1DM5elbo4hT6ExhXP6XV-_8bbm6DSMg | ||
id: node.company_contact.status | ||
field_name: status | ||
entity_type: node | ||
bundle: company_contact | ||
label: 'Publishing status' | ||
description: 'A boolean indicating the published state.' | ||
required: false | ||
translatable: true | ||
default_value: | ||
- | ||
value: 1 | ||
default_value_callback: '' | ||
settings: | ||
on_label: 'On' | ||
off_label: 'Off' | ||
field_type: boolean |
20 changes: 20 additions & 0 deletions
20
cac_base/config/install/core.base_field_override.node.company_contact.title.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
uuid: e63498c5-fe5c-4d31-84b3-4defb77f2fd7 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_contact | ||
_core: | ||
default_config_hash: OLnXjEv2ERwCeH3kpGEUhkU0_BGvFtH8TPyVVuZwfz0 | ||
id: node.company_contact.title | ||
field_name: title | ||
entity_type: node | ||
bundle: company_contact | ||
label: Name | ||
description: '' | ||
required: true | ||
translatable: true | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: { } | ||
field_type: string |
24 changes: 24 additions & 0 deletions
24
...base/config/install/core.base_field_override.node.company_legacy_registration.promote.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
uuid: 4926b31d-f24d-444d-8fae-5bf887e1ad03 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_legacy_registration | ||
_core: | ||
default_config_hash: 7QEQkQgZCN86HFzLD8qP1elKQxcTgOzvA1y7RsHH5cA | ||
id: node.company_legacy_registration.promote | ||
field_name: promote | ||
entity_type: node | ||
bundle: company_legacy_registration | ||
label: 'Promoted to front page' | ||
description: '' | ||
required: false | ||
translatable: true | ||
default_value: | ||
- | ||
value: 0 | ||
default_value_callback: '' | ||
settings: | ||
on_label: 'On' | ||
off_label: 'Off' | ||
field_type: boolean |
20 changes: 20 additions & 0 deletions
20
cac_base/config/install/core.base_field_override.node.company_legacy_registration.title.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
uuid: 7ed74b24-4a1d-49c6-ad6d-caa3fb1e8282 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_legacy_registration | ||
_core: | ||
default_config_hash: Uya8oFw_fH8RV3wxIUe9k6eTY8WQS7arsEFNB-l5244 | ||
id: node.company_legacy_registration.title | ||
field_name: title | ||
entity_type: node | ||
bundle: company_legacy_registration | ||
label: 'Company Name' | ||
description: '' | ||
required: true | ||
translatable: true | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: { } | ||
field_type: string |
24 changes: 24 additions & 0 deletions
24
cac_base/config/install/core.base_field_override.node.company_registration.promote.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
uuid: 397ec978-3794-41d9-8633-bec7276afee4 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_registration | ||
_core: | ||
default_config_hash: s8cL-Tfn-2zOjTI7YDCZHCZU1wqLwEY30b7s70mZ-l8 | ||
id: node.company_registration.promote | ||
field_name: promote | ||
entity_type: node | ||
bundle: company_registration | ||
label: 'Promoted to front page' | ||
description: '' | ||
required: false | ||
translatable: true | ||
default_value: | ||
- | ||
value: 0 | ||
default_value_callback: '' | ||
settings: | ||
on_label: 'On' | ||
off_label: 'Off' | ||
field_type: boolean |
20 changes: 20 additions & 0 deletions
20
cac_base/config/install/core.base_field_override.node.company_registration.title.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
uuid: cd8fccf5-1a21-48e7-9746-81c92c14f6e2 | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- node.type.company_registration | ||
_core: | ||
default_config_hash: AZyEVtpeuMu6rriCU09NILurpzZTLJC3ck6BmWUDnGo | ||
id: node.company_registration.title | ||
field_name: title | ||
entity_type: node | ||
bundle: company_registration | ||
label: 'Business Name' | ||
description: '' | ||
required: true | ||
translatable: true | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: { } | ||
field_type: string |
Oops, something went wrong.