diff options
Diffstat (limited to 'modules/fahad/academic_calendar_content')
17 files changed, 713 insertions, 0 deletions
diff --git a/modules/fahad/academic_calendar_content/academic_calendar_content.info.yml b/modules/fahad/academic_calendar_content/academic_calendar_content.info.yml new file mode 100644 index 0000000..a3076e7 --- /dev/null +++ b/modules/fahad/academic_calendar_content/academic_calendar_content.info.yml @@ -0,0 +1,13 @@ +name: 'academic_calendar_content' +type: module +description: 'Academic Calendar Content Type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:file + - drupal:path + - drupal:text + - drupal:user + - drupal:node + - drupal:menu_ui + - drupal:taxonomy
\ No newline at end of file diff --git a/modules/fahad/academic_calendar_content/academic_calendar_content.module b/modules/fahad/academic_calendar_content/academic_calendar_content.module new file mode 100644 index 0000000..9b4e25a --- /dev/null +++ b/modules/fahad/academic_calendar_content/academic_calendar_content.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains academic_calendar_content.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function academic_calendar_content_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the academic_calendar_content module. + case 'help.page.academic_calendar_content': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('Academic Calendar Content Type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function academic_calendar_content_theme() { + return [ + 'academic_calendar_content' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/fahad/academic_calendar_content/composer.json b/modules/fahad/academic_calendar_content/composer.json new file mode 100644 index 0000000..56c9201 --- /dev/null +++ b/modules/fahad/academic_calendar_content/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/academic_calendar_content", + "type": "drupal-module", + "description": "Academic Calendar Content Type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/academic_calendar_content", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/academic_calendar_content", + "source": "http://cgit.drupalcode.org/academic_calendar_content" + }, + "require": { } +} diff --git a/modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml b/modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml new file mode 100644 index 0000000..480e11a --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/core.entity_form_display.node.academic_calendar_content.default.yml @@ -0,0 +1,103 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.academic_calendar_content.body + - field.field.node.academic_calendar_content.field_calender_file + - field.field.node.academic_calendar_content.field_calender_type + - node.type.academic_calendar_content + module: + - file + - path + - text + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.default +targetEntityType: node +bundle: academic_calendar_content +mode: default +content: + body: + type: text_textarea_with_summary + weight: 121 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + third_party_settings: { } + region: content + created: + type: datetime_timestamp + weight: 10 + region: content + settings: { } + third_party_settings: { } + field_calender_file: + weight: 122 + settings: + progress_indicator: throbber + third_party_settings: { } + type: file_generic + region: content + field_calender_type: + weight: 123 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + langcode: + type: language_select + weight: 2 + region: content + settings: + include_locked: true + third_party_settings: { } + path: + type: path + weight: 30 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + settings: + display_label: true + weight: 15 + region: content + third_party_settings: { } + status: + type: boolean_checkbox + settings: + display_label: true + weight: 120 + region: content + third_party_settings: { } + sticky: + type: boolean_checkbox + settings: + display_label: true + weight: 16 + region: content + third_party_settings: { } + title: + type: string_textfield + weight: -5 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 5 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + region: content + third_party_settings: { } +hidden: { } diff --git a/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml new file mode 100644 index 0000000..24048f0 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.default.yml @@ -0,0 +1,50 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.academic_calendar_content.body + - field.field.node.academic_calendar_content.field_calender_file + - field.field.node.academic_calendar_content.field_calender_type + - node.type.academic_calendar_content + module: + - file + - text + - user + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.default +targetEntityType: node +bundle: academic_calendar_content +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_calender_file: + weight: 102 + label: above + settings: + use_description_as_link_text: true + third_party_settings: { } + type: file_default + region: content + field_calender_type: + weight: 103 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml new file mode 100644 index 0000000..cb44542 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/core.entity_view_display.node.academic_calendar_content.teaser.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.academic_calendar_content.body + - node.type.academic_calendar_content + module: + - text + - user + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.teaser +targetEntityType: node +bundle: academic_calendar_content +mode: teaser +content: + body: + label: hidden + type: text_summary_or_trimmed + weight: 101 + settings: + trim_length: 600 + third_party_settings: { } + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml new file mode 100644 index 0000000..4e036ce --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.academic_calendar_content + module: + - text + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.body +field_name: body +entity_type: node +bundle: academic_calendar_content +label: Body +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml new file mode 100644 index 0000000..93aa78f --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_file.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_calender_file + - node.type.academic_calendar_content + module: + - file + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.field_calender_file +field_name: field_calender_file +entity_type: node +bundle: academic_calendar_content +label: 'calender file' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'txt pdf docx doc pptx ppt' + max_filesize: '' + description_field: false + handler: 'default:file' + handler_settings: { } +field_type: file diff --git a/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml new file mode 100644 index 0000000..59ff251 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.field.node.academic_calendar_content.field_calender_type.yml @@ -0,0 +1,31 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_calender_type + - node.type.academic_calendar_content + - taxonomy.vocabulary.academic_calender + enforced: + module: + - academic_calendar_content +id: node.academic_calendar_content.field_calender_type +field_name: field_calender_type +entity_type: node +bundle: academic_calendar_content +label: 'Calender type' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + academic_calender: academic_calender + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml new file mode 100644 index 0000000..65a2c30 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_file.yml @@ -0,0 +1,26 @@ +uuid: fabaae87-0065-4967-8243-6515646f47ee +langcode: en +status: true +dependencies: + module: + - file + - node + enforced: + module: + - academic_calendar_content +id: node.field_calender_file +field_name: field_calender_file +entity_type: node +type: file +settings: + display_field: false + display_default: false + uri_scheme: public + target_type: file +module: file +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml new file mode 100644 index 0000000..cbe0fcf --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/field.storage.node.field_calender_type.yml @@ -0,0 +1,23 @@ +uuid: cd0df0ee-d712-40eb-bbbb-12a100fafb16 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy + enforced: + module: + - academic_calendar_content +id: node.field_calender_type +field_name: field_calender_type +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/fahad/academic_calendar_content/config/install/migrate_plus.migration.academic_calendar.yml b/modules/fahad/academic_calendar_content/config/install/migrate_plus.migration.academic_calendar.yml new file mode 100644 index 0000000..861da64 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/migrate_plus.migration.academic_calendar.yml @@ -0,0 +1,51 @@ +langcode: en +status: true +dependencies: { } +id: academic_calendar +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: null +migration_group: null +label: 'Custom Content migration from CSV for Academic Calendar' +source: + plugin: csv + path: /var/www/html/project/docroot/calendar.csv + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/html/project/docroot/fac_images + file_dest: 'public://fac_images/' +process: + type: + plugin: default_value + default_value: academic_calendar_content + source_path_two: + - + plugin: skip_on_empty + method: process + source: file + - + plugin: concat + delimiter: / + source: + - constants/file_source + - file + title: title + body: body + field_calender_file: + plugin: file_import + source: '@source_path_two' + destination: constants/file_dest + field_calender_type: + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle: academic_calender + source: type +destination: + plugin: 'entity:node' +migration_dependencies: + required: { } + optional: { } diff --git a/modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml b/modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml new file mode 100644 index 0000000..fdb758a --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/node.type.academic_calendar_content.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - academic_calendar_content +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: 'Academic Calendar' +type: academic_calendar_content +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: true diff --git a/modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml b/modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml new file mode 100644 index 0000000..cb954c2 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/taxonomy.vocabulary.academic_calender.yml @@ -0,0 +1,12 @@ +uuid: 216d49b2-aa1e-44b0-b4a0-7c3d78450276 +langcode: en +status: true +dependencies: + enforced: + module: + - academic_calendar_content +name: 'Academic Calender' +vid: academic_calender +description: 'Calendar and Time Table' +hierarchy: 0 +weight: 0 diff --git a/modules/fahad/academic_calendar_content/config/install/views.view.academic_calendar.yml b/modules/fahad/academic_calendar_content/config/install/views.view.academic_calendar.yml new file mode 100644 index 0000000..e5dd8d0 --- /dev/null +++ b/modules/fahad/academic_calendar_content/config/install/views.view.academic_calendar.yml @@ -0,0 +1,202 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.full + - node.type.academic_calendar_content + - system.menu.main + module: + - node + - user +id: academic_calendar +label: 'Academic Calendar' +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: 10 + 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: default + row: + type: 'entity:node' + options: + relationship: none + view_mode: full + 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: + academic_calendar_content: academic_calendar_content + 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: 'Academic Calendar' + 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: { } + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 1 + display_options: + display_extenders: { } + path: academic-calendar + menu: + type: normal + title: Calendar + description: '' + expanded: true + parent: 'menu_link_content:f22943a5-ddf8-4836-9e21-c522d862b8f5' + weight: 0 + context: '0' + menu_name: main + 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/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig b/modules/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/fahad/academic_calendar_content/templates/academic-calendar-content.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php b/modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..b62009a --- /dev/null +++ b/modules/fahad/academic_calendar_content/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\academic_calendar_content\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group academic_calendar_content + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['academic_calendar_content']; + + /** + * 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); + } + +} |