From 96794064b20917436ce73aedf015a9d53e8d00fb Mon Sep 17 00:00:00 2001 From: Fahad Israr Date: Tue, 2 Jul 2019 12:21:29 +0530 Subject: Custom Modules Added --- .../academic_calendar_content.info.yml | 13 +++ .../academic_calendar_content.module | 35 +++++++ .../fahad/academic_calendar_content/composer.json | 14 +++ ...play.node.academic_calendar_content.default.yml | 103 +++++++++++++++++++++ ...play.node.academic_calendar_content.default.yml | 50 ++++++++++ ...splay.node.academic_calendar_content.teaser.yml | 33 +++++++ ...d.field.node.academic_calendar_content.body.yml | 24 +++++ ...ademic_calendar_content.field_calender_file.yml | 29 ++++++ ...ademic_calendar_content.field_calender_type.yml | 31 +++++++ .../field.storage.node.field_calender_file.yml | 26 ++++++ .../field.storage.node.field_calender_type.yml | 23 +++++ .../node.type.academic_calendar_content.yml | 20 ++++ .../taxonomy.vocabulary.academic_calender.yml | 12 +++ .../templates/academic-calendar-content.html.twig | 1 + .../tests/src/Functional/LoadTest.php | 46 +++++++++ 15 files changed, 460 insertions(+) create mode 100644 modules/fahad/academic_calendar_content/academic_calendar_content.info.yml create mode 100644 modules/fahad/academic_calendar_content/academic_calendar_content.module create mode 100644 modules/fahad/academic_calendar_content/composer.json create mode 100644 modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml create mode 100644 modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml create mode 100644 modules/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig create mode 100644 modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php (limited to 'modules/fahad/academic_calendar_content') diff --git a/modules/fahad/academic_calendar_content/academic_calendar_content.info.yml b/modules/fahad/academic_calendar_content/academic_calendar_content.info.yml new file mode 100644 index 0000000..a3076e7 --- /dev/null +++ b/modules/fahad/academic_calendar_content/academic_calendar_content.info.yml @@ -0,0 +1,13 @@ +name: 'academic_calendar_content' +type: module +description: 'Academic Calendar Content Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:file + - drupal:path + - drupal:text + - drupal:user + - drupal:node + - drupal:menu_ui + - drupal:taxonomy \ No newline at end of file diff --git a/modules/fahad/academic_calendar_content/academic_calendar_content.module b/modules/fahad/academic_calendar_content/academic_calendar_content.module new file mode 100644 index 0000000..9b4e25a --- /dev/null +++ b/modules/fahad/academic_calendar_content/academic_calendar_content.module @@ -0,0 +1,35 @@ +' . t('About') . ''; + $output .= '
' . t('Academic Calendar Content Type') . '
'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function academic_calendar_content_theme() { + return [ + 'academic_calendar_content' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/fahad/academic_calendar_content/composer.json b/modules/fahad/academic_calendar_content/composer.json new file mode 100644 index 0000000..56c9201 --- /dev/null +++ b/modules/fahad/academic_calendar_content/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/academic_calendar_content", + "type": "drupal-module", + "description": "Academic Calendar Content Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/academic_calendar_content", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/academic_calendar_content", + "source": "http://cgit.drupalcode.org/academic_calendar_content" + }, + "require": { } +} diff --git a/modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml b/modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml new file mode 100644 index 0000000..480e11a --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml @@ -0,0 +1,103 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.academic_calendar_content.body + - field.field.node.academic_calendar_content.field_calender_file + - field.field.node.academic_calendar_content.field_calender_type + - node.type.academic_calendar_content + module: + - file + - path + - text + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.default +targetEntityType: node +bundle: academic_calendar_content +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_calender_file: + weight: 122 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + region: content + field_calender_type: + weight: 123 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + 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/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml new file mode 100644 index 0000000..24048f0 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml @@ -0,0 +1,50 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.academic_calendar_content.body + - field.field.node.academic_calendar_content.field_calender_file + - field.field.node.academic_calendar_content.field_calender_type + - node.type.academic_calendar_content + module: + - file + - text + - user + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.default +targetEntityType: node +bundle: academic_calendar_content +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_calender_file: + weight: 102 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + field_calender_type: + weight: 103 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml new file mode 100644 index 0000000..cb44542 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.academic_calendar_content.body + - node.type.academic_calendar_content + module: + - text + - user + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.teaser +targetEntityType: node +bundle: academic_calendar_content +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/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml new file mode 100644 index 0000000..4e036ce --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.academic_calendar_content + module: + - text + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.body +field_name: body +entity_type: node +bundle: academic_calendar_content +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/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml new file mode 100644 index 0000000..93aa78f --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_calender_file + - node.type.academic_calendar_content + module: + - file + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.field_calender_file +field_name: field_calender_file +entity_type: node +bundle: academic_calendar_content +label: 'calender file' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'txt pdf docx doc pptx ppt' + max_filesize: '' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml new file mode 100644 index 0000000..59ff251 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_calender_type + - node.type.academic_calendar_content + - taxonomy.vocabulary.academic_calender + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.field_calender_type +field_name: field_calender_type +entity_type: node +bundle: academic_calendar_content +label: 'Calender type' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + academic_calender: academic_calender + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml new file mode 100644 index 0000000..65a2c30 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml @@ -0,0 +1,26 @@ +uuid: fabaae87-0065-4967-8243-6515646f47ee +langcode: en +status: true +dependencies: + module: + - file + - node + enforced: + module: + - academic_calendar_content +id: node.field_calender_file +field_name: field_calender_file +entity_type: node +type: file +settings: + display_field: false + display_default: false + uri_scheme: public + target_type: file +module: file +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml new file mode 100644 index 0000000..cbe0fcf --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml @@ -0,0 +1,23 @@ +uuid: cd0df0ee-d712-40eb-bbbb-12a100fafb16 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - academic_calendar_content +id: node.field_calender_type +field_name: field_calender_type +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml b/modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml new file mode 100644 index 0000000..fdb758a --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - academic_calendar_content +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Academic Calendar' +type: academic_calendar_content +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: true diff --git a/modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml b/modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml new file mode 100644 index 0000000..cb954c2 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml @@ -0,0 +1,12 @@ +uuid: 216d49b2-aa1e-44b0-b4a0-7c3d78450276 +langcode: en +status: true +dependencies: + enforced: + module: + - academic_calendar_content +name: 'Academic Calender' +vid: academic_calender +description: 'Calendar and Time Table' +hierarchy: 0 +weight: 0 diff --git a/modules/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig b/modules/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php b/modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..b62009a --- /dev/null +++ b/modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +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('