summaryrefslogtreecommitdiff
path: root/modules/mansimran/research_centers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mansimran/research_centers')
-rw-r--r--modules/mansimran/research_centers/composer.json14
-rw-r--r--modules/mansimran/research_centers/config/install/core.entity_form_display.node.research_centers.default.yml84
-rw-r--r--modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.default.yml31
-rw-r--r--modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.teaser.yml33
-rw-r--r--modules/mansimran/research_centers/config/install/field.field.node.research_centers.body.yml24
-rw-r--r--modules/mansimran/research_centers/config/install/migrate_plus.migration.research_center_1.yml45
-rw-r--r--modules/mansimran/research_centers/config/install/node.type.research_centers.yml20
-rw-r--r--modules/mansimran/research_centers/config/install/views.view.research_center.yml217
-rw-r--r--modules/mansimran/research_centers/research_centers.info.yml10
-rw-r--r--modules/mansimran/research_centers/research_centers.install27
-rw-r--r--modules/mansimran/research_centers/research_centers.module35
-rw-r--r--modules/mansimran/research_centers/templates/research-centers.html.twig1
-rw-r--r--modules/mansimran/research_centers/tests/src/Functional/LoadTest.php46
13 files changed, 587 insertions, 0 deletions
diff --git a/modules/mansimran/research_centers/composer.json b/modules/mansimran/research_centers/composer.json
new file mode 100644
index 0000000..d1be1cc
--- /dev/null
+++ b/modules/mansimran/research_centers/composer.json
@@ -0,0 +1,14 @@
+{
+ "name": "drupal/research_centers",
+ "type": "drupal-module",
+ "description": "Research centers content type",
+ "keywords": ["Drupal"],
+ "license": "GPL-2.0+",
+ "homepage": "https://www.drupal.org/project/research_centers",
+ "minimum-stability": "dev",
+ "support": {
+ "issues": "https://www.drupal.org/project/issues/research_centers",
+ "source": "http://cgit.drupalcode.org/research_centers"
+ },
+ "require": { }
+}
diff --git a/modules/mansimran/research_centers/config/install/core.entity_form_display.node.research_centers.default.yml b/modules/mansimran/research_centers/config/install/core.entity_form_display.node.research_centers.default.yml
new file mode 100644
index 0000000..4d1a00a
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/core.entity_form_display.node.research_centers.default.yml
@@ -0,0 +1,84 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.research_centers.body
+ - node.type.research_centers
+ module:
+ - path
+ - text
+ enforced:
+ module:
+ - research_centers
+id: node.research_centers.default
+targetEntityType: node
+bundle: research_centers
+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: { }
+ 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/research_centers/config/install/core.entity_view_display.node.research_centers.default.yml b/modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.default.yml
new file mode 100644
index 0000000..cc5ce4f
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.default.yml
@@ -0,0 +1,31 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.field.node.research_centers.body
+ - node.type.research_centers
+ module:
+ - text
+ - user
+ enforced:
+ module:
+ - research_centers
+id: node.research_centers.default
+targetEntityType: node
+bundle: research_centers
+mode: default
+content:
+ body:
+ label: hidden
+ type: text_default
+ weight: 101
+ settings: { }
+ third_party_settings: { }
+ region: content
+ links:
+ weight: 100
+ settings: { }
+ third_party_settings: { }
+ region: content
+hidden:
+ langcode: true
diff --git a/modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.teaser.yml b/modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.teaser.yml
new file mode 100644
index 0000000..209e923
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/core.entity_view_display.node.research_centers.teaser.yml
@@ -0,0 +1,33 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - core.entity_view_mode.node.teaser
+ - field.field.node.research_centers.body
+ - node.type.research_centers
+ module:
+ - text
+ - user
+ enforced:
+ module:
+ - research_centers
+id: node.research_centers.teaser
+targetEntityType: node
+bundle: research_centers
+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:
+ langcode: true
diff --git a/modules/mansimran/research_centers/config/install/field.field.node.research_centers.body.yml b/modules/mansimran/research_centers/config/install/field.field.node.research_centers.body.yml
new file mode 100644
index 0000000..47e04d8
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/field.field.node.research_centers.body.yml
@@ -0,0 +1,24 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.body
+ - node.type.research_centers
+ module:
+ - text
+ enforced:
+ module:
+ - research_centers
+id: node.research_centers.body
+field_name: body
+entity_type: node
+bundle: research_centers
+label: Body
+description: 'Description about the functionality of the research center'
+required: false
+translatable: true
+default_value: { }
+default_value_callback: ''
+settings:
+ display_summary: true
+field_type: text_with_summary
diff --git a/modules/mansimran/research_centers/config/install/migrate_plus.migration.research_center_1.yml b/modules/mansimran/research_centers/config/install/migrate_plus.migration.research_center_1.yml
new file mode 100644
index 0000000..313b730
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/migrate_plus.migration.research_center_1.yml
@@ -0,0 +1,45 @@
+uuid: 7668fb9e-4358-4d30-b9e1-1cb8071ceba0
+langcode: en
+id: research_center_1
+status: true
+class: null
+field_plugin_method: null
+cck_plugin_method: null
+migration_tags:
+ - CSV
+migration_group: default
+label: 'research_center_csv_import1'
+source:
+ plugin: csv
+ path: /home/mansimran/Desktop/mansimran1/research_centers.csv
+ delimiter: ','
+ enclosure: '"'
+ header_row_count: 1
+ keys:
+ - id
+process:
+ type:
+ plugin: default_value
+ default_value: research_centers
+ source_path:
+ -
+ plugin: skip_on_empty
+ method: process
+ source: logo
+ -
+ plugin: concat
+ delimiter: /
+ source:
+ - constants/file_source
+ - logo
+ title: title
+ body/value: body
+ body/format:
+ plugin: default_value
+ default_value: basic_html
+destination:
+ plugin: 'entity:node'
+ bundle: club_and_chapter
+migration_dependencies:
+ required: { }
+ optional: { }
diff --git a/modules/mansimran/research_centers/config/install/node.type.research_centers.yml b/modules/mansimran/research_centers/config/install/node.type.research_centers.yml
new file mode 100644
index 0000000..032c16a
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/node.type.research_centers.yml
@@ -0,0 +1,20 @@
+langcode: en
+status: true
+dependencies:
+ module:
+ - menu_ui
+ enforced:
+ module:
+ - research_centers
+third_party_settings:
+ menu_ui:
+ available_menus:
+ - main
+ parent: 'main:'
+name: 'Research Centers'
+type: research_centers
+description: 'The different Research Centers of VIT'
+help: ''
+new_revision: true
+preview_mode: 1
+display_submitted: false
diff --git a/modules/mansimran/research_centers/config/install/views.view.research_center.yml b/modules/mansimran/research_centers/config/install/views.view.research_center.yml
new file mode 100644
index 0000000..772e5a4
--- /dev/null
+++ b/modules/mansimran/research_centers/config/install/views.view.research_center.yml
@@ -0,0 +1,217 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - node.type.research_centers
+ module:
+ - node
+ - user
+ enforced:
+ module:
+ - research_centers
+id: research_center
+label: 'Research Center'
+module: views
+description: 'Research centers in VIT'
+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: mini
+ options:
+ items_per_page: 13
+ offset: 0
+ id: 0
+ total_pages: null
+ tags:
+ previous: ‹‹
+ next: ››
+ expose:
+ items_per_page: false
+ items_per_page_label: 'Items per page'
+ items_per_page_options: '5, 10, 25, 50'
+ items_per_page_options_all: false
+ items_per_page_options_all_label: '- All -'
+ offset: false
+ offset_label: Offset
+ style:
+ type: grid
+ options:
+ grouping: { }
+ columns: 2
+ automatic_width: true
+ alignment: horizontal
+ col_class_default: true
+ col_class_custom: ''
+ row_class_default: true
+ row_class_custom: ''
+ row:
+ type: fields
+ options:
+ default_field_elements: true
+ inline: { }
+ separator: ''
+ hide_empty: false
+ fields:
+ title:
+ id: title
+ table: node_field_data
+ field: title
+ entity_type: node
+ entity_field: title
+ label: ''
+ alter:
+ alter_text: false
+ make_link: false
+ absolute: false
+ trim: false
+ word_boundary: false
+ ellipsis: false
+ strip_tags: false
+ html: false
+ hide_empty: false
+ empty_zero: false
+ settings:
+ link_to_entity: true
+ plugin_id: field
+ relationship: none
+ group_type: group
+ admin_label: ''
+ exclude: 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_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:
+ research_centers: research_centers
+ entity_type: node
+ entity_field: type
+ plugin_id: bundle
+ sorts:
+ created:
+ id: created
+ table: node_field_data
+ field: created
+ order: DESC
+ entity_type: node
+ entity_field: created
+ plugin_id: date
+ relationship: none
+ group_type: group
+ admin_label: ''
+ exposed: false
+ expose:
+ label: ''
+ granularity: second
+ title: 'Research Center'
+ header:
+ area_text_custom:
+ id: area_text_custom
+ table: views
+ field: area_text_custom
+ relationship: none
+ group_type: group
+ admin_label: ''
+ empty: false
+ tokenize: false
+ content: "VIT has always been a research –oriented and innovation driven university. This stems from VIT’s firm belief in creative thinking. Henceforth, Research Centres are also made a part of schools to give an opportunity to students to participate in exciting research projects. Automotive research, Crystal Research, Survey Research centre are some of the integral research centres here. \r\n\r\n\r\n\r\n"
+ plugin_id: text_custom
+ footer: { }
+ empty: { }
+ relationships: { }
+ arguments: { }
+ display_extenders: { }
+ cache_metadata:
+ max-age: -1
+ contexts:
+ - 'languages:language_content'
+ - 'languages:language_interface'
+ - url.query_args
+ - 'user.node_grants:view'
+ - user.permissions
+ tags: { }
+ page_1:
+ display_plugin: page
+ id: page_1
+ display_title: Page
+ position: 1
+ display_options:
+ display_extenders: { }
+ path: research-center
+ cache_metadata:
+ max-age: -1
+ contexts:
+ - 'languages:language_content'
+ - 'languages:language_interface'
+ - url.query_args
+ - 'user.node_grants:view'
+ - user.permissions
+ tags: { }
+
diff --git a/modules/mansimran/research_centers/research_centers.info.yml b/modules/mansimran/research_centers/research_centers.info.yml
new file mode 100644
index 0000000..35b4f19
--- /dev/null
+++ b/modules/mansimran/research_centers/research_centers.info.yml
@@ -0,0 +1,10 @@
+name: 'research centers'
+type: module
+description: 'Research centers content type'
+core: 8.x
+package: 'Custom'
+dependencies:
+ - drupal:text
+ - drupal:user
+ - drupal:menu_ui
+ - drupal:path \ No newline at end of file
diff --git a/modules/mansimran/research_centers/research_centers.install b/modules/mansimran/research_centers/research_centers.install
new file mode 100644
index 0000000..2500031
--- /dev/null
+++ b/modules/mansimran/research_centers/research_centers.install
@@ -0,0 +1,27 @@
+
+<?php
+/**
+* Implements hook_uninstall().
+*/
+function research_centers_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', 'research_centers');
+ $nids = $query->execute();
+
+
+
+ // Delete entities.
+ if (!empty($nids)) {
+ $entities = $nodeStorage->loadMultiple($nids);
+ $nodeStorage->delete($entities);
+ }
+}
+
diff --git a/modules/mansimran/research_centers/research_centers.module b/modules/mansimran/research_centers/research_centers.module
new file mode 100644
index 0000000..ea01abc
--- /dev/null
+++ b/modules/mansimran/research_centers/research_centers.module
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * @file
+ * Contains research_centers.module.
+ */
+
+use Drupal\Core\Routing\RouteMatchInterface;
+
+/**
+ * Implements hook_help().
+ */
+function research_centers_help($route_name, RouteMatchInterface $route_match) {
+ switch ($route_name) {
+ // Main module help for the research_centers module.
+ case 'help.page.research_centers':
+ $output = '';
+ $output .= '<h3>' . t('About') . '</h3>';
+ $output .= '<p>' . t('Research centers content type') . '</p>';
+ return $output;
+
+ default:
+ }
+}
+
+/**
+ * Implements hook_theme().
+ */
+function research_centers_theme() {
+ return [
+ 'research_centers' => [
+ 'render element' => 'children',
+ ],
+ ];
+}
diff --git a/modules/mansimran/research_centers/templates/research-centers.html.twig b/modules/mansimran/research_centers/templates/research-centers.html.twig
new file mode 100644
index 0000000..91e43c8
--- /dev/null
+++ b/modules/mansimran/research_centers/templates/research-centers.html.twig
@@ -0,0 +1 @@
+<!-- Add you custom twig html here --> \ No newline at end of file
diff --git a/modules/mansimran/research_centers/tests/src/Functional/LoadTest.php b/modules/mansimran/research_centers/tests/src/Functional/LoadTest.php
new file mode 100644
index 0000000..42318ed
--- /dev/null
+++ b/modules/mansimran/research_centers/tests/src/Functional/LoadTest.php
@@ -0,0 +1,46 @@
+<?php
+
+namespace Drupal\Tests\research_centers\Functional;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Simple test to ensure that main page loads with module enabled.
+ *
+ * @group research_centers
+ */
+class LoadTest extends BrowserTestBase {
+
+ /**
+ * Modules to enable.
+ *
+ * @var array
+ */
+ public static $modules = ['research_centers'];
+
+ /**
+ * 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);
+ }
+
+}