diff options
Diffstat (limited to 'modules/fahad/facility')
14 files changed, 468 insertions, 0 deletions
diff --git a/modules/fahad/facility/composer.json b/modules/fahad/facility/composer.json new file mode 100644 index 0000000..8429c38 --- /dev/null +++ b/modules/fahad/facility/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/facility", + "type": "drupal-module", + "description": "My Awesome Module", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/facility", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/facility", + "source": "http://cgit.drupalcode.org/facility" + }, + "require": { } +} diff --git a/modules/fahad/facility/config/install/core.entity_form_display.node.facility.default.yml b/modules/fahad/facility/config/install/core.entity_form_display.node.facility.default.yml new file mode 100644 index 0000000..6be20e0 --- /dev/null +++ b/modules/fahad/facility/config/install/core.entity_form_display.node.facility.default.yml @@ -0,0 +1,105 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.facility.body + - field.field.node.facility.field_facility_ + - field.field.node.facility.field_facility_image + - image.style.thumbnail + - node.type.facility + module: + - image + - link + - path + - text + enforced: + module: + - facility +id: node.facility.default +targetEntityType: node +bundle: facility +mode: default +content: + body: + type: text_textarea_with_summary + weight: 121 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + third_party_settings: { } + region: content + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_facility_: + weight: 123 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_facility_image: + weight: 122 + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + type: image_image + region: content + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + settings: + display_label: true + weight: 15 + region: content + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 120 + region: content + third_party_settings: { } + sticky: + type: boolean_checkbox + settings: + display_label: true + weight: 16 + region: content + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + region: content + third_party_settings: { } +hidden: { } diff --git a/modules/fahad/facility/config/install/core.entity_view_display.node.facility.default.yml b/modules/fahad/facility/config/install/core.entity_view_display.node.facility.default.yml new file mode 100644 index 0000000..71e3c6f --- /dev/null +++ b/modules/fahad/facility/config/install/core.entity_view_display.node.facility.default.yml @@ -0,0 +1,56 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.facility.body + - field.field.node.facility.field_facility_ + - field.field.node.facility.field_facility_image + - node.type.facility + module: + - image + - link + - text + - user + enforced: + module: + - facility +id: node.facility.default +targetEntityType: node +bundle: facility +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_facility_: + weight: 103 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_facility_image: + weight: 102 + label: above + settings: + image_style: '' + image_link: '' + third_party_settings: { } + type: image + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/fahad/facility/config/install/core.entity_view_display.node.facility.teaser.yml b/modules/fahad/facility/config/install/core.entity_view_display.node.facility.teaser.yml new file mode 100644 index 0000000..035fe40 --- /dev/null +++ b/modules/fahad/facility/config/install/core.entity_view_display.node.facility.teaser.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.facility.body + - node.type.facility + module: + - text + - user + enforced: + module: + - facility +id: node.facility.teaser +targetEntityType: node +bundle: facility +mode: teaser +content: + body: + label: hidden + type: text_summary_or_trimmed + weight: 101 + settings: + trim_length: 600 + third_party_settings: { } + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/fahad/facility/config/install/field.field.node.facility.body.yml b/modules/fahad/facility/config/install/field.field.node.facility.body.yml new file mode 100644 index 0000000..19634de --- /dev/null +++ b/modules/fahad/facility/config/install/field.field.node.facility.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.facility + module: + - text + enforced: + module: + - facility +id: node.facility.body +field_name: body +entity_type: node +bundle: facility +label: Body +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/fahad/facility/config/install/field.field.node.facility.field_facility_.yml b/modules/fahad/facility/config/install/field.field.node.facility.field_facility_.yml new file mode 100644 index 0000000..96146f2 --- /dev/null +++ b/modules/fahad/facility/config/install/field.field.node.facility.field_facility_.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_facility_ + - node.type.facility + module: + - link + enforced: + module: + - facility +id: node.facility.field_facility_ +field_name: field_facility_ +entity_type: node +bundle: facility +label: 'facility link' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/fahad/facility/config/install/field.field.node.facility.field_facility_image.yml b/modules/fahad/facility/config/install/field.field.node.facility.field_facility_image.yml new file mode 100644 index 0000000..3cbc23c --- /dev/null +++ b/modules/fahad/facility/config/install/field.field.node.facility.field_facility_image.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_facility_image + - node.type.facility + module: + - image + enforced: + module: + - facility +id: node.facility.field_facility_image +field_name: field_facility_image +entity_type: node +bundle: facility +label: 'facility image' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'png gif jpg jpeg' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: true + alt_field_required: true + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + handler: 'default:file' + handler_settings: { } +field_type: image diff --git a/modules/fahad/facility/config/install/field.storage.node.field_facility_.yml b/modules/fahad/facility/config/install/field.storage.node.field_facility_.yml new file mode 100644 index 0000000..02b2c92 --- /dev/null +++ b/modules/fahad/facility/config/install/field.storage.node.field_facility_.yml @@ -0,0 +1,22 @@ +uuid: 0fb10736-72c3-46f9-bd50-0380df9ca0e8 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - facility +id: node.field_facility_ +field_name: field_facility_ +entity_type: node +type: link +settings: { } +module: link +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/fahad/facility/config/install/field.storage.node.field_facility_image.yml b/modules/fahad/facility/config/install/field.storage.node.field_facility_image.yml new file mode 100644 index 0000000..b1dc938 --- /dev/null +++ b/modules/fahad/facility/config/install/field.storage.node.field_facility_image.yml @@ -0,0 +1,33 @@ +uuid: e5ae6aa1-7ca8-47bb-99a1-926d47c3427f +langcode: en +status: true +dependencies: + module: + - file + - image + - node + enforced: + module: + - facility +id: node.field_facility_image +field_name: field_facility_image +entity_type: node +type: image +settings: + uri_scheme: public + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + target_type: file + display_field: false + display_default: false +module: image +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/fahad/facility/config/install/node.type.facility.yml b/modules/fahad/facility/config/install/node.type.facility.yml new file mode 100644 index 0000000..37eee05 --- /dev/null +++ b/modules/fahad/facility/config/install/node.type.facility.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - facility +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: Facility +type: facility +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: true diff --git a/modules/fahad/facility/facility.info.yml b/modules/fahad/facility/facility.info.yml new file mode 100644 index 0000000..97a55f0 --- /dev/null +++ b/modules/fahad/facility/facility.info.yml @@ -0,0 +1,14 @@ +name: 'facility' +type: module +description: 'My Awesome Module' +core: 8.x +package: 'Custom' +dependencies: + - drupal:text + - drupal:image + - drupal:link + - drupal:path + - drupal:user + - drupal:node + - drupal:file + - drupal:menu_ui diff --git a/modules/fahad/facility/facility.module b/modules/fahad/facility/facility.module new file mode 100644 index 0000000..ee4bd23 --- /dev/null +++ b/modules/fahad/facility/facility.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains facility.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function facility_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the facility module. + case 'help.page.facility': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('My Awesome Module') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function facility_theme() { + return [ + 'facility' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/fahad/facility/templates/facility.html.twig b/modules/fahad/facility/templates/facility.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/fahad/facility/templates/facility.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/fahad/facility/tests/src/Functional/LoadTest.php b/modules/fahad/facility/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..10db5fe --- /dev/null +++ b/modules/fahad/facility/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\facility\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group facility + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['facility']; + + /** + * A user with permission to administer site configuration. + * + * @var \Drupal\user\UserInterface + */ + protected $user; + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->user = $this->drupalCreateUser(['administer site configuration']); + $this->drupalLogin($this->user); + } + + /** + * Tests that the home page loads with a 200 response. + */ + public function testLoad() { + $this->drupalGet(Url::fromRoute('<front>')); + $this->assertSession()->statusCodeEquals(200); + } + +} |