diff options
Diffstat (limited to 'modules/bhavika/admission_program')
25 files changed, 832 insertions, 0 deletions
diff --git a/modules/bhavika/admission_program/admission_program.info.yml b/modules/bhavika/admission_program/admission_program.info.yml new file mode 100644 index 0000000..dcae984 --- /dev/null +++ b/modules/bhavika/admission_program/admission_program.info.yml @@ -0,0 +1,16 @@ +name: admission_program +type: module +description: 'This module is for different programs like ug,pg,etc' +core: 8.x +package: Custom +dependencies: + - drupal:node + - drupal:text + - drupal:user + - drupal:menu_ui + - drupal:taxonomy + - drupal:options + - drupal:path + - ds:ds + - pathauto:pathauto + diff --git a/modules/bhavika/admission_program/admission_program.install b/modules/bhavika/admission_program/admission_program.install new file mode 100644 index 0000000..d28043c --- /dev/null +++ b/modules/bhavika/admission_program/admission_program.install @@ -0,0 +1,63 @@ +<?php + + +/** + + +* Implements hook_uninstall(). + + +*/ + + +function admission_program_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', 'new'); + + + $nids = $query->execute(); + + + + + + + + // Delete entities. + + + if (!empty($nids)) { + + + $entities = $nodeStorage->loadMultiple($nids); + + + $nodeStorage->delete($entities); + + + } + + +} diff --git a/modules/bhavika/admission_program/admission_program.module b/modules/bhavika/admission_program/admission_program.module new file mode 100644 index 0000000..ec48694 --- /dev/null +++ b/modules/bhavika/admission_program/admission_program.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains admission_program.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function admission_program_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the admission_program module. + case 'help.page.admission_program': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('This module is for different programs like ug,pg,etc') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function admission_program_theme() { + return [ + 'admission_program' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/bhavika/admission_program/admission_program.routing.yml b/modules/bhavika/admission_program/admission_program.routing.yml new file mode 100644 index 0000000..8bab6bc --- /dev/null +++ b/modules/bhavika/admission_program/admission_program.routing.yml @@ -0,0 +1,8 @@ + +admission_program.admission_program_controller_admission_program: + path: '/admission_program' + defaults: + _controller: '\Drupal\admission_program\Controller\AdmissionProgramController::admission_program' + _title: 'Admission Program Module' + requirements: + _permission: 'access content' diff --git a/modules/bhavika/admission_program/composer.json b/modules/bhavika/admission_program/composer.json new file mode 100644 index 0000000..307177b --- /dev/null +++ b/modules/bhavika/admission_program/composer.json @@ -0,0 +1,13 @@ +{ + "name": "admission_program", + "type": "drupal-module", + "description": "This module is for different programs like ug,pg,etc", + "keywords": [ + ], + "homepage": "https://www.drupal.org/project/admission_program", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/admission_program", + "source": "http://cgit.drupalcode.org/admission_program", + }, +} diff --git a/modules/bhavika/admission_program/config/install/core.entity_form_display.node.new.default.yml b/modules/bhavika/admission_program/config/install/core.entity_form_display.node.new.default.yml new file mode 100644 index 0000000..fa98799 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/core.entity_form_display.node.new.default.yml @@ -0,0 +1,129 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.new.body + - field.field.node.new.field_category1 + - field.field.node.new.field_departmentnew + - field.field.node.new.field_intake1 + - field.field.node.new.field_period + - field.field.node.new.field_year_of_starting + - node.type.new + module: + - path + - text + enforced: + module: + - admission_program +id: node.new.default +targetEntityType: node +bundle: new +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_category1: + weight: 122 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_departmentnew: + weight: 127 + settings: + match_operator: CONTAINS + size: 60 + placeholder: '' + third_party_settings: { } + type: entity_reference_autocomplete + region: content + field_intake1: + weight: 124 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_period: + weight: 125 + settings: + placeholder: '' + third_party_settings: { } + type: number + region: content + field_year_of_starting: + weight: 126 + settings: + placeholder: '' + third_party_settings: { } + type: number + 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/bhavika/admission_program/config/install/core.entity_view_display.node.new.default.yml b/modules/bhavika/admission_program/config/install/core.entity_view_display.node.new.default.yml new file mode 100644 index 0000000..435e308 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/core.entity_view_display.node.new.default.yml @@ -0,0 +1,78 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.new.body + - field.field.node.new.field_category1 + - field.field.node.new.field_departmentnew + - field.field.node.new.field_intake1 + - field.field.node.new.field_period + - field.field.node.new.field_year_of_starting + - node.type.new + module: + - text + - user + enforced: + module: + - admission_program +id: node.new.default +targetEntityType: node +bundle: new +mode: default +content: + body: + label: hidden + type: text_default + weight: 101 + settings: { } + third_party_settings: { } + region: content + field_category1: + weight: 102 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_departmentnew: + weight: 107 + label: above + settings: + link: true + third_party_settings: { } + type: entity_reference_label + region: content + field_intake1: + weight: 104 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_period: + weight: 105 + label: above + settings: + thousand_separator: '' + prefix_suffix: true + third_party_settings: { } + type: number_integer + region: content + field_year_of_starting: + weight: 106 + label: above + settings: + thousand_separator: '' + prefix_suffix: true + third_party_settings: { } + type: number_integer + region: content + links: + weight: 100 + settings: { } + third_party_settings: { } + region: content +hidden: + langcode: true diff --git a/modules/bhavika/admission_program/config/install/core.entity_view_display.node.new.teaser.yml b/modules/bhavika/admission_program/config/install/core.entity_view_display.node.new.teaser.yml new file mode 100644 index 0000000..337300c --- /dev/null +++ b/modules/bhavika/admission_program/config/install/core.entity_view_display.node.new.teaser.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.new.body + - node.type.new + module: + - text + - user + enforced: + module: + - admission_program +id: node.new.teaser +targetEntityType: node +bundle: new +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/bhavika/admission_program/config/install/field.field.node.new.body.yml b/modules/bhavika/admission_program/config/install/field.field.node.new.body.yml new file mode 100644 index 0000000..c370e60 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.field.node.new.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.new + module: + - text + enforced: + module: + - admission_program +id: node.new.body +field_name: body +entity_type: node +bundle: new +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/bhavika/admission_program/config/install/field.field.node.new.field_category1.yml b/modules/bhavika/admission_program/config/install/field.field.node.new.field_category1.yml new file mode 100644 index 0000000..9782c3c --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.field.node.new.field_category1.yml @@ -0,0 +1,29 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_category1 + - node.type.new + enforced: + module: + - admission_program +id: node.new.field_category1 +field_name: field_category1 +entity_type: node +bundle: new +label: Category +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: { } + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/bhavika/admission_program/config/install/field.field.node.new.field_departmentnew.yml b/modules/bhavika/admission_program/config/install/field.field.node.new.field_departmentnew.yml new file mode 100644 index 0000000..6315697 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.field.node.new.field_departmentnew.yml @@ -0,0 +1,30 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_departmentnew + - node.type.department + - node.type.new + enforced: + module: + - admission_program +id: node.new.field_departmentnew +field_name: field_departmentnew +entity_type: node +bundle: new +label: Department +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:node' + handler_settings: + target_bundles: + department: department + sort: + field: _none + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/bhavika/admission_program/config/install/field.field.node.new.field_intake1.yml b/modules/bhavika/admission_program/config/install/field.field.node.new.field_intake1.yml new file mode 100644 index 0000000..496524a --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.field.node.new.field_intake1.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_intake1 + - node.type.new + enforced: + module: + - admission_program +id: node.new.field_intake1 +field_name: field_intake1 +entity_type: node +bundle: new +label: Intake +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/bhavika/admission_program/config/install/field.field.node.new.field_period.yml b/modules/bhavika/admission_program/config/install/field.field.node.new.field_period.yml new file mode 100644 index 0000000..2e46f14 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.field.node.new.field_period.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_period + - node.type.new + enforced: + module: + - admission_program +id: node.new.field_period +field_name: field_period +entity_type: node +bundle: new +label: Period +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + min: null + max: null + prefix: '' + suffix: '' +field_type: integer diff --git a/modules/bhavika/admission_program/config/install/field.field.node.new.field_year_of_starting.yml b/modules/bhavika/admission_program/config/install/field.field.node.new.field_year_of_starting.yml new file mode 100644 index 0000000..b38aaa8 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.field.node.new.field_year_of_starting.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_year_of_starting + - node.type.new + enforced: + module: + - admission_program +id: node.new.field_year_of_starting +field_name: field_year_of_starting +entity_type: node +bundle: new +label: 'year of starting' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + min: null + max: null + prefix: '' + suffix: '' +field_type: integer diff --git a/modules/bhavika/admission_program/config/install/field.storage.node.field_category1.yml b/modules/bhavika/admission_program/config/install/field.storage.node.field_category1.yml new file mode 100644 index 0000000..777087d --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.storage.node.field_category1.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + module: + # - field_permissions + - node + - taxonomy +# third_party_settings: +# field_permissions: +# permission_type: public + enforced: + module: + - admission_program +id: node.field_category1 +field_name: field_category1 +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/bhavika/admission_program/config/install/field.storage.node.field_departmentnew.yml b/modules/bhavika/admission_program/config/install/field.storage.node.field_departmentnew.yml new file mode 100644 index 0000000..64e4e9e --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.storage.node.field_departmentnew.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + module: + # - field_permissions + - node + enforced: + module: + - admission_program +# third_party_settings: +# field_permissions: +# permission_type: public +id: node.field_departmentnew +field_name: field_departmentnew +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/bhavika/admission_program/config/install/field.storage.node.field_intake1.yml b/modules/bhavika/admission_program/config/install/field.storage.node.field_intake1.yml new file mode 100644 index 0000000..ea56a4e --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.storage.node.field_intake1.yml @@ -0,0 +1,27 @@ +langcode: en +status: true +dependencies: + module: + # - field_permissions + - node +# third_party_settings: +# field_permissions: +# permission_type: public + enforced: + module: + - admission_program +id: node.field_intake1 +field_name: field_intake1 +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/bhavika/admission_program/config/install/field.storage.node.field_period.yml b/modules/bhavika/admission_program/config/install/field.storage.node.field_period.yml new file mode 100644 index 0000000..5fe7d64 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.storage.node.field_period.yml @@ -0,0 +1,22 @@ +langcode: en +status: true +dependencies: + module: + - node + enforced: + module: + - admission_program +id: node.field_period +field_name: field_period +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/bhavika/admission_program/config/install/field.storage.node.field_year_of_starting.yml b/modules/bhavika/admission_program/config/install/field.storage.node.field_year_of_starting.yml new file mode 100644 index 0000000..c912cd9 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/field.storage.node.field_year_of_starting.yml @@ -0,0 +1,26 @@ +langcode: en +status: true +dependencies: + module: + # - field_permissions + - node + enforced: + module: + - admission_program +# third_party_settings: +# field_permissions: +# permission_type: public +id: node.field_year_of_starting +field_name: field_year_of_starting +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/bhavika/admission_program/config/install/migrate_plus.migration.course_new.yml b/modules/bhavika/admission_program/config/install/migrate_plus.migration.course_new.yml new file mode 100644 index 0000000..e6d69cb --- /dev/null +++ b/modules/bhavika/admission_program/config/install/migrate_plus.migration.course_new.yml @@ -0,0 +1,46 @@ +uuid: 0acf77ca-22a7-4526-960a-8be56feadb1d +language: en +migration_group: default +id: course_new +class: null +field_plugin_method: null +cck_plugin_method: null +label: 'course_import' +source: + plugin: csv + path: /var/www/Course/sample.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id +process: + type: + plugin: default_value + default_value: new + title: title + body/value: body + body/format: + plugin: default_value + default_value: basic_html + field_category1: + - + plugin: entity_lookup + entity_type: taxonomy_term + bundle: category + source: category + field_period: period + field_intake1: intake + field_year_of_starting: year_of_starting + field_departmentnew: + - + plugin: entity_lookup + entity_type: node + bundle: department + source: department +destination: + plugin: 'entity:node' + bundle: new +migration_dependencies: + required: { } + optional: { }
\ No newline at end of file diff --git a/modules/bhavika/admission_program/config/install/node.type.new.yml b/modules/bhavika/admission_program/config/install/node.type.new.yml new file mode 100644 index 0000000..9a457a3 --- /dev/null +++ b/modules/bhavika/admission_program/config/install/node.type.new.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - admission_program +# third_party_settings: +# menu_ui: +# available_menus: +# - main +# parent: 'main:' +name: Admission_program +type: new +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: true diff --git a/modules/bhavika/admission_program/src/Controller/AdmissionProgramController.php b/modules/bhavika/admission_program/src/Controller/AdmissionProgramController.php new file mode 100644 index 0000000..d701144 --- /dev/null +++ b/modules/bhavika/admission_program/src/Controller/AdmissionProgramController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\admission_program\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class AdmissionProgramController. + */ +class AdmissionProgramController extends ControllerBase { + + /** + * Admission_program. + * + * @return string + * Return Hello string. + */ + public function admission_program() { + return [ + '#type' => 'markup', + '#markup' => $this->t('Implement method: admission_program') + ]; + } + +} diff --git a/modules/bhavika/admission_program/templates/admission-program.html.twig b/modules/bhavika/admission_program/templates/admission-program.html.twig new file mode 100644 index 0000000..95722bd --- /dev/null +++ b/modules/bhavika/admission_program/templates/admission-program.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here --> diff --git a/modules/bhavika/admission_program/tests/Controller/AdmissionProgramControllerTest.php b/modules/bhavika/admission_program/tests/Controller/AdmissionProgramControllerTest.php new file mode 100644 index 0000000..3f828c9 --- /dev/null +++ b/modules/bhavika/admission_program/tests/Controller/AdmissionProgramControllerTest.php @@ -0,0 +1,39 @@ +<?php + +namespace Drupal\admission_program\Tests; + +use Drupal\simpletest\WebTestBase; + +/** + * Provides automated tests for the admission_program module. + */ +class AdmissionProgramControllerTest extends WebTestBase { + + + /** + * {@inheritdoc} + */ + public static function getInfo() { + return [ + 'name' => "admission_program AdmissionProgramController's controller functionality", + 'description' => 'Test Unit for module admission_program and controller AdmissionProgramController.', + 'group' => 'Other', + ]; + } + + /** + * {@inheritdoc} + */ + public function setUp() { + parent::setUp(); + } + + /** + * Tests admission_program functionality. + */ + public function testAdmissionProgramController() { + // Check that the basic functions of module admission_program. + $this->assertEquals(TRUE, TRUE, 'Test Unit Generated via Drupal Console.'); + } + +} diff --git a/modules/bhavika/admission_program/tests/src/Functional/LoadTest.php b/modules/bhavika/admission_program/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..ff2491f --- /dev/null +++ b/modules/bhavika/admission_program/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\admission_program\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group admission_program + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['admission_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); + } + +} |