diff options
Diffstat (limited to 'modules/mansimran/international_transfer_program')
19 files changed, 722 insertions, 0 deletions
diff --git a/modules/mansimran/international_transfer_program/composer.json b/modules/mansimran/international_transfer_program/composer.json new file mode 100644 index 0000000..f6d69e0 --- /dev/null +++ b/modules/mansimran/international_transfer_program/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/international_transfer_program", + "type": "drupal-module", + "description": "Importing itp content type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/international_transfer_program", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/international_transfer_program", + "source": "http://cgit.drupalcode.org/international_transfer_program" + }, + "require": { } +} diff --git a/modules/mansimran/international_transfer_program/config/install/core.entity_form_display.node.international_transfer_program.default.yml b/modules/mansimran/international_transfer_program/config/install/core.entity_form_display.node.international_transfer_program.default.yml new file mode 100644 index 0000000..8b36945 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/core.entity_form_display.node.international_transfer_program.default.yml @@ -0,0 +1,104 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.international_transfer_program.body + - field.field.node.international_transfer_program.field_country + - field.field.node.international_transfer_program.field_link_ + - node.type.international_transfer_program + module: + - link + - path + - text + enforced: + module: + - international_transfer_program +id: node.international_transfer_program.default +targetEntityType: node +bundle: international_transfer_program +mode: default +content: + body: + type: text_textarea_with_summary + weight: 122 + 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_country: + weight: 121 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_link_: + weight: 123 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + 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/mansimran/international_transfer_program/config/install/core.entity_view_display.node.international_transfer_program.default.yml b/modules/mansimran/international_transfer_program/config/install/core.entity_view_display.node.international_transfer_program.default.yml new file mode 100644 index 0000000..a562947 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/core.entity_view_display.node.international_transfer_program.default.yml @@ -0,0 +1,54 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.international_transfer_program.body + - field.field.node.international_transfer_program.field_country + - field.field.node.international_transfer_program.field_link_ + - node.type.international_transfer_program + module: + - link + - text + - user + enforced: + module: + - international_transfer_program +id: node.international_transfer_program.default +targetEntityType: node +bundle: international_transfer_program +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_country: + weight: 103 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_link_: + weight: 102 + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + links: + weight: 100 + region: content + settings: { } + third_party_settings: { } +hidden: + langcode: true diff --git a/modules/mansimran/international_transfer_program/config/install/core.entity_view_display.node.international_transfer_program.teaser.yml b/modules/mansimran/international_transfer_program/config/install/core.entity_view_display.node.international_transfer_program.teaser.yml new file mode 100644 index 0000000..da309d5 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/core.entity_view_display.node.international_transfer_program.teaser.yml @@ -0,0 +1,37 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.international_transfer_program.body + - field.field.node.international_transfer_program.field_country + - field.field.node.international_transfer_program.field_link_ + - node.type.international_transfer_program + module: + - text + - user + enforced: + module: + - international_transfer_program +id: node.international_transfer_program.teaser +targetEntityType: node +bundle: international_transfer_program +mode: teaser +content: + body: + label: hidden + type: text_summary_or_trimmed + weight: 100 + settings: + trim_length: 600 + third_party_settings: { } + region: content + links: + weight: 101 + region: content + settings: { } + third_party_settings: { } +hidden: + field_country: true + field_link_: true + langcode: true diff --git a/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.body.yml b/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.body.yml new file mode 100644 index 0000000..6e1d9a4 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.international_transfer_program + module: + - text + enforced: + module: + - international_transfer_program +id: node.international_transfer_program.body +field_name: body +entity_type: node +bundle: international_transfer_program +label: 'Courses offered' +description: 'Courses offered by the universty' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.field_country.yml b/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.field_country.yml new file mode 100644 index 0000000..e06d229 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.field_country.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_country + - node.type.international_transfer_program + - taxonomy.vocabulary.continent + enforced: + module: + - international_transfer_program +id: node.international_transfer_program.field_country +field_name: field_country +entity_type: node +bundle: international_transfer_program +label: Country +description: 'Country these Universities hail from ' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + continent: continent + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.field_link_.yml b/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.field_link_.yml new file mode 100644 index 0000000..a91b41a --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/field.field.node.international_transfer_program.field_link_.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_link_ + - node.type.international_transfer_program + module: + - link + enforced: + module: + - international_transfer_program +id: node.international_transfer_program.field_link_ +field_name: field_link_ +entity_type: node +bundle: international_transfer_program +label: 'Link ' +description: 'Link to University Site' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/international_transfer_program/config/install/field.storage.node.field_country.yml b/modules/mansimran/international_transfer_program/config/install/field.storage.node.field_country.yml new file mode 100644 index 0000000..f55fb70 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/field.storage.node.field_country.yml @@ -0,0 +1,23 @@ +uuid: c654ef80-5314-4310-94b9-b63bd020ee15 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - international_transfer_program +id: node.field_country +field_name: field_country +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/mansimran/international_transfer_program/config/install/field.storage.node.field_link_.yml b/modules/mansimran/international_transfer_program/config/install/field.storage.node.field_link_.yml new file mode 100644 index 0000000..dc08f55 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/field.storage.node.field_link_.yml @@ -0,0 +1,22 @@ +uuid: e3f5e53c-5cb3-457e-a83e-e7d59177cf48 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - international_transfer_program +id: node.field_link_ +field_name: field_link_ +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/mansimran/international_transfer_program/config/install/node.type.international_transfer_program.yml b/modules/mansimran/international_transfer_program/config/install/node.type.international_transfer_program.yml new file mode 100644 index 0000000..1a7af9b --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/node.type.international_transfer_program.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - international_transfer_program +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'International Transfer Program' +type: international_transfer_program +description: 'The foreign Universities VIT is affliated with ' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/mansimran/international_transfer_program/config/install/taxonomy.vocabulary.continent.yml b/modules/mansimran/international_transfer_program/config/install/taxonomy.vocabulary.continent.yml new file mode 100644 index 0000000..bf855cf --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/taxonomy.vocabulary.continent.yml @@ -0,0 +1,12 @@ +uuid: a5725386-67c9-44f9-9b47-efaec62ff7a1 +langcode: en +status: true +dependencies: + enforced: + module: + - international_transfer_program +name: Country +vid: continent +description: 'Country where the university is from ' +hierarchy: 0 +weight: 0 diff --git a/modules/mansimran/international_transfer_program/config/install/views.view.itp.yml b/modules/mansimran/international_transfer_program/config/install/views.view.itp.yml new file mode 100644 index 0000000..baf41c9 --- /dev/null +++ b/modules/mansimran/international_transfer_program/config/install/views.view.itp.yml @@ -0,0 +1,201 @@ +langcode: en +status: true +dependencies: + config: + - node.type.international_transfer_program + module: + - node + - user + enforced: + module: + - international_transfer_program +id: itp +label: ITP +module: views +description: 'List of various ITPs ' +tag: '' +base_table: node_field_data +base_field: nid +core: 8.x +display: + default: + display_plugin: default + id: default + display_title: Master + position: 0 + display_options: + access: + type: perm + options: + perm: 'access content' + cache: + type: tag + options: { } + query: + type: views_query + options: + disable_sql_rewrite: false + distinct: false + replica: false + query_comment: '' + query_tags: { } + exposed_form: + type: basic + options: + submit_button: Apply + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + pager: + type: some + options: + items_per_page: 5 + offset: 0 + style: + type: default + options: + grouping: { } + row_class: '' + default_row_class: true + row: + type: fields + options: + default_field_elements: true + inline: { } + separator: '' + hide_empty: false + fields: + title: + id: title + table: node_field_data + field: title + settings: + link_to_entity: true + plugin_id: field + relationship: none + group_type: group + admin_label: '' + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + click_sort_column: value + type: string + group_column: value + group_columns: { } + group_rows: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' + field_api_classes: false + filters: + status: + value: '1' + table: node_field_data + field: status + plugin_id: boolean + entity_type: node + entity_field: status + id: status + expose: + operator: '' + group: 1 + type: + id: type + table: node_field_data + field: type + value: + international_transfer_program: international_transfer_program + entity_type: node + entity_field: type + plugin_id: bundle + sorts: + created: + id: created + table: node_field_data + field: created + relationship: none + group_type: group + admin_label: '' + order: ASC + exposed: false + expose: + label: '' + granularity: second + entity_type: node + entity_field: created + plugin_id: date + title: 'International Transfer Program' + header: { } + footer: { } + empty: { } + relationships: { } + arguments: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - 'user.node_grants:view' + - user.permissions + tags: { } + block_1: + display_plugin: block + id: block_1 + display_title: Block + position: 1 + display_options: + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_content' + - 'languages:language_interface' + - 'user.node_grants:view' + - user.permissions + tags: { } + diff --git a/modules/mansimran/international_transfer_program/international_transfer_program.info.yml b/modules/mansimran/international_transfer_program/international_transfer_program.info.yml new file mode 100644 index 0000000..006ae84 --- /dev/null +++ b/modules/mansimran/international_transfer_program/international_transfer_program.info.yml @@ -0,0 +1,13 @@ +name: 'international transfer program' +type: module +description: 'Importing itp content type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:node + - drupal:menu_ui + - drupal:taxonomy + - drupal:link + - drupal:path + - drupal:user + - drupal:text
\ No newline at end of file diff --git a/modules/mansimran/international_transfer_program/international_transfer_program.install b/modules/mansimran/international_transfer_program/international_transfer_program.install new file mode 100644 index 0000000..5ee7ff5 --- /dev/null +++ b/modules/mansimran/international_transfer_program/international_transfer_program.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function international_transfer_program_uninstall() { + // 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', 'international_transfer_program'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + diff --git a/modules/mansimran/international_transfer_program/international_transfer_program.module b/modules/mansimran/international_transfer_program/international_transfer_program.module new file mode 100644 index 0000000..e9d514e --- /dev/null +++ b/modules/mansimran/international_transfer_program/international_transfer_program.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains international_transfer_program.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function international_transfer_program_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the international_transfer_program module. + case 'help.page.international_transfer_program': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Importing itp content type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function international_transfer_program_theme() { + return [ + 'international_transfer_program' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/mansimran/international_transfer_program/international_transfer_program.routing.yml b/modules/mansimran/international_transfer_program/international_transfer_program.routing.yml new file mode 100644 index 0000000..f313f01 --- /dev/null +++ b/modules/mansimran/international_transfer_program/international_transfer_program.routing.yml @@ -0,0 +1,8 @@ + +international_transfer_program.itp_controller_hello: + path: '/international_transfer_program/hello/{name}' + defaults: + _controller: '\Drupal\international_transfer_program\Controller\itpController::hello' + _title: 'itpController' + requirements: + _permission: 'access content' diff --git a/modules/mansimran/international_transfer_program/src/Controller/itpController.php b/modules/mansimran/international_transfer_program/src/Controller/itpController.php new file mode 100644 index 0000000..a76697c --- /dev/null +++ b/modules/mansimran/international_transfer_program/src/Controller/itpController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\international_transfer_program\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class itpController. + */ +class itpController 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/mansimran/international_transfer_program/templates/international-transfer-program.html.twig b/modules/mansimran/international_transfer_program/templates/international-transfer-program.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/mansimran/international_transfer_program/templates/international-transfer-program.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/mansimran/international_transfer_program/tests/src/Functional/LoadTest.php b/modules/mansimran/international_transfer_program/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..b469416 --- /dev/null +++ b/modules/mansimran/international_transfer_program/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\international_transfer_program\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group international_transfer_program + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['international_transfer_program']; + + /** + * 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); + } + +} |