summaryrefslogtreecommitdiff
path: root/modules/esha/labmanual
diff options
context:
space:
mode:
Diffstat (limited to 'modules/esha/labmanual')
-rw-r--r--modules/esha/labmanual/composer.json14
-rw-r--r--modules/esha/labmanual/config/install/core.entity_form_display.node.lab_manual.default.yml91
-rw-r--r--modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.default.yml40
-rw-r--r--modules/esha/labmanual/config/install/core.entity_view_display.node.lab_manual.teaser.yml27
-rw-r--r--modules/esha/labmanual/config/install/field.field.node.lab_manual.field_description.yml21
-rw-r--r--modules/esha/labmanual/config/install/field.field.node.lab_manual.field_manual.yml29
-rw-r--r--modules/esha/labmanual/config/install/field.storage.node.field_description.yml21
-rw-r--r--modules/esha/labmanual/config/install/field.storage.node.field_manual.yml25
-rw-r--r--modules/esha/labmanual/config/install/migrate_plus.migration.labmanuals_import.yml51
-rw-r--r--modules/esha/labmanual/config/install/node.type.lab_manual.yml20
-rw-r--r--modules/esha/labmanual/config/install/views.view.lab_manual.yml320
-rw-r--r--modules/esha/labmanual/labmanual.info.yml12
-rw-r--r--modules/esha/labmanual/labmanual.install22
-rw-r--r--modules/esha/labmanual/labmanual.module35
14 files changed, 728 insertions, 0 deletions
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/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..6efdf35
--- /dev/null
+++ b/modules/esha/labmanual/config/install/field.storage.node.field_description.yml
@@ -0,0 +1,21 @@
+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..19b2ceb
--- /dev/null
+++ b/modules/esha/labmanual/config/install/field.storage.node.field_manual.yml
@@ -0,0 +1,25 @@
+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/config/install/views.view.lab_manual.yml b/modules/esha/labmanual/config/install/views.view.lab_manual.yml
new file mode 100644
index 0000000..705a7cd
--- /dev/null
+++ b/modules/esha/labmanual/config/install/views.view.lab_manual.yml
@@ -0,0 +1,320 @@
+langcode: en
+status: true
+dependencies:
+ config:
+ - field.storage.node.field_description
+ - field.storage.node.field_manual
+ - node.type.lab_manual
+ module:
+ - file
+ - node
+ - user
+id: lab_manual
+label: 'Lab Manual'
+module: views
+description: ''
+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: 20
+ offset: 0
+ id: 0
+ total_pages: null
+ 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
+ tags:
+ previous: ‹‹
+ next: ››
+ style:
+ type: table
+ row:
+ type: fields
+ fields:
+ title:
+ id: title
+ table: node_field_data
+ field: title
+ entity_type: node
+ entity_field: title
+ 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: ''
+ label: Title
+ 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
+ field_description:
+ id: field_description
+ table: node__field_description
+ field: field_description
+ relationship: none
+ group_type: group
+ admin_label: ''
+ label: Description
+ 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: basic_string
+ settings: { }
+ 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
+ plugin_id: field
+ field_manual:
+ id: field_manual
+ table: node__field_manual
+ field: field_manual
+ relationship: none
+ group_type: group
+ admin_label: ''
+ label: Manual
+ 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: target_id
+ type: file_default
+ settings:
+ use_description_as_link_text: true
+ group_column: ''
+ 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
+ plugin_id: field
+ 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:
+ lab_manual: lab_manual
+ 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: 'Lab Manual'
+ header: { }
+ 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:
+ - 'config:field.storage.node.field_description'
+ - 'config:field.storage.node.field_manual'
+ page_1:
+ display_plugin: page
+ id: page_1
+ display_title: Page
+ position: 1
+ display_options:
+ display_extenders: { }
+ path: lab-manual
+ cache_metadata:
+ max-age: -1
+ contexts:
+ - 'languages:language_content'
+ - 'languages:language_interface'
+ - url.query_args
+ - 'user.node_grants:view'
+ - user.permissions
+ tags:
+ - 'config:field.storage.node.field_description'
+ - 'config:field.storage.node.field_manual'
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',
+ ],
+ ];
+}