diff options
author | Esha | 2019-07-02 12:42:54 +0530 |
---|---|---|
committer | Esha | 2019-07-02 12:43:10 +0530 |
commit | 141ce8c97abe36f1f8bb06a38623e93563d6c618 (patch) | |
tree | 2086c9224072aa7b917da20487b232eb2ef0666e | |
parent | 847360bf5ac011771dc013677542ece7b356a528 (diff) | |
download | acadmix_distribution-141ce8c97abe36f1f8bb06a38623e93563d6c618.tar.gz acadmix_distribution-141ce8c97abe36f1f8bb06a38623e93563d6c618.tar.bz2 acadmix_distribution-141ce8c97abe36f1f8bb06a38623e93563d6c618.zip |
Custom modules
170 files changed, 4912 insertions, 0 deletions
diff --git a/modules/esha/achievements/achievements.info.yml b/modules/esha/achievements/achievements.info.yml new file mode 100644 index 0000000..3ed1004 --- /dev/null +++ b/modules/esha/achievements/achievements.info.yml @@ -0,0 +1,11 @@ +name: 'achievements' +type: module +description: 'Module for Achievements Placement Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:path + - drupal:user + - drupal:node + - drupal:taxonomy + - drupal:menu_ui diff --git a/modules/esha/achievements/achievements.install b/modules/esha/achievements/achievements.install new file mode 100644 index 0000000..4599c02 --- /dev/null +++ b/modules/esha/achievements/achievements.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function achievements_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'achievements'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/achievements/achievements.module b/modules/esha/achievements/achievements.module new file mode 100644 index 0000000..76939d9 --- /dev/null +++ b/modules/esha/achievements/achievements.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains achievements.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function achievements_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the achievements module. + case 'help.page.achievements': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Achievements Placement Type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function achievements_theme() { + return [ + 'achievements' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/achievements/achievements.routing.yml b/modules/esha/achievements/achievements.routing.yml new file mode 100644 index 0000000..e3f475c --- /dev/null +++ b/modules/esha/achievements/achievements.routing.yml @@ -0,0 +1,8 @@ + +achievements.achievement_controller_hello: + path: '/achievements/hello/{name}' + defaults: + _controller: '\Drupal\achievements\Controller\achievementController::hello' + _title: 'control' + requirements: + _permission: 'access content' diff --git a/modules/esha/achievements/composer.json b/modules/esha/achievements/composer.json new file mode 100644 index 0000000..34e90d8 --- /dev/null +++ b/modules/esha/achievements/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/achievements", + "type": "drupal-module", + "description": "Module for Achievements Placement Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/achievements", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/achievements", + "source": "http://cgit.drupalcode.org/achievements" + }, + "require": { } +} diff --git a/modules/esha/achievements/config/install/core.entity_form_display.node.achievements.default.yml b/modules/esha/achievements/config/install/core.entity_form_display.node.achievements.default.yml new file mode 100644 index 0000000..d77ebe5 --- /dev/null +++ b/modules/esha/achievements/config/install/core.entity_form_display.node.achievements.default.yml @@ -0,0 +1,92 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.achievements.field_achievement_description + - field.field.node.achievements.field_achievement_type + - node.type.achievements + module: + - path + enforced: + module: + - achievements +id: node.achievements.default +targetEntityType: node +bundle: achievements +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_achievement_description: + weight: 123 + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + type: string_textarea + region: content + field_achievement_type: + weight: 122 + 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/esha/achievements/config/install/core.entity_view_display.node.achievements.default.yml b/modules/esha/achievements/config/install/core.entity_view_display.node.achievements.default.yml new file mode 100644 index 0000000..1ed7439 --- /dev/null +++ b/modules/esha/achievements/config/install/core.entity_view_display.node.achievements.default.yml @@ -0,0 +1,39 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.achievements.field_achievement_description + - field.field.node.achievements.field_achievement_type + - node.type.achievements + module: + - user + enforced: + module: + - achievements +id: node.achievements.default +targetEntityType: node +bundle: achievements +mode: default +content: + field_achievement_description: + weight: 103 + label: above + settings: { } + third_party_settings: { } + type: basic_string + region: content + field_achievement_type: + weight: 102 + 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/esha/achievements/config/install/core.entity_view_display.node.achievements.teaser.yml b/modules/esha/achievements/config/install/core.entity_view_display.node.achievements.teaser.yml new file mode 100644 index 0000000..a10099d --- /dev/null +++ b/modules/esha/achievements/config/install/core.entity_view_display.node.achievements.teaser.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.achievements.field_achievement_type + - node.type.achievements + module: + - user + enforced: + module: + - achievements +id: node.achievements.teaser +targetEntityType: node +bundle: achievements +mode: teaser +content: + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + field_achievement_type: true + langcode: true diff --git a/modules/esha/achievements/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/achievements/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..83ada37 --- /dev/null +++ b/modules/esha/achievements/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,15 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - achievements +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/achievements/config/install/field.field.node.achievements.field_achievement_description.yml b/modules/esha/achievements/config/install/field.field.node.achievements.field_achievement_description.yml new file mode 100644 index 0000000..99b94d2 --- /dev/null +++ b/modules/esha/achievements/config/install/field.field.node.achievements.field_achievement_description.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_achievement_description + - node.type.achievements + enforced: + module: + - achievements +id: node.achievements.field_achievement_description +field_name: field_achievement_description +entity_type: node +bundle: achievements +label: 'Achievement Description' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string_long diff --git a/modules/esha/achievements/config/install/field.field.node.achievements.field_achievement_type.yml b/modules/esha/achievements/config/install/field.field.node.achievements.field_achievement_type.yml new file mode 100644 index 0000000..24f0ec1 --- /dev/null +++ b/modules/esha/achievements/config/install/field.field.node.achievements.field_achievement_type.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_achievement_type + - node.type.achievements + - taxonomy.vocabulary.achievement + enforced: + module: + - achievements +id: node.achievements.field_achievement_type +field_name: field_achievement_type +entity_type: node +bundle: achievements +label: 'Achievement Type' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + achievement: achievement + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/achievements/config/install/field.storage.node.field_achievement_description.yml b/modules/esha/achievements/config/install/field.storage.node.field_achievement_description.yml new file mode 100644 index 0000000..fcd5c47 --- /dev/null +++ b/modules/esha/achievements/config/install/field.storage.node.field_achievement_description.yml @@ -0,0 +1,22 @@ +uuid: 10af3d6e-5dd8-4248-a517-ad48ef3d8f62 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - achievements +id: node.field_achievement_description +field_name: field_achievement_description +entity_type: node +type: string_long +settings: + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/achievements/config/install/field.storage.node.field_achievement_type.yml b/modules/esha/achievements/config/install/field.storage.node.field_achievement_type.yml new file mode 100644 index 0000000..6a01531 --- /dev/null +++ b/modules/esha/achievements/config/install/field.storage.node.field_achievement_type.yml @@ -0,0 +1,23 @@ +uuid: 01281d95-1c9e-4ada-b282-a81737d96e79 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - achievements +id: node.field_achievement_type +field_name: field_achievement_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/esha/achievements/config/install/migrate_plus.migration.sample_achievements_import.yml b/modules/esha/achievements/config/install/migrate_plus.migration.sample_achievements_import.yml new file mode 100644 index 0000000..41919df --- /dev/null +++ b/modules/esha/achievements/config/install/migrate_plus.migration.sample_achievements_import.yml @@ -0,0 +1,36 @@ +uuid: 3397f245-46fb-426c-bc42-4ea803dca435 +langcode: en +status: true +id: sample_achievements_import +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: null +migration_group: default +label: 'Sample Achievements Import' +source: + plugin: csv + path: /var/www/CSV/achievements_sample.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id +process: + type: + plugin: default_value + default_value: achievements + title: title + field_achievement_description: description + field_achievement_type: + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle: achievement + source: type +destination: + plugin: 'entity:node' + bundle: achievements +migration_dependencies: + required: { } + optional: { } diff --git a/modules/esha/achievements/config/install/node.type.achievements.yml b/modules/esha/achievements/config/install/node.type.achievements.yml new file mode 100644 index 0000000..f2fccbb --- /dev/null +++ b/modules/esha/achievements/config/install/node.type.achievements.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - achievements +# third_party_settings: +# menu_ui: +# available_menus: +# - main +# parent: 'main:' +name: Achievements +type: achievements +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/achievements/config/install/taxonomy.vocabulary.achievement.yml b/modules/esha/achievements/config/install/taxonomy.vocabulary.achievement.yml new file mode 100644 index 0000000..0d6ce9c --- /dev/null +++ b/modules/esha/achievements/config/install/taxonomy.vocabulary.achievement.yml @@ -0,0 +1,12 @@ +uuid: 67cd72f5-de5c-476a-b102-813963ef0b9f +langcode: en +status: true +dependencies: + enforced: + module: + - achievements +name: Achievement +vid: achievement +description: 'Achieved by Staff/Students' +hierarchy: 0 +weight: 0 diff --git a/modules/esha/achievements/src/Controller/achievementController.php b/modules/esha/achievements/src/Controller/achievementController.php new file mode 100644 index 0000000..04f947e --- /dev/null +++ b/modules/esha/achievements/src/Controller/achievementController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\achievements\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class achievementController. + */ +class achievementController extends ControllerBase { + + /** + * Hello. + * + * @return string + * Return Hello string. + */ + public function hello($name) { + return [ + '#type' => 'markup', + '#markup' => $this->t('Implement method: hello with parameter(s): $name'), + ]; + } + +} diff --git a/modules/esha/achievements/templates/achievements.html.twig b/modules/esha/achievements/templates/achievements.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/achievements/templates/achievements.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/achievements/tests/src/Functional/LoadTest.php b/modules/esha/achievements/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..0d54e64 --- /dev/null +++ b/modules/esha/achievements/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\achievements\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group achievements + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['achievements']; + + /** + * 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); + } + +} diff --git a/modules/esha/corporate/composer.json b/modules/esha/corporate/composer.json new file mode 100644 index 0000000..f8f0e32 --- /dev/null +++ b/modules/esha/corporate/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/corporate", + "type": "drupal-module", + "description": "Module for Corporate Advisory Board Content Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/corporate", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/corporate", + "source": "http://cgit.drupalcode.org/corporate" + }, + "require": { } +} diff --git a/modules/esha/corporate/config/install/core.entity_form_display.node.corporate_advisory_board.default.yml b/modules/esha/corporate/config/install/core.entity_form_display.node.corporate_advisory_board.default.yml new file mode 100644 index 0000000..d36c401 --- /dev/null +++ b/modules/esha/corporate/config/install/core.entity_form_display.node.corporate_advisory_board.default.yml @@ -0,0 +1,112 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.corporate_advisory_board.field_company_image + - field.field.node.corporate_advisory_board.field_company_website + - field.field.node.corporate_advisory_board.field_designation + - field.field.node.corporate_advisory_board.field_member_image + - image.style.thumbnail + - node.type.corporate_advisory_board + module: + - image + - link + - path + enforced: + module: + - corporate +id: node.corporate_advisory_board.default +targetEntityType: node +bundle: corporate_advisory_board +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_company_image: + weight: 124 + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + type: image_image + region: content + field_company_website: + weight: 127 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_designation: + weight: 126 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_member_image: + weight: 123 + 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/esha/corporate/config/install/core.entity_view_display.node.corporate_advisory_board.default.yml b/modules/esha/corporate/config/install/core.entity_view_display.node.corporate_advisory_board.default.yml new file mode 100644 index 0000000..b543a8c --- /dev/null +++ b/modules/esha/corporate/config/install/core.entity_view_display.node.corporate_advisory_board.default.yml @@ -0,0 +1,66 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.corporate_advisory_board.field_company_image + - field.field.node.corporate_advisory_board.field_company_website + - field.field.node.corporate_advisory_board.field_designation + - field.field.node.corporate_advisory_board.field_member_image + - node.type.corporate_advisory_board + module: + - image + - link + - user + enforced: + module: + - corporate +id: node.corporate_advisory_board.default +targetEntityType: node +bundle: corporate_advisory_board +mode: default +content: + field_company_image: + weight: 104 + label: above + settings: + image_style: '' + image_link: '' + third_party_settings: { } + type: image + region: content + field_company_website: + weight: 107 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_designation: + weight: 106 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_member_image: + weight: 103 + 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/esha/corporate/config/install/core.entity_view_display.node.corporate_advisory_board.teaser.yml b/modules/esha/corporate/config/install/core.entity_view_display.node.corporate_advisory_board.teaser.yml new file mode 100644 index 0000000..999478f --- /dev/null +++ b/modules/esha/corporate/config/install/core.entity_view_display.node.corporate_advisory_board.teaser.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.corporate_advisory_board.field_company_image + - field.field.node.corporate_advisory_board.field_company_website + - field.field.node.corporate_advisory_board.field_designation + - field.field.node.corporate_advisory_board.field_member_image + - node.type.corporate_advisory_board + module: + - user + enforced: + module: + - corporate +id: node.corporate_advisory_board.teaser +targetEntityType: node +bundle: corporate_advisory_board +mode: teaser +content: + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + field_company_image: true + field_company_website: true + field_designation: true + field_member_image: true + langcode: true diff --git a/modules/esha/corporate/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/corporate/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..4632edd --- /dev/null +++ b/modules/esha/corporate/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,15 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - corporate +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_company_image.yml b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_company_image.yml new file mode 100644 index 0000000..f56d0c8 --- /dev/null +++ b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_company_image.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_company_image + - node.type.corporate_advisory_board + module: + - image + enforced: + module: + - corporate +id: node.corporate_advisory_board.field_company_image +field_name: field_company_image +entity_type: node +bundle: corporate_advisory_board +label: 'Company Image' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: company_images + 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/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_company_website.yml b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_company_website.yml new file mode 100644 index 0000000..c7ed791 --- /dev/null +++ b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_company_website.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_company_website + - node.type.corporate_advisory_board + module: + - link + enforced: + module: + - corporate +id: node.corporate_advisory_board.field_company_website +field_name: field_company_website +entity_type: node +bundle: corporate_advisory_board +label: 'Company Website' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_designation.yml b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_designation.yml new file mode 100644 index 0000000..0cc1355 --- /dev/null +++ b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_designation.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_designation + - node.type.corporate_advisory_board + enforced: + module: + - corporate +id: node.corporate_advisory_board.field_designation +field_name: field_designation +entity_type: node +bundle: corporate_advisory_board +label: Designation +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_member_image.yml b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_member_image.yml new file mode 100644 index 0000000..7369e23 --- /dev/null +++ b/modules/esha/corporate/config/install/field.field.node.corporate_advisory_board.field_member_image.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_member_image + - node.type.corporate_advisory_board + module: + - image + enforced: + module: + - corporate +id: node.corporate_advisory_board.field_member_image +field_name: field_member_image +entity_type: node +bundle: corporate_advisory_board +label: 'Member Image' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: member_images + 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/esha/corporate/config/install/field.storage.node.field_company_image.yml b/modules/esha/corporate/config/install/field.storage.node.field_company_image.yml new file mode 100644 index 0000000..04fafea --- /dev/null +++ b/modules/esha/corporate/config/install/field.storage.node.field_company_image.yml @@ -0,0 +1,33 @@ +uuid: 336c9ebe-441b-4df5-a485-f0952792019a +langcode: en +status: true +dependencies: + module: + - file + - image + - node + enforced: + module: + - corporate +id: node.field_company_image +field_name: field_company_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/esha/corporate/config/install/field.storage.node.field_company_website.yml b/modules/esha/corporate/config/install/field.storage.node.field_company_website.yml new file mode 100644 index 0000000..042889c --- /dev/null +++ b/modules/esha/corporate/config/install/field.storage.node.field_company_website.yml @@ -0,0 +1,22 @@ +uuid: 72f4d1c6-fa6c-4cc5-9576-459ec47a6b92 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - corporate +id: node.field_company_website +field_name: field_company_website +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/esha/corporate/config/install/field.storage.node.field_designation.yml b/modules/esha/corporate/config/install/field.storage.node.field_designation.yml new file mode 100644 index 0000000..290e6bd --- /dev/null +++ b/modules/esha/corporate/config/install/field.storage.node.field_designation.yml @@ -0,0 +1,24 @@ +uuid: d9a05868-ce4b-438b-a119-010249e41825 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - corporate +id: node.field_designation +field_name: field_designation +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/corporate/config/install/field.storage.node.field_member_image.yml b/modules/esha/corporate/config/install/field.storage.node.field_member_image.yml new file mode 100644 index 0000000..853284c --- /dev/null +++ b/modules/esha/corporate/config/install/field.storage.node.field_member_image.yml @@ -0,0 +1,33 @@ +uuid: 84e3a771-4aa4-4043-9aa2-cd55ab247360 +langcode: en +status: true +dependencies: + module: + - file + - image + - node + enforced: + module: + - corporate +id: node.field_member_image +field_name: field_member_image +entity_type: node +type: image +settings: + uri_scheme: public + default_image: + uuid: a9cd611f-92e3-4762-a504-f6b017a5136c + alt: '' + title: '' + width: 65 + height: 84 + 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/esha/corporate/config/install/image.style.thumbnail.yml b/modules/esha/corporate/config/install/image.style.thumbnail.yml new file mode 100644 index 0000000..7389c76 --- /dev/null +++ b/modules/esha/corporate/config/install/image.style.thumbnail.yml @@ -0,0 +1,20 @@ +uuid: 253400b6-2e54-4c6a-92ba-9ccb091444e2 +langcode: en +status: true +dependencies: + enforced: + module: + - corporate +_core: + default_config_hash: cCiWdBHgLwj5omG35lsKc4LkW4MBdmcctkVop4ol5x0 +name: thumbnail +label: 'Thumbnail (100×100)' +effects: + 1cfec298-8620-4749-b100-ccb6c4500779: + uuid: 1cfec298-8620-4749-b100-ccb6c4500779 + id: image_scale + weight: 0 + data: + width: 100 + height: 100 + upscale: false diff --git a/modules/esha/corporate/config/install/migrate_plus.migration.cab_import.yml b/modules/esha/corporate/config/install/migrate_plus.migration.cab_import.yml new file mode 100644 index 0000000..fbed94a --- /dev/null +++ b/modules/esha/corporate/config/install/migrate_plus.migration.cab_import.yml @@ -0,0 +1,69 @@ +uuid: 52455ef5-b766-4149-94d0-aa2af3ef7639 +id: cab_import +label: cab +migration_group: default +source: + plugin: csv + # Full path to the file. + path: '/var/www/CSV/corp1.csv' + # Column delimiter. Comma (,) by default. + delimiter: ',' + # Field enclosure. Double quotation marks (") by default. + enclosure: '"' + # The number of rows at the beginning which are not data. + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/corporate + file_dest: 'public://member_images/' + file_source2: /var/www/corporate + file_dest2: 'public://company_images/' +process: + type: + plugin: default_value + default_value: corporate_advisory_board + source_path: + - + plugin: skip_on_empty + method: process + source: memberimg + - + plugin: concat + delimiter: / + source: + - constants/file_source + - memberimg + source_path2: + - + plugin: skip_on_empty + method: process + source: companyimg + - + plugin: concat + delimiter: / + source: + - constants/file_source2 + - companyimg + title: title + body/value: body + body/format: + - + plugin: default_value + default_value: basic_html + field_company_website/uri: website + field_designation: designation + field_member_image: + plugin: file_import + source: '@source_path' + destination: constants/file_dest + field_company_image: + plugin: file_import + source: '@source_path2' + destination: constants/file_dest2 +destination: + plugin: 'entity:node' + bundle: corporate_advisory_board +migration_dependencies: + required: { } + optional: { } diff --git a/modules/esha/corporate/config/install/node.type.corporate_advisory_board.yml b/modules/esha/corporate/config/install/node.type.corporate_advisory_board.yml new file mode 100644 index 0000000..5f30bd4 --- /dev/null +++ b/modules/esha/corporate/config/install/node.type.corporate_advisory_board.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - corporate +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Corporate Advisory Board' +type: corporate_advisory_board +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/corporate/corporate.info.yml b/modules/esha/corporate/corporate.info.yml new file mode 100644 index 0000000..305c165 --- /dev/null +++ b/modules/esha/corporate/corporate.info.yml @@ -0,0 +1,14 @@ +name: 'corporate' +type: module +description: 'Module for Corporate Advisory Board Content Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:menu_ui + - drupal:image + - drupal:link + - drupal:path + - drupal:user + - drupal:node + - drupal:image + - drupal:file
\ No newline at end of file diff --git a/modules/esha/corporate/corporate.install b/modules/esha/corporate/corporate.install new file mode 100644 index 0000000..2a56fd7 --- /dev/null +++ b/modules/esha/corporate/corporate.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function corporate_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'corporate_advisory_board'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/corporate/corporate.module b/modules/esha/corporate/corporate.module new file mode 100644 index 0000000..de3e265 --- /dev/null +++ b/modules/esha/corporate/corporate.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains corporate.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function corporate_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the corporate module. + case 'help.page.corporate': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Corporate Advisory Board Content Type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function corporate_theme() { + return [ + 'corporate' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/corporate/templates/corporate.html.twig b/modules/esha/corporate/templates/corporate.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/corporate/templates/corporate.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/corporate/tests/src/Functional/LoadTest.php b/modules/esha/corporate/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..8e09521 --- /dev/null +++ b/modules/esha/corporate/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\corporate\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group corporate + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['corporate']; + + /** + * 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); + } + +} diff --git a/modules/esha/lab/composer.json b/modules/esha/lab/composer.json new file mode 100644 index 0000000..70ee9e7 --- /dev/null +++ b/modules/esha/lab/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/lab", + "type": "drupal-module", + "description": "Module for Lab Content Tyoe", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/lab", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/lab", + "source": "http://cgit.drupalcode.org/lab" + }, + "require": { } +} diff --git a/modules/esha/lab/config/install/core.entity_form_display.node.lab.default.yml b/modules/esha/lab/config/install/core.entity_form_display.node.lab.default.yml new file mode 100644 index 0000000..71f1994 --- /dev/null +++ b/modules/esha/lab/config/install/core.entity_form_display.node.lab.default.yml @@ -0,0 +1,138 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.lab.field_description_ + - field.field.node.lab.field_faculty_e_mail + - field.field.node.lab.field_faculty_incharge + - field.field.node.lab.field_faculty_phone_no + - field.field.node.lab.field_hardware_software_details + - field.field.node.lab.field_location + - field.field.node.lab.field_programmer_name + - node.type.lab + module: + - paragraphs + - path +id: node.lab.default +targetEntityType: node +bundle: lab +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_description_: + weight: 129 + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + type: string_textarea + region: content + field_faculty_e_mail: + weight: 127 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: email_default + region: content + field_faculty_incharge: + weight: 124 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_faculty_phone_no: + weight: 128 + settings: + placeholder: '' + third_party_settings: { } + type: number + region: content + field_hardware_software_details: + type: entity_reference_paragraphs + weight: 126 + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: open + add_mode: dropdown + form_display_mode: default + default_paragraph_type: '' + third_party_settings: { } + region: content + field_location: + weight: 122 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_programmer_name: + weight: 125 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + 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/esha/lab/config/install/core.entity_view_display.node.lab.default.yml b/modules/esha/lab/config/install/core.entity_view_display.node.lab.default.yml new file mode 100644 index 0000000..d2e7fb7 --- /dev/null +++ b/modules/esha/lab/config/install/core.entity_view_display.node.lab.default.yml @@ -0,0 +1,83 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.lab.field_description_ + - field.field.node.lab.field_faculty_e_mail + - field.field.node.lab.field_faculty_incharge + - field.field.node.lab.field_faculty_phone_no + - field.field.node.lab.field_hardware_software_details + - field.field.node.lab.field_location + - field.field.node.lab.field_programmer_name + - node.type.lab + module: + - entity_reference_revisions + - user +id: node.lab.default +targetEntityType: node +bundle: lab +mode: default +content: + field_description_: + weight: 109 + label: above + settings: { } + third_party_settings: { } + type: basic_string + region: content + field_faculty_e_mail: + weight: 107 + label: above + settings: { } + third_party_settings: { } + type: basic_string + region: content + field_faculty_incharge: + weight: 104 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_faculty_phone_no: + weight: 108 + label: above + settings: + thousand_separator: '' + prefix_suffix: true + third_party_settings: { } + type: number_integer + region: content + field_hardware_software_details: + type: entity_reference_revisions_entity_view + weight: 106 + label: above + settings: + view_mode: default + link: '' + third_party_settings: { } + region: content + field_location: + weight: 102 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_programmer_name: + weight: 105 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/esha/lab/config/install/core.entity_view_display.node.lab.teaser.yml b/modules/esha/lab/config/install/core.entity_view_display.node.lab.teaser.yml new file mode 100644 index 0000000..41ceb2a --- /dev/null +++ b/modules/esha/lab/config/install/core.entity_view_display.node.lab.teaser.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.lab.field_location + - node.type.lab + module: + - user +id: node.lab.teaser +targetEntityType: node +bundle: lab +mode: teaser +content: + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + field_location: true + langcode: true diff --git a/modules/esha/lab/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/lab/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..fb7a35a --- /dev/null +++ b/modules/esha/lab/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,12 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_description_.yml b/modules/esha/lab/config/install/field.field.node.lab.field_description_.yml new file mode 100644 index 0000000..d604ec4 --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_description_.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_description_ + - node.type.lab +id: node.lab.field_description_ +field_name: field_description_ +entity_type: node +bundle: lab +label: Description +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string_long diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_faculty_e_mail.yml b/modules/esha/lab/config/install/field.field.node.lab.field_faculty_e_mail.yml new file mode 100644 index 0000000..39dfaeb --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_faculty_e_mail.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_faculty_e_mail + - node.type.lab +id: node.lab.field_faculty_e_mail +field_name: field_faculty_e_mail +entity_type: node +bundle: lab +label: 'Faculty E-Mail' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: email diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_faculty_incharge.yml b/modules/esha/lab/config/install/field.field.node.lab.field_faculty_incharge.yml new file mode 100644 index 0000000..21bfc1c --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_faculty_incharge.yml @@ -0,0 +1,27 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_faculty_incharge + - node.type.fac_page + - node.type.lab +id: node.lab.field_faculty_incharge +field_name: field_faculty_incharge +entity_type: node +bundle: lab +label: 'Faculty Incharge' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + fac_page: fac_page + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_faculty_phone_no.yml b/modules/esha/lab/config/install/field.field.node.lab.field_faculty_phone_no.yml new file mode 100644 index 0000000..9e0b7bd --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_faculty_phone_no.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_faculty_phone_no + - node.type.lab +id: node.lab.field_faculty_phone_no +field_name: field_faculty_phone_no +entity_type: node +bundle: lab +label: 'Faculty Phone No' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + min: null + max: null + prefix: '' + suffix: '' +field_type: integer diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_hardware_software_details.yml b/modules/esha/lab/config/install/field.field.node.lab.field_hardware_software_details.yml new file mode 100644 index 0000000..a51d802 --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_hardware_software_details.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_hardware_software_details + - node.type.lab + - paragraphs.paragraphs_type.hardware_and_software + module: + - entity_reference_revisions +id: node.lab.field_hardware_software_details +field_name: field_hardware_software_details +entity_type: node +bundle: lab +label: 'Hardware Software Details' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + negate: 0 + target_bundles: + hardware_and_software: hardware_and_software + target_bundles_drag_drop: + hardware_and_software: + enabled: true + weight: 3 + r_d_projects: + weight: 4 + enabled: false +field_type: entity_reference_revisions diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_location.yml b/modules/esha/lab/config/install/field.field.node.lab.field_location.yml new file mode 100644 index 0000000..d1eb382 --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_location.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_location + - node.type.lab +id: node.lab.field_location +field_name: field_location +entity_type: node +bundle: lab +label: Location +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/esha/lab/config/install/field.field.node.lab.field_programmer_name.yml b/modules/esha/lab/config/install/field.field.node.lab.field_programmer_name.yml new file mode 100644 index 0000000..d192d1c --- /dev/null +++ b/modules/esha/lab/config/install/field.field.node.lab.field_programmer_name.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_programmer_name + - node.type.lab +id: node.lab.field_programmer_name +field_name: field_programmer_name +entity_type: node +bundle: lab +label: 'Programmer Name' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/esha/lab/config/install/field.storage.node.field_description_.yml b/modules/esha/lab/config/install/field.storage.node.field_description_.yml new file mode 100644 index 0000000..c156a3f --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_description_.yml @@ -0,0 +1,19 @@ +uuid: 7083d7bf-4a82-442a-b247-b5e3efefee5f +langcode: en +status: true +dependencies: + module: + - node +id: node.field_description_ +field_name: field_description_ +entity_type: node +type: string_long +settings: + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/field.storage.node.field_faculty_e_mail.yml b/modules/esha/lab/config/install/field.storage.node.field_faculty_e_mail.yml new file mode 100644 index 0000000..de20bf6 --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_faculty_e_mail.yml @@ -0,0 +1,18 @@ +uuid: a72bd7c5-3bcc-469c-bc4d-7e53dcdecbfc +langcode: en +status: true +dependencies: + module: + - node +id: node.field_faculty_e_mail +field_name: field_faculty_e_mail +entity_type: node +type: email +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/field.storage.node.field_faculty_incharge.yml b/modules/esha/lab/config/install/field.storage.node.field_faculty_incharge.yml new file mode 100644 index 0000000..0740b62 --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_faculty_incharge.yml @@ -0,0 +1,19 @@ +uuid: 72d5df56-23f1-40ee-9cdb-47ce8ccd35dd +langcode: en +status: true +dependencies: + module: + - node +id: node.field_faculty_incharge +field_name: field_faculty_incharge +entity_type: node +type: entity_reference +settings: + target_type: node +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/field.storage.node.field_faculty_phone_no.yml b/modules/esha/lab/config/install/field.storage.node.field_faculty_phone_no.yml new file mode 100644 index 0000000..bdf060a --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_faculty_phone_no.yml @@ -0,0 +1,20 @@ +uuid: cb625a44-0a19-4b8f-ba64-ecccd03f85fb +langcode: en +status: true +dependencies: + module: + - node +id: node.field_faculty_phone_no +field_name: field_faculty_phone_no +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/field.storage.node.field_hardware_software_details.yml b/modules/esha/lab/config/install/field.storage.node.field_hardware_software_details.yml new file mode 100644 index 0000000..09fbf27 --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_hardware_software_details.yml @@ -0,0 +1,21 @@ +uuid: 40b4ca5d-093c-45da-8170-51f3bee83c1b +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - node + - paragraphs +id: node.field_hardware_software_details +field_name: field_hardware_software_details +entity_type: node +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/field.storage.node.field_location.yml b/modules/esha/lab/config/install/field.storage.node.field_location.yml new file mode 100644 index 0000000..d5ce75d --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_location.yml @@ -0,0 +1,21 @@ +uuid: 55b23e0b-33a5-4ed4-9d9a-17ee0abf3440 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_location +field_name: field_location +entity_type: node +type: string +settings: + max_length: 300 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/field.storage.node.field_programmer_name.yml b/modules/esha/lab/config/install/field.storage.node.field_programmer_name.yml new file mode 100644 index 0000000..b5c1a4c --- /dev/null +++ b/modules/esha/lab/config/install/field.storage.node.field_programmer_name.yml @@ -0,0 +1,21 @@ +uuid: 6db8388e-26d0-489f-a2c8-b97aeaba5951 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_programmer_name +field_name: field_programmer_name +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/lab/config/install/node.type.fac_page.yml b/modules/esha/lab/config/install/node.type.fac_page.yml new file mode 100644 index 0000000..47f8ffb --- /dev/null +++ b/modules/esha/lab/config/install/node.type.fac_page.yml @@ -0,0 +1,23 @@ +uuid: b7471e78-83f0-4359-9512-d4a8f02c2218 +langcode: en +status: true +dependencies: + enforced: + module: + - acadmix_faculty + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +_core: + default_config_hash: yZnGgm-oTEuH3Qz8VcW49f94qFn-pYOYZdrX601an0U +name: 'Faculty Page' +type: fac_page +description: 'Content template for opening Faculty Page' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/lab/config/install/node.type.lab.yml b/modules/esha/lab/config/install/node.type.lab.yml new file mode 100644 index 0000000..e5a2e2a --- /dev/null +++ b/modules/esha/lab/config/install/node.type.lab.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: Lab +type: lab +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/lab/config/install/paragraphs.paragraphs_type.hardware_and_software.yml b/modules/esha/lab/config/install/paragraphs.paragraphs_type.hardware_and_software.yml new file mode 100644 index 0000000..f7b105e --- /dev/null +++ b/modules/esha/lab/config/install/paragraphs.paragraphs_type.hardware_and_software.yml @@ -0,0 +1,9 @@ +uuid: c3df85d3-cc1d-408b-b115-17a70677f6d8 +langcode: en +status: true +dependencies: { } +id: hardware_and_software +label: 'Hardware and Software' +icon_uuid: null +description: '' +behavior_plugins: { } diff --git a/modules/esha/lab/lab.info.yml b/modules/esha/lab/lab.info.yml new file mode 100644 index 0000000..8507cd7 --- /dev/null +++ b/modules/esha/lab/lab.info.yml @@ -0,0 +1,12 @@ +name: 'lab' +type: module +description: 'Module for Lab Content Tyoe' +core: 8.x +package: 'Custom' +dependencies: + - drupal:paragraphs + - drupal:path + - drupal:entity_reference_revisions + - drupal:user + - drupal:node + - drupal:menu_ui diff --git a/modules/esha/lab/lab.install b/modules/esha/lab/lab.install new file mode 100644 index 0000000..376861b --- /dev/null +++ b/modules/esha/lab/lab.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function lab_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'lab'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/lab/lab.module b/modules/esha/lab/lab.module new file mode 100644 index 0000000..65a0b7e --- /dev/null +++ b/modules/esha/lab/lab.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains lab.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function lab_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the lab module. + case 'help.page.lab': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Lab Content Tyoe') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function lab_theme() { + return [ + 'lab' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/lab/templates/lab.html.twig b/modules/esha/lab/templates/lab.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/lab/templates/lab.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/lab/tests/src/Functional/LoadTest.php b/modules/esha/lab/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..918be07 --- /dev/null +++ b/modules/esha/lab/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\lab\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group lab + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['lab']; + + /** + * 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); + } + +} diff --git a/modules/esha/labmanual/composer.json b/modules/esha/labmanual/composer.json new file mode 100644 index 0000000..babdf95 --- /dev/null +++ b/modules/esha/labmanual/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/labmanual", + "type": "drupal-module", + "description": "Module for Lab Manual Content Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/labmanual", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/labmanual", + "source": "http://cgit.drupalcode.org/labmanual" + }, + "require": { } +} diff --git a/modules/esha/labmanual/config/install/core.entity_form_display.node.lab_manual.default.yml b/modules/esha/labmanual/config/install/core.entity_form_display.node.lab_manual.default.yml new file mode 100644 index 0000000..084c912 --- /dev/null +++ b/modules/esha/labmanual/config/install/core.entity_form_display.node.lab_manual.default.yml @@ -0,0 +1,91 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.lab_manual.field_description + - field.field.node.lab_manual.field_manual + - node.type.lab_manual + module: + - file + - path + enforced: + module: + - labmanual +id: node.lab_manual.default +targetEntityType: node +bundle: lab_manual +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_description: + weight: 122 + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + type: string_textarea + region: content + field_manual: + weight: 123 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + 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/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.default.yml b/modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.default.yml new file mode 100644 index 0000000..a04bdb4 --- /dev/null +++ b/modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.default.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.lab_manual.field_description + - field.field.node.lab_manual.field_manual + - node.type.lab_manual + module: + - file + - user + enforced: + module: + - labmanual +id: node.lab_manual.default +targetEntityType: node +bundle: lab_manual +mode: default +content: + field_description: + weight: 102 + label: above + settings: { } + third_party_settings: { } + type: basic_string + region: content + field_manual: + weight: 103 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.teaser.yml b/modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.teaser.yml new file mode 100644 index 0000000..d083bbc --- /dev/null +++ b/modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.teaser.yml @@ -0,0 +1,27 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.lab_manual.field_description + - field.field.node.lab_manual.field_manual + - node.type.lab_manual + module: + - user + enforced: + module: + - labmanual +id: node.lab_manual.teaser +targetEntityType: node +bundle: lab_manual +mode: teaser +content: + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + field_description: true + field_manual: true + langcode: true diff --git a/modules/esha/labmanual/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/labmanual/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..ce0398e --- /dev/null +++ b/modules/esha/labmanual/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,15 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - labmanual +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/labmanual/config/install/field.field.node.lab_manual.field_description.yml b/modules/esha/labmanual/config/install/field.field.node.lab_manual.field_description.yml new file mode 100644 index 0000000..e31a4ba --- /dev/null +++ b/modules/esha/labmanual/config/install/field.field.node.lab_manual.field_description.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_description + - node.type.lab_manual + enforced: + module: + - labmanual +id: node.lab_manual.field_description +field_name: field_description +entity_type: node +bundle: lab_manual +label: Description +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string_long diff --git a/modules/esha/labmanual/config/install/field.field.node.lab_manual.field_manual.yml b/modules/esha/labmanual/config/install/field.field.node.lab_manual.field_manual.yml new file mode 100644 index 0000000..b953977 --- /dev/null +++ b/modules/esha/labmanual/config/install/field.field.node.lab_manual.field_manual.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_manual + - node.type.lab_manual + module: + - file + enforced: + module: + - labmanual +id: node.lab_manual.field_manual +field_name: field_manual +entity_type: node +bundle: lab_manual +label: Manual +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: lab_manuals + file_extensions: pdf + max_filesize: '' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/esha/labmanual/config/install/field.storage.node.field_description.yml b/modules/esha/labmanual/config/install/field.storage.node.field_description.yml new file mode 100644 index 0000000..f272899 --- /dev/null +++ b/modules/esha/labmanual/config/install/field.storage.node.field_description.yml @@ -0,0 +1,22 @@ +uuid: 2607b4e4-518c-4aff-9b49-5f398e718487 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - labmanual +id: node.field_description +field_name: field_description +entity_type: node +type: string_long +settings: + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/labmanual/config/install/field.storage.node.field_manual.yml b/modules/esha/labmanual/config/install/field.storage.node.field_manual.yml new file mode 100644 index 0000000..9070112 --- /dev/null +++ b/modules/esha/labmanual/config/install/field.storage.node.field_manual.yml @@ -0,0 +1,26 @@ +uuid: 9772805f-ffb2-443f-afdd-0bc6dfd48416 +langcode: en +status: true +dependencies: + module: + - file + - node + enforced: + module: + - labmanual +id: node.field_manual +field_name: field_manual +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/esha/labmanual/config/install/migrate_plus.migration.labmanuals_import.yml b/modules/esha/labmanual/config/install/migrate_plus.migration.labmanuals_import.yml new file mode 100644 index 0000000..e6e6a38 --- /dev/null +++ b/modules/esha/labmanual/config/install/migrate_plus.migration.labmanuals_import.yml @@ -0,0 +1,51 @@ +uuid: c04b2ca4-cd30-4aa3-b742-d558a856d094 +id: labmanuals_import +label: labmanual +migration_group: default +source: + plugin: csv + # Full path to the file. + path: '/var/www/CSV/LabManual.csv' + # Column delimiter. Comma (,) by default. + delimiter: ',' + # Field enclosure. Double quotation marks (") by default. + enclosure: '"' + # The number of rows at the beginning which are not data. + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/LabManuals + file_dest: 'public://lab_manuals/' +process: + type: + plugin: default_value + default_value: lab_manual + source_path: + - + plugin: skip_on_empty + method: process + source: manual + - + plugin: concat + delimiter: / + source: + - constants/file_source + - manual + title: title + body/value: body + body/format: + - + plugin: default_value + default_value: basic_html + field_description: description + field_manual: + plugin: file_import + source: '@source_path' + destination: constants/file_dest +destination: + plugin: 'entity:node' + bundle: lab_manual +migration_dependencies: + required: { } + optional: { } diff --git a/modules/esha/labmanual/config/install/node.type.lab_manual.yml b/modules/esha/labmanual/config/install/node.type.lab_manual.yml new file mode 100644 index 0000000..f624421 --- /dev/null +++ b/modules/esha/labmanual/config/install/node.type.lab_manual.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - labmanual +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Lab Manual' +type: lab_manual +description: '' +help: '' +new_revision: false +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/labmanual/labmanual.info.yml b/modules/esha/labmanual/labmanual.info.yml new file mode 100644 index 0000000..9bfe438 --- /dev/null +++ b/modules/esha/labmanual/labmanual.info.yml @@ -0,0 +1,12 @@ +name: 'labmanual' +type: module +description: 'Module for Lab Manual Content Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:file + - drupal:path + - drupal:user + - drupal:node + - drupal:file + - drupal:menu_ui
\ No newline at end of file diff --git a/modules/esha/labmanual/labmanual.install b/modules/esha/labmanual/labmanual.install new file mode 100644 index 0000000..e2c0ed3 --- /dev/null +++ b/modules/esha/labmanual/labmanual.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function labmanual_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'lab_manual'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/labmanual/labmanual.module b/modules/esha/labmanual/labmanual.module new file mode 100644 index 0000000..5782054 --- /dev/null +++ b/modules/esha/labmanual/labmanual.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains labmanual.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function labmanual_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the labmanual module. + case 'help.page.labmanual': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Lab Manual Content Type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function labmanual_theme() { + return [ + 'labmanual' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/labmanual/templates/labmanual.html.twig b/modules/esha/labmanual/templates/labmanual.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/labmanual/templates/labmanual.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/labmanual/tests/src/Functional/LoadTest.php b/modules/esha/labmanual/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..e548812 --- /dev/null +++ b/modules/esha/labmanual/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\labmanual\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group labmanual + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['labmanual']; + + /** + * 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); + } + +} diff --git a/modules/esha/onlinecourse/composer.json b/modules/esha/onlinecourse/composer.json new file mode 100644 index 0000000..9d4a149 --- /dev/null +++ b/modules/esha/onlinecourse/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/onlinecourse", + "type": "drupal-module", + "description": "My Awesome Module", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/onlinecourse", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/onlinecourse", + "source": "http://cgit.drupalcode.org/onlinecourse" + }, + "require": { } +} diff --git a/modules/esha/onlinecourse/config/install/core.entity_form_display.node.online_course.default.yml b/modules/esha/onlinecourse/config/install/core.entity_form_display.node.online_course.default.yml new file mode 100644 index 0000000..86b561a --- /dev/null +++ b/modules/esha/onlinecourse/config/install/core.entity_form_display.node.online_course.default.yml @@ -0,0 +1,99 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.online_course.field_faculty_name + - field.field.node.online_course.field_link_to_cour + - field.field.node.online_course.field_offered_by + - node.type.online_course + module: + - link + - path +id: node.online_course.default +targetEntityType: node +bundle: online_course +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_faculty_name: + weight: 122 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_link_to_cour: + weight: 124 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_offered_by: + weight: 123 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + 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/esha/onlinecourse/config/install/core.entity_view_display.node.online_course.default.yml b/modules/esha/onlinecourse/config/install/core.entity_view_display.node.online_course.default.yml new file mode 100644 index 0000000..a774ce8 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/core.entity_view_display.node.online_course.default.yml @@ -0,0 +1,51 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.online_course.field_faculty_name + - field.field.node.online_course.field_link_to_cour + - field.field.node.online_course.field_offered_by + - node.type.online_course + module: + - link + - user +id: node.online_course.default +targetEntityType: node +bundle: online_course +mode: default +content: + field_faculty_name: + weight: 102 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_link_to_cour: + weight: 104 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_offered_by: + weight: 103 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/esha/onlinecourse/config/install/core.entity_view_display.node.online_course.teaser.yml b/modules/esha/onlinecourse/config/install/core.entity_view_display.node.online_course.teaser.yml new file mode 100644 index 0000000..79dc5ec --- /dev/null +++ b/modules/esha/onlinecourse/config/install/core.entity_view_display.node.online_course.teaser.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.online_course.field_faculty_name + - field.field.node.online_course.field_offered_by + - node.type.online_course + module: + - user +id: node.online_course.teaser +targetEntityType: node +bundle: online_course +mode: teaser +content: + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + field_faculty_name: true + field_offered_by: true + langcode: true diff --git a/modules/esha/onlinecourse/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/onlinecourse/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..fb7a35a --- /dev/null +++ b/modules/esha/onlinecourse/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,12 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_faculty_name.yml b/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_faculty_name.yml new file mode 100644 index 0000000..c5ea1a1 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_faculty_name.yml @@ -0,0 +1,27 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_faculty_name + - node.type.fac_page + - node.type.online_course +id: node.online_course.field_faculty_name +field_name: field_faculty_name +entity_type: node +bundle: online_course +label: 'Faculty name' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + fac_page: fac_page + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_link_to_cour.yml b/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_link_to_cour.yml new file mode 100644 index 0000000..fddd4ed --- /dev/null +++ b/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_link_to_cour.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_link_to_cour + - node.type.online_course + module: + - link +id: node.online_course.field_link_to_cour +field_name: field_link_to_cour +entity_type: node +bundle: online_course +label: 'Link to Course' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_offered_by.yml b/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_offered_by.yml new file mode 100644 index 0000000..973b204 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/field.field.node.online_course.field_offered_by.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_offered_by + - node.type.online_course +id: node.online_course.field_offered_by +field_name: field_offered_by +entity_type: node +bundle: online_course +label: 'Offered By' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/esha/onlinecourse/config/install/field.storage.node.field_faculty_name.yml b/modules/esha/onlinecourse/config/install/field.storage.node.field_faculty_name.yml new file mode 100644 index 0000000..d7653f8 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/field.storage.node.field_faculty_name.yml @@ -0,0 +1,19 @@ +uuid: 7f80e5e4-d5da-49d4-8039-5b54fda033af +langcode: en +status: true +dependencies: + module: + - node +id: node.field_faculty_name +field_name: field_faculty_name +entity_type: node +type: entity_reference +settings: + target_type: node +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/onlinecourse/config/install/field.storage.node.field_link_to_cour.yml b/modules/esha/onlinecourse/config/install/field.storage.node.field_link_to_cour.yml new file mode 100644 index 0000000..86d2592 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/field.storage.node.field_link_to_cour.yml @@ -0,0 +1,19 @@ +uuid: 4e9dd460-14ae-4be0-a820-b3b2f040b0d3 +langcode: en +status: true +dependencies: + module: + - link + - node +id: node.field_link_to_cour +field_name: field_link_to_cour +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/esha/onlinecourse/config/install/field.storage.node.field_offered_by.yml b/modules/esha/onlinecourse/config/install/field.storage.node.field_offered_by.yml new file mode 100644 index 0000000..6cf5567 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/field.storage.node.field_offered_by.yml @@ -0,0 +1,21 @@ +uuid: cc60ea6e-7263-43dd-bd49-b74ef089a323 +langcode: en +status: true +dependencies: + module: + - node +id: node.field_offered_by +field_name: field_offered_by +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/onlinecourse/config/install/migrate_plus.migration.onlinecourse_sample.yml b/modules/esha/onlinecourse/config/install/migrate_plus.migration.onlinecourse_sample.yml new file mode 100644 index 0000000..8f8ec38 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/migrate_plus.migration.onlinecourse_sample.yml @@ -0,0 +1,36 @@ +uuid: 7ab17b40-597e-411a-a750-23c138da7c6d +id: onlinecourse_sample +label: Courses +migration_group: default +source: + plugin: csv + # Full path to the file. + path: '/var/www/CSV/onlinecourse_sample.csv' + # Column delimiter. Comma (,) by default. + delimiter: ',' + # Field enclosure. Double quotation marks (") by default. + enclosure: '"' + # The number of rows at the beginning which are not data. + header_row_count: 1 + keys: + - id +process: + type: + plugin: default_value + default_value: online_course + title: title + field_link_to_cour: link + field_offered_by: offeredby + field_faculty_name: + - + plugin: explode + delimiter: '|' + source: names + - + plugin: entity_lookup + entity_type: node + bundle: fac_page +destination: + plugin: 'entity:node' + bundle: online_course +migration_dependencies: null diff --git a/modules/esha/onlinecourse/config/install/node.type.fac_page.yml b/modules/esha/onlinecourse/config/install/node.type.fac_page.yml new file mode 100644 index 0000000..47f8ffb --- /dev/null +++ b/modules/esha/onlinecourse/config/install/node.type.fac_page.yml @@ -0,0 +1,23 @@ +uuid: b7471e78-83f0-4359-9512-d4a8f02c2218 +langcode: en +status: true +dependencies: + enforced: + module: + - acadmix_faculty + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +_core: + default_config_hash: yZnGgm-oTEuH3Qz8VcW49f94qFn-pYOYZdrX601an0U +name: 'Faculty Page' +type: fac_page +description: 'Content template for opening Faculty Page' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/onlinecourse/config/install/node.type.online_course.yml b/modules/esha/onlinecourse/config/install/node.type.online_course.yml new file mode 100644 index 0000000..4f492e6 --- /dev/null +++ b/modules/esha/onlinecourse/config/install/node.type.online_course.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Online Course' +type: online_course +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/onlinecourse/onlinecourse.info.yml b/modules/esha/onlinecourse/onlinecourse.info.yml new file mode 100644 index 0000000..91191b6 --- /dev/null +++ b/modules/esha/onlinecourse/onlinecourse.info.yml @@ -0,0 +1,12 @@ +name: 'onlineCourse' +type: module +description: 'My Awesome Module' +core: 8.x +package: 'Custom' +dependencies: + - drupal:text + - drupal:link + - drupal:path + - drupal:user + - drupal:node + - drupal:menu_ui
\ No newline at end of file diff --git a/modules/esha/onlinecourse/onlinecourse.install b/modules/esha/onlinecourse/onlinecourse.install new file mode 100644 index 0000000..7469bb9 --- /dev/null +++ b/modules/esha/onlinecourse/onlinecourse.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function onlinecourse_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'online_course'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/onlinecourse/onlinecourse.module b/modules/esha/onlinecourse/onlinecourse.module new file mode 100644 index 0000000..617de66 --- /dev/null +++ b/modules/esha/onlinecourse/onlinecourse.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains onlinecourse.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function onlinecourse_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the onlinecourse module. + case 'help.page.onlinecourse': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('My Awesome Module') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function onlinecourse_theme() { + return [ + 'onlinecourse' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/onlinecourse/templates/onlinecourse.html.twig b/modules/esha/onlinecourse/templates/onlinecourse.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/onlinecourse/templates/onlinecourse.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/onlinecourse/tests/src/Functional/LoadTest.php b/modules/esha/onlinecourse/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..a25c263 --- /dev/null +++ b/modules/esha/onlinecourse/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\onlinecourse\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group onlinecourse + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['onlinecourse']; + + /** + * 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); + } + +} diff --git a/modules/esha/placements/composer.json b/modules/esha/placements/composer.json new file mode 100644 index 0000000..6900912 --- /dev/null +++ b/modules/esha/placements/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/placements", + "type": "drupal-module", + "description": "Module for Placement Content Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/placements", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/placements", + "source": "http://cgit.drupalcode.org/placements" + }, + "require": { } +} diff --git a/modules/esha/placements/config/install/core.entity_form_display.node.placements.default.yml b/modules/esha/placements/config/install/core.entity_form_display.node.placements.default.yml new file mode 100644 index 0000000..f9aac4a --- /dev/null +++ b/modules/esha/placements/config/install/core.entity_form_display.node.placements.default.yml @@ -0,0 +1,120 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.placements.body + - field.field.node.placements.field_new + - field.field.node.placements.field_placed + - field.field.node.placements.field_total_students_placed + - field.field.node.placements.field_year + - node.type.placements + module: + - path + - text + enforced: + module: + - placements +id: node.placements.default +targetEntityType: node +bundle: placements +mode: default +content: + body: + weight: 125 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + type: text_textarea_with_summary + region: content + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_new: + weight: 126 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_placed: + weight: 127 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_total_students_placed: + weight: 123 + settings: + placeholder: '' + third_party_settings: { } + type: number + region: content + field_year: + weight: 124 + 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/esha/placements/config/install/core.entity_view_display.node.placements.default.yml b/modules/esha/placements/config/install/core.entity_view_display.node.placements.default.yml new file mode 100644 index 0000000..b6f5b9e --- /dev/null +++ b/modules/esha/placements/config/install/core.entity_view_display.node.placements.default.yml @@ -0,0 +1,67 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.placements.body + - field.field.node.placements.field_new + - field.field.node.placements.field_placed + - field.field.node.placements.field_total_students_placed + - field.field.node.placements.field_year + - node.type.placements + module: + - text + - user + enforced: + module: + - placements +id: node.placements.default +targetEntityType: node +bundle: placements +mode: default +content: + body: + weight: 105 + label: above + settings: { } + type: text_default + region: content + field_new: + weight: 106 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_placed: + weight: 107 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_total_students_placed: + weight: 103 + label: above + settings: + thousand_separator: '' + prefix_suffix: true + third_party_settings: { } + type: number_integer + region: content + field_year: + weight: 104 + 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/esha/placements/config/install/core.entity_view_display.node.placements.teaser.yml b/modules/esha/placements/config/install/core.entity_view_display.node.placements.teaser.yml new file mode 100644 index 0000000..6a0abef --- /dev/null +++ b/modules/esha/placements/config/install/core.entity_view_display.node.placements.teaser.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.placements.field_total_students_placed + - field.field.node.placements.field_year + - node.type.placements + module: + - user + enforced: + module: + - placements +id: node.placements.teaser +targetEntityType: node +bundle: placements +mode: teaser +content: + links: + weight: 100 + settings: { } + region: content +hidden: + field_total_students_placed: true + field_year: true + langcode: true diff --git a/modules/esha/placements/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/placements/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..f09eef8 --- /dev/null +++ b/modules/esha/placements/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,15 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - placements +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/placements/config/install/field.field.node.placements.body.yml b/modules/esha/placements/config/install/field.field.node.placements.body.yml new file mode 100644 index 0000000..4eaef94 --- /dev/null +++ b/modules/esha/placements/config/install/field.field.node.placements.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.placements + module: + - text + enforced: + module: + - placements +id: node.placements.body +field_name: body +entity_type: node +bundle: placements +label: Body +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: false +field_type: text_with_summary diff --git a/modules/esha/placements/config/install/field.field.node.placements.field_new.yml b/modules/esha/placements/config/install/field.field.node.placements.field_new.yml new file mode 100644 index 0000000..4973424 --- /dev/null +++ b/modules/esha/placements/config/install/field.field.node.placements.field_new.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_new + - node.type.placements + - taxonomy.vocabulary.vocab + enforced: + module: + - placements +id: node.placements.field_new +field_name: field_new +entity_type: node +bundle: placements +label: new +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + vocab: vocab + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/placements/config/install/field.field.node.placements.field_placed.yml b/modules/esha/placements/config/install/field.field.node.placements.field_placed.yml new file mode 100644 index 0000000..5a941da --- /dev/null +++ b/modules/esha/placements/config/install/field.field.node.placements.field_placed.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_placed + - node.type.placements + enforced: + module: + - placements +id: node.placements.field_placed +field_name: field_placed +entity_type: node +bundle: placements +label: placed +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/esha/placements/config/install/field.field.node.placements.field_total_students_placed.yml b/modules/esha/placements/config/install/field.field.node.placements.field_total_students_placed.yml new file mode 100644 index 0000000..a5867b7 --- /dev/null +++ b/modules/esha/placements/config/install/field.field.node.placements.field_total_students_placed.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_total_students_placed + - node.type.placements + enforced: + module: + - placements +id: node.placements.field_total_students_placed +field_name: field_total_students_placed +entity_type: node +bundle: placements +label: 'Total Students Placed' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + min: null + max: null + prefix: '' + suffix: '' +field_type: integer diff --git a/modules/esha/placements/config/install/field.field.node.placements.field_year.yml b/modules/esha/placements/config/install/field.field.node.placements.field_year.yml new file mode 100644 index 0000000..ef2000d --- /dev/null +++ b/modules/esha/placements/config/install/field.field.node.placements.field_year.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_year + - node.type.placements + - taxonomy.vocabulary.year + enforced: + module: + - placements +id: node.placements.field_year +field_name: field_year +entity_type: node +bundle: placements +label: Year +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + year: year + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: placement_year +field_type: entity_reference diff --git a/modules/esha/placements/config/install/field.storage.node.body.yml b/modules/esha/placements/config/install/field.storage.node.body.yml new file mode 100644 index 0000000..821a97a --- /dev/null +++ b/modules/esha/placements/config/install/field.storage.node.body.yml @@ -0,0 +1,24 @@ +uuid: d15ccb4d-ffc3-42ae-abaa-012960942a15 +langcode: en +status: true +dependencies: + module: + - node + - text + enforced: + module: + - placements +_core: + default_config_hash: EBUo7qOWqaiZaQ_RC9sLY5IoDKphS34v77VIHSACmVY +id: node.body +field_name: body +entity_type: node +type: text_with_summary +settings: { } +module: text +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: true +custom_storage: false diff --git a/modules/esha/placements/config/install/field.storage.node.field_new.yml b/modules/esha/placements/config/install/field.storage.node.field_new.yml new file mode 100644 index 0000000..117e02e --- /dev/null +++ b/modules/esha/placements/config/install/field.storage.node.field_new.yml @@ -0,0 +1,23 @@ +uuid: f42f851c-6e7b-4843-98ce-f0c233649c4b +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - placements +id: node.field_new +field_name: field_new +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/esha/placements/config/install/field.storage.node.field_placed.yml b/modules/esha/placements/config/install/field.storage.node.field_placed.yml new file mode 100644 index 0000000..d926eeb --- /dev/null +++ b/modules/esha/placements/config/install/field.storage.node.field_placed.yml @@ -0,0 +1,24 @@ +uuid: ad069c50-3ddd-41a5-b5a6-1d930d1aa3df +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - placements +id: node.field_placed +field_name: field_placed +entity_type: node +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/placements/config/install/field.storage.node.field_total_students_placed.yml b/modules/esha/placements/config/install/field.storage.node.field_total_students_placed.yml new file mode 100644 index 0000000..010ad2f --- /dev/null +++ b/modules/esha/placements/config/install/field.storage.node.field_total_students_placed.yml @@ -0,0 +1,23 @@ +uuid: 3e89b54e-f405-4dee-b175-10ac5bb61161 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - placements +id: node.field_total_students_placed +field_name: field_total_students_placed +entity_type: node +type: integer +settings: + unsigned: false + size: normal +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/placements/config/install/field.storage.node.field_year.yml b/modules/esha/placements/config/install/field.storage.node.field_year.yml new file mode 100644 index 0000000..5b6f903 --- /dev/null +++ b/modules/esha/placements/config/install/field.storage.node.field_year.yml @@ -0,0 +1,23 @@ +uuid: 404051f1-b4e2-4818-b895-e4bf114e7a93 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - placements +id: node.field_year +field_name: field_year +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/esha/placements/config/install/migrate_plus.migration.placements_import1.yml b/modules/esha/placements/config/install/migrate_plus.migration.placements_import1.yml new file mode 100644 index 0000000..42dc7e5 --- /dev/null +++ b/modules/esha/placements/config/install/migrate_plus.migration.placements_import1.yml @@ -0,0 +1,30 @@ +uuid: 1b29566d-9275-46df-a57f-5f6595537753 +id: placements_import +label: Import Placement Data +migration_groups: + - default +source: + plugin: csv + # Full path to the file. + path: '/var/www/CSV/Placements.csv' + # Column delimiter. Comma (,) by default. + delimiter: ',' + # Field enclosure. Double quotation marks (") by default. + enclosure: '"' + # The number of rows at the beginning which are not data. + header_row_count: 1 + keys: + - id +process: + title: title + field_total_students_placed: total + field_year: year + type: + plugin: entity_lookup + entity: taxonomy_term + bundle: placement_year + source: year +destination: + plugin: 'entity:node' + plugin: entity:taxonomy_term +migration_dependencies: null diff --git a/modules/esha/placements/config/install/node.type.placements.yml b/modules/esha/placements/config/install/node.type.placements.yml new file mode 100644 index 0000000..f0bb423 --- /dev/null +++ b/modules/esha/placements/config/install/node.type.placements.yml @@ -0,0 +1,15 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - placements +name: Placements +type: placements +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/placements/config/install/taxonomy.vocabulary.vocab.yml b/modules/esha/placements/config/install/taxonomy.vocabulary.vocab.yml new file mode 100644 index 0000000..5c36cd8 --- /dev/null +++ b/modules/esha/placements/config/install/taxonomy.vocabulary.vocab.yml @@ -0,0 +1,12 @@ +uuid: dfa25a08-cadc-4bc6-826f-b817586af55b +langcode: en +status: true +dependencies: + enforced: + module: + - placements +name: vocab +vid: vocab +description: '' +hierarchy: 0 +weight: 0 diff --git a/modules/esha/placements/config/install/taxonomy.vocabulary.year.yml b/modules/esha/placements/config/install/taxonomy.vocabulary.year.yml new file mode 100644 index 0000000..9cf2d82 --- /dev/null +++ b/modules/esha/placements/config/install/taxonomy.vocabulary.year.yml @@ -0,0 +1,12 @@ +uuid: a22778aa-6584-422b-932b-3c4e4f59c1b5 +langcode: en +status: true +dependencies: + enforced: + module: + - placements +name: year +vid: year +description: '' +hierarchy: 0 +weight: 0 diff --git a/modules/esha/placements/placements.info.yml b/modules/esha/placements/placements.info.yml new file mode 100644 index 0000000..638f772 --- /dev/null +++ b/modules/esha/placements/placements.info.yml @@ -0,0 +1,13 @@ +name: 'placements' +type: module +description: 'Module for Placement Content Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:node + - drupal:text + - drupal:user + - drupal:menu_ui + - drupal:taxonomy + - drupal:options + - drupal:path diff --git a/modules/esha/placements/placements.install b/modules/esha/placements/placements.install new file mode 100644 index 0000000..6258322 --- /dev/null +++ b/modules/esha/placements/placements.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function placements_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'placements'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/placements/placements.module b/modules/esha/placements/placements.module new file mode 100644 index 0000000..20f3371 --- /dev/null +++ b/modules/esha/placements/placements.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains placements.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function placements_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the placements module. + case 'help.page.placements': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Placement Content Type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function placements_theme() { + return [ + 'placements' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/placements/placements.routing.yml b/modules/esha/placements/placements.routing.yml new file mode 100644 index 0000000..1872ef8 --- /dev/null +++ b/modules/esha/placements/placements.routing.yml @@ -0,0 +1,8 @@ + +placements.placement_controller_hello: + path: '/placements/hello/{name}' + defaults: + _controller: '\Drupal\placements\Controller\PlacementController::hello' + _title: 'placed' + requirements: + _permission: 'access content' diff --git a/modules/esha/placements/src/Controller/PlacementController.php b/modules/esha/placements/src/Controller/PlacementController.php new file mode 100644 index 0000000..761db6a --- /dev/null +++ b/modules/esha/placements/src/Controller/PlacementController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\placements\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class PlacementController. + */ +class PlacementController extends ControllerBase { + + /** + * Hello. + * + * @return string + * Return Hello string. + */ + public function hello($name) { + return [ + '#type' => 'markup', + '#markup' => $this->t('Implement method: hello with parameter(s): $name'), + ]; + } + +} diff --git a/modules/esha/placements/templates/placements.html.twig b/modules/esha/placements/templates/placements.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/placements/templates/placements.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/placements/tests/src/Functional/LoadTest.php b/modules/esha/placements/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..fd19fb6 --- /dev/null +++ b/modules/esha/placements/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\placements\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group placements + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['placements']; + + /** + * 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); + } + +} diff --git a/modules/esha/programs/composer.json b/modules/esha/programs/composer.json new file mode 100644 index 0000000..9889ab7 --- /dev/null +++ b/modules/esha/programs/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/programs", + "type": "drupal-module", + "description": "Module for Content Type Programs Offered", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/programs", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/programs", + "source": "http://cgit.drupalcode.org/programs" + }, + "require": { } +} diff --git a/modules/esha/programs/config/install/core.entity_form_display.node.p.default.yml b/modules/esha/programs/config/install/core.entity_form_display.node.p.default.yml new file mode 100644 index 0000000..a01057d --- /dev/null +++ b/modules/esha/programs/config/install/core.entity_form_display.node.p.default.yml @@ -0,0 +1,124 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.p.body + - field.field.node.p.field_courseware + - field.field.node.p.field_curriculum + - field.field.node.p.field_degree + - field.field.node.p.field_lesson_plan + - field.field.node.p.field_objectives + - node.type.p + module: + - file + - path + - text +id: node.p.default +targetEntityType: node +bundle: p +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_courseware: + weight: 128 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + region: content + field_curriculum: + weight: 123 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + region: content + field_degree: + weight: 125 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_lesson_plan: + weight: 129 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + region: content + field_objectives: + weight: 127 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + 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/esha/programs/config/install/core.entity_view_display.node.p.default.yml b/modules/esha/programs/config/install/core.entity_view_display.node.p.default.yml new file mode 100644 index 0000000..3c58d93 --- /dev/null +++ b/modules/esha/programs/config/install/core.entity_view_display.node.p.default.yml @@ -0,0 +1,74 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.p.body + - field.field.node.p.field_courseware + - field.field.node.p.field_curriculum + - field.field.node.p.field_degree + - field.field.node.p.field_lesson_plan + - field.field.node.p.field_objectives + - node.type.p + module: + - file + - text + - user +id: node.p.default +targetEntityType: node +bundle: p +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_courseware: + weight: 108 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + field_curriculum: + weight: 103 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + field_degree: + weight: 105 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_lesson_plan: + weight: 109 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + field_objectives: + weight: 107 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/esha/programs/config/install/core.entity_view_display.node.p.teaser.yml b/modules/esha/programs/config/install/core.entity_view_display.node.p.teaser.yml new file mode 100644 index 0000000..0b08722 --- /dev/null +++ b/modules/esha/programs/config/install/core.entity_view_display.node.p.teaser.yml @@ -0,0 +1,30 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.p.body + - node.type.p + module: + - text + - user +id: node.p.teaser +targetEntityType: node +bundle: p +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/esha/programs/config/install/field.field.node.p.body.yml b/modules/esha/programs/config/install/field.field.node.p.body.yml new file mode 100644 index 0000000..9e25420 --- /dev/null +++ b/modules/esha/programs/config/install/field.field.node.p.body.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.p + module: + - text +id: node.p.body +field_name: body +entity_type: node +bundle: p +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/esha/programs/config/install/field.field.node.p.field_courseware.yml b/modules/esha/programs/config/install/field.field.node.p.field_courseware.yml new file mode 100644 index 0000000..4e4b22c --- /dev/null +++ b/modules/esha/programs/config/install/field.field.node.p.field_courseware.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_courseware + - node.type.p + module: + - file +id: node.p.field_courseware +field_name: field_courseware +entity_type: node +bundle: p +label: Courseware +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: pdf + max_filesize: '' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/esha/programs/config/install/field.field.node.p.field_curriculum.yml b/modules/esha/programs/config/install/field.field.node.p.field_curriculum.yml new file mode 100644 index 0000000..f782e17 --- /dev/null +++ b/modules/esha/programs/config/install/field.field.node.p.field_curriculum.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_curriculum + - node.type.p + module: + - file +id: node.p.field_curriculum +field_name: field_curriculum +entity_type: node +bundle: p +label: Curriculum +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: pdf + max_filesize: '12 MB' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/esha/programs/config/install/field.field.node.p.field_degree.yml b/modules/esha/programs/config/install/field.field.node.p.field_degree.yml new file mode 100644 index 0000000..06ff5f0 --- /dev/null +++ b/modules/esha/programs/config/install/field.field.node.p.field_degree.yml @@ -0,0 +1,28 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_degree + - node.type.p + - taxonomy.vocabulary.offered_programs +id: node.p.field_degree +field_name: field_degree +entity_type: node +bundle: p +label: Degree +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + offered_programs: offered_programs + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/programs/config/install/field.field.node.p.field_lesson_plan.yml b/modules/esha/programs/config/install/field.field.node.p.field_lesson_plan.yml new file mode 100644 index 0000000..29229ab --- /dev/null +++ b/modules/esha/programs/config/install/field.field.node.p.field_lesson_plan.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_lesson_plan + - node.type.p + module: + - file +id: node.p.field_lesson_plan +field_name: field_lesson_plan +entity_type: node +bundle: p +label: 'Lesson Plan' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: pdf + max_filesize: '' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/esha/programs/config/install/field.field.node.p.field_objectives.yml b/modules/esha/programs/config/install/field.field.node.p.field_objectives.yml new file mode 100644 index 0000000..fe10a5b --- /dev/null +++ b/modules/esha/programs/config/install/field.field.node.p.field_objectives.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_objectives + - node.type.p + module: + - file +id: node.p.field_objectives +field_name: field_objectives +entity_type: node +bundle: p +label: Objectives +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: pdf + max_filesize: '' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/esha/programs/config/install/field.storage.node.field_courseware.yml b/modules/esha/programs/config/install/field.storage.node.field_courseware.yml new file mode 100644 index 0000000..ce75fe2 --- /dev/null +++ b/modules/esha/programs/config/install/field.storage.node.field_courseware.yml @@ -0,0 +1,23 @@ +uuid: 4f345cc8-3a42-45bc-8224-5e33536cd339 +langcode: en +status: true +dependencies: + module: + - file + - node +id: node.field_courseware +field_name: field_courseware +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/esha/programs/config/install/field.storage.node.field_curriculum.yml b/modules/esha/programs/config/install/field.storage.node.field_curriculum.yml new file mode 100644 index 0000000..50b7f5b --- /dev/null +++ b/modules/esha/programs/config/install/field.storage.node.field_curriculum.yml @@ -0,0 +1,23 @@ +uuid: 37ea26ab-f120-4e68-9a51-af20519bb867 +langcode: en +status: true +dependencies: + module: + - file + - node +id: node.field_curriculum +field_name: field_curriculum +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/esha/programs/config/install/field.storage.node.field_degree.yml b/modules/esha/programs/config/install/field.storage.node.field_degree.yml new file mode 100644 index 0000000..a3c9c4c --- /dev/null +++ b/modules/esha/programs/config/install/field.storage.node.field_degree.yml @@ -0,0 +1,20 @@ +uuid: 17870542-92b4-4097-9fd7-2ff5e2aedfcf +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_degree +field_name: field_degree +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/esha/programs/config/install/field.storage.node.field_lesson_plan.yml b/modules/esha/programs/config/install/field.storage.node.field_lesson_plan.yml new file mode 100644 index 0000000..45dabec --- /dev/null +++ b/modules/esha/programs/config/install/field.storage.node.field_lesson_plan.yml @@ -0,0 +1,23 @@ +uuid: bb5ebaad-6106-4cce-abcf-7ed7fff8c220 +langcode: en +status: true +dependencies: + module: + - file + - node +id: node.field_lesson_plan +field_name: field_lesson_plan +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/esha/programs/config/install/field.storage.node.field_objectives.yml b/modules/esha/programs/config/install/field.storage.node.field_objectives.yml new file mode 100644 index 0000000..f6c5857 --- /dev/null +++ b/modules/esha/programs/config/install/field.storage.node.field_objectives.yml @@ -0,0 +1,23 @@ +uuid: c65123d9-9165-4ecf-8d9d-86085fee2bcd +langcode: en +status: true +dependencies: + module: + - file + - node +id: node.field_objectives +field_name: field_objectives +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/esha/programs/config/install/node.type.p.yml b/modules/esha/programs/config/install/node.type.p.yml new file mode 100644 index 0000000..7978d3f --- /dev/null +++ b/modules/esha/programs/config/install/node.type.p.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Programs Offered' +type: p +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/programs/config/install/programs_offered.yaml b/modules/esha/programs/config/install/programs_offered.yaml new file mode 100644 index 0000000..1bd7001 --- /dev/null +++ b/modules/esha/programs/config/install/programs_offered.yaml @@ -0,0 +1,110 @@ +id: programs_offered +label: 'Programs Offered Import' +migration_group: default +source: + plugin: csv + path: '/var/www/CSV/programs_offered.csv' + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/programsoffered + file_dest1: 'public://programs_offered_courseware/' + file_dest2: 'public://programs_offered_lessonplan/' + file_dest3: 'public://programs_offered_curriculum/' + file_dest4: 'public://programs_offered_objectives/' +process: + type: + plugin: default_value + default_value: p + source_path1: + - + plugin: skip_on_empty + method: process + source: courseware + - + plugin: concat + delimiter: / + source: + - constants/file_source + - courseware + source_path2: + - + plugin: skip_on_empty + method: process + source: lessonplan + - + plugin: concat + delimiter: / + source: + - constants/file_source + - lessonplan + source_path3: + - + plugin: skip_on_empty + method: process + source: curriculum + - + plugin: concat + delimiter: / + source: + - constants/file_source + - curriculum + source_path4: + - + plugin: skip_on_empty + method: process + source: objectives + - + plugin: concat + delimiter: / + source: + - constants/file_source + - objectives + title: title + body/value: body + body/format: + - + plugin: default_value + default_value: basic_html + field_course_description: descr + field_courseware: + - + plugin: explode + delimiter: '|' + source: courseware + - + plugin: file_import + source: '@source_path1' + destination: constants/file_dest1 + field_lesson_plan: + - + plugin: explode + delimiter: '|' + source: lessonplan + - + plugin: file_import + source: '@source_path2' + destination: constants/file_dest2 + field_curriculum: + plugin: file_import + source: '@source_path3' + destination: constants/file_dest3 + field_objectives: + plugin: file_import + source: '@source_path4' + destination: constants/file_dest4 + field_degree: + plugin: entity_lookup + entity: taxonomy_term + bundle: offered_programs + source: programtype +destination: + plugin: 'entity:node' + plugin: 'entity:taxonomy_term' + bundle: p +migration_dependencies: + required: { } + optional: { } diff --git a/modules/esha/programs/config/install/taxonomy.vocabulary.offered_programs.yml b/modules/esha/programs/config/install/taxonomy.vocabulary.offered_programs.yml new file mode 100644 index 0000000..dfbc3c1 --- /dev/null +++ b/modules/esha/programs/config/install/taxonomy.vocabulary.offered_programs.yml @@ -0,0 +1,9 @@ +uuid: f55c9d15-5ce8-4e66-9682-df8d98bd0382 +langcode: en +status: true +dependencies: { } +name: 'Offered Programs' +vid: offered_programs +description: '' +hierarchy: 0 +weight: 0 diff --git a/modules/esha/programs/programs.info.yml b/modules/esha/programs/programs.info.yml new file mode 100644 index 0000000..284cbaa --- /dev/null +++ b/modules/esha/programs/programs.info.yml @@ -0,0 +1,13 @@ +name: 'programs' +type: module +description: 'Module for Content Type Programs Offered' +core: 8.x +package: 'Custom' +dependencies: + - drupal:file + - drupal:text + - drupal:user + - drupal:path + - drupal:node + - drupal:taxonomy + - drupal:menu_ui diff --git a/modules/esha/programs/programs.install b/modules/esha/programs/programs.install new file mode 100644 index 0000000..404bcba --- /dev/null +++ b/modules/esha/programs/programs.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function programs_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'p'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/programs/programs.module b/modules/esha/programs/programs.module new file mode 100644 index 0000000..4909c34 --- /dev/null +++ b/modules/esha/programs/programs.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains programs.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function programs_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the programs module. + case 'help.page.programs': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Content Type Programs Offered') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function programs_theme() { + return [ + 'programs' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/programs/programs.routing.yml b/modules/esha/programs/programs.routing.yml new file mode 100644 index 0000000..240db1e --- /dev/null +++ b/modules/esha/programs/programs.routing.yml @@ -0,0 +1,8 @@ + +programs.programs_offered_controller_hello: + path: '/programs/hello/{name}' + defaults: + _controller: '\Drupal\programs\Controller\ProgramsOfferedController::hello' + _title: 'control' + requirements: + _permission: 'access content' diff --git a/modules/esha/programs/src/Controller/ProgramsOfferedController.php b/modules/esha/programs/src/Controller/ProgramsOfferedController.php new file mode 100644 index 0000000..7fe6888 --- /dev/null +++ b/modules/esha/programs/src/Controller/ProgramsOfferedController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\programs\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class ProgramsOfferedController. + */ +class ProgramsOfferedController extends ControllerBase { + + /** + * Hello. + * + * @return string + * Return Hello string. + */ + public function hello($name) { + return [ + '#type' => 'markup', + '#markup' => $this->t('Implement method: hello with parameter(s): $name'), + ]; + } + +} diff --git a/modules/esha/programs/templates/programs.html.twig b/modules/esha/programs/templates/programs.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/programs/templates/programs.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/programs/tests/src/Functional/LoadTest.php b/modules/esha/programs/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..8d3d7ab --- /dev/null +++ b/modules/esha/programs/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\programs\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group programs + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['programs']; + + /** + * 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); + } + +} diff --git a/modules/esha/sig/composer.json b/modules/esha/sig/composer.json new file mode 100644 index 0000000..92be454 --- /dev/null +++ b/modules/esha/sig/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/sig", + "type": "drupal-module", + "description": "Module for Special Interest Groups Content Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/sig", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/sig", + "source": "http://cgit.drupalcode.org/sig" + }, + "require": { } +} diff --git a/modules/esha/sig/config/install/core.entity_form_display.node.special_interest_groups.default.yml b/modules/esha/sig/config/install/core.entity_form_display.node.special_interest_groups.default.yml new file mode 100644 index 0000000..2a56e47 --- /dev/null +++ b/modules/esha/sig/config/install/core.entity_form_display.node.special_interest_groups.default.yml @@ -0,0 +1,93 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.special_interest_groups.field_faculty_head + - field.field.node.special_interest_groups.field_sig_members + - node.type.special_interest_groups + module: + - path + enforced: + module: + - sig +id: node.special_interest_groups.default +targetEntityType: node +bundle: special_interest_groups +mode: default +content: + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_faculty_head: + weight: 122 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_sig_members: + 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/esha/sig/config/install/core.entity_view_display.node.special_interest_groups.default.yml b/modules/esha/sig/config/install/core.entity_view_display.node.special_interest_groups.default.yml new file mode 100644 index 0000000..41cd888 --- /dev/null +++ b/modules/esha/sig/config/install/core.entity_view_display.node.special_interest_groups.default.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.special_interest_groups.field_faculty_head + - field.field.node.special_interest_groups.field_sig_members + - node.type.special_interest_groups + module: + - user + enforced: + module: + - sig +id: node.special_interest_groups.default +targetEntityType: node +bundle: special_interest_groups +mode: default +content: + field_faculty_head: + weight: 102 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_sig_members: + 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/esha/sig/config/install/core.entity_view_display.node.special_interest_groups.teaser.yml b/modules/esha/sig/config/install/core.entity_view_display.node.special_interest_groups.teaser.yml new file mode 100644 index 0000000..01fe2d5 --- /dev/null +++ b/modules/esha/sig/config/install/core.entity_view_display.node.special_interest_groups.teaser.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.special_interest_groups.field_faculty_head + - node.type.special_interest_groups + module: + - user + enforced: + module: + - sig +id: node.special_interest_groups.teaser +targetEntityType: node +bundle: special_interest_groups +mode: teaser +content: + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + field_faculty_head: true + langcode: true diff --git a/modules/esha/sig/config/install/core.entity_view_mode.node.teaser.yml b/modules/esha/sig/config/install/core.entity_view_mode.node.teaser.yml new file mode 100644 index 0000000..138bd3c --- /dev/null +++ b/modules/esha/sig/config/install/core.entity_view_mode.node.teaser.yml @@ -0,0 +1,15 @@ +uuid: eae4e8eb-df75-49ff-b350-c4bd59679b36 +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - sig +_core: + default_config_hash: Mz9qWr1kUYK0mjRAGDsr5XS6PvtZ24en_7ndt-pyWe4 +id: node.teaser +label: Teaser +targetEntityType: node +cache: true diff --git a/modules/esha/sig/config/install/field.field.node.special_interest_groups.field_faculty_head.yml b/modules/esha/sig/config/install/field.field.node.special_interest_groups.field_faculty_head.yml new file mode 100644 index 0000000..866afa7 --- /dev/null +++ b/modules/esha/sig/config/install/field.field.node.special_interest_groups.field_faculty_head.yml @@ -0,0 +1,30 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_faculty_head + - node.type.fac_page + - node.type.special_interest_groups + enforced: + module: + - sig +id: node.special_interest_groups.field_faculty_head +field_name: field_faculty_head +entity_type: node +bundle: special_interest_groups +label: 'Faculty Head' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + fac_page: fac_page + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/sig/config/install/field.field.node.special_interest_groups.field_sig_members.yml b/modules/esha/sig/config/install/field.field.node.special_interest_groups.field_sig_members.yml new file mode 100644 index 0000000..8b199d9 --- /dev/null +++ b/modules/esha/sig/config/install/field.field.node.special_interest_groups.field_sig_members.yml @@ -0,0 +1,30 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_sig_members + - node.type.fac_page + - node.type.special_interest_groups + enforced: + module: + - sig +id: node.special_interest_groups.field_sig_members +field_name: field_sig_members +entity_type: node +bundle: special_interest_groups +label: 'SIG Members' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + fac_page: fac_page + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/esha/sig/config/install/field.storage.node.field_faculty_head.yml b/modules/esha/sig/config/install/field.storage.node.field_faculty_head.yml new file mode 100644 index 0000000..bd37713 --- /dev/null +++ b/modules/esha/sig/config/install/field.storage.node.field_faculty_head.yml @@ -0,0 +1,22 @@ +uuid: c30dd806-cceb-4e4a-94f5-cc06173cf69a +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - sig +id: node.field_faculty_head +field_name: field_faculty_head +entity_type: node +type: entity_reference +settings: + target_type: node +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/sig/config/install/field.storage.node.field_sig_members.yml b/modules/esha/sig/config/install/field.storage.node.field_sig_members.yml new file mode 100644 index 0000000..8346ae7 --- /dev/null +++ b/modules/esha/sig/config/install/field.storage.node.field_sig_members.yml @@ -0,0 +1,22 @@ +uuid: 0d465dd6-6376-449e-b185-1e75febf6c2f +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - sig +id: node.field_sig_members +field_name: field_sig_members +entity_type: node +type: entity_reference +settings: + target_type: node +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/esha/sig/config/install/migrate_plus.migration.sig_sample.yml b/modules/esha/sig/config/install/migrate_plus.migration.sig_sample.yml new file mode 100644 index 0000000..d309984 --- /dev/null +++ b/modules/esha/sig/config/install/migrate_plus.migration.sig_sample.yml @@ -0,0 +1,40 @@ +uuid: 9dea4ec4-fb79-4a5f-a37a-a045de069432 +id: sig_sample +label: 'SIG Sample' +migration_group: default +source: + plugin: csv + # Full path to the file. + path: '/var/www/CSV/sig_sample.csv' + # Column delimiter. Comma (,) by default. + delimiter: ',' + # Field enclosure. Double quotation marks (") by default. + enclosure: '"' + # The number of rows at the beginning which are not data. + header_row_count: 1 + keys: + - id +process: + type: + plugin: default_value + default_value: special_interest_groups + title: title + field_faculty_head: + - + plugin: entity_lookup + entity_type: node + bundle: fac_page + source: head + field_sig_members: + - + plugin: explode + delimiter: '|' + source: members + - + plugin: entity_lookup + entity_type: node + bundle: fac_page +destination: + plugin: 'entity:node' + bundle: special_interest_groups +migration_dependencies: null diff --git a/modules/esha/sig/config/install/node.type.fac_page.yml b/modules/esha/sig/config/install/node.type.fac_page.yml new file mode 100644 index 0000000..5fd2e1e --- /dev/null +++ b/modules/esha/sig/config/install/node.type.fac_page.yml @@ -0,0 +1,26 @@ +uuid: b7471e78-83f0-4359-9512-d4a8f02c2218 +langcode: en +status: true +dependencies: + enforced: + module: + - acadmix_faculty + module: + - menu_ui + enforced: + module: + - sig +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +_core: + default_config_hash: yZnGgm-oTEuH3Qz8VcW49f94qFn-pYOYZdrX601an0U +name: 'Faculty Page' +type: fac_page +description: 'Content template for opening Faculty Page' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/sig/config/install/node.type.special_interest_groups.yml b/modules/esha/sig/config/install/node.type.special_interest_groups.yml new file mode 100644 index 0000000..7a413fb --- /dev/null +++ b/modules/esha/sig/config/install/node.type.special_interest_groups.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - sig +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Special Interest Groups' +type: special_interest_groups +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/esha/sig/sig.info.yml b/modules/esha/sig/sig.info.yml new file mode 100644 index 0000000..94c6b38 --- /dev/null +++ b/modules/esha/sig/sig.info.yml @@ -0,0 +1,10 @@ +name: 'sig' +type: module +description: 'Module for Special Interest Groups Content Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:path + - drupal:node + - drupal:user + - drupal:menu_ui diff --git a/modules/esha/sig/sig.install b/modules/esha/sig/sig.install new file mode 100644 index 0000000..b032a5b --- /dev/null +++ b/modules/esha/sig/sig.install @@ -0,0 +1,22 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function sig_uninstall() { //<-- replace “welcome” with your module machine name + // Load services. + $queryFactory = \Drupal::service('entity.query'); + $nodeStorage = \Drupal::entityManager()->getStorage('node'); + + // Query all entity. + $query = $queryFactory->get('node') +// <-- replace event in below line with your content type machine name + ->condition('type', 'special_interest_groups'); + $nids = $query->execute(); + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} diff --git a/modules/esha/sig/sig.module b/modules/esha/sig/sig.module new file mode 100644 index 0000000..72809bb --- /dev/null +++ b/modules/esha/sig/sig.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains sig.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function sig_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the sig module. + case 'help.page.sig': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Module for Special Interest Groups Content Type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function sig_theme() { + return [ + 'sig' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/esha/sig/templates/sig.html.twig b/modules/esha/sig/templates/sig.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/esha/sig/templates/sig.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/esha/sig/tests/src/Functional/LoadTest.php b/modules/esha/sig/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..8b87e58 --- /dev/null +++ b/modules/esha/sig/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\sig\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group sig + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['sig']; + + /** + * 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); + } + +} |