diff options
author | Mansimran7 | 2019-07-02 12:16:59 +0530 |
---|---|---|
committer | Mansimran7 | 2019-07-02 12:16:59 +0530 |
commit | 4e585c030ed6b5ea73b77a696a78f8855d9a26d8 (patch) | |
tree | a9dd98d2648c35aa2357eb7bc473469f6cc8d417 /modules/mansimran/startups | |
parent | 3ad1b8d590d7d11d83e8c923970690900dc31f70 (diff) | |
download | acadmix_distribution-4e585c030ed6b5ea73b77a696a78f8855d9a26d8.tar.gz acadmix_distribution-4e585c030ed6b5ea73b77a696a78f8855d9a26d8.tar.bz2 acadmix_distribution-4e585c030ed6b5ea73b77a696a78f8855d9a26d8.zip |
pushing all custom modules
Diffstat (limited to 'modules/mansimran/startups')
22 files changed, 729 insertions, 0 deletions
diff --git a/modules/mansimran/startups/composer.json b/modules/mansimran/startups/composer.json new file mode 100644 index 0000000..d88bf22 --- /dev/null +++ b/modules/mansimran/startups/composer.json @@ -0,0 +1,14 @@ +{ + "name": "drupal/startups", + "type": "drupal-module", + "description": "startups content type", + "keywords": ["Drupal"], + "license": "GPL-2.0+", + "homepage": "https://www.drupal.org/project/startups", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/startups", + "source": "http://cgit.drupalcode.org/startups" + }, + "require": { } +} diff --git a/modules/mansimran/startups/config/install/core.entity_form_display.node.startups.default.yml b/modules/mansimran/startups/config/install/core.entity_form_display.node.startups.default.yml new file mode 100644 index 0000000..87b0e71 --- /dev/null +++ b/modules/mansimran/startups/config/install/core.entity_form_display.node.startups.default.yml @@ -0,0 +1,123 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.startups.body + - field.field.node.startups.field_fac + - field.field.node.startups.field_startup_image + - field.field.node.startups.field_twitter_link + - field.field.node.startups.field_website_link + - image.style.thumbnail + - node.type.startups + module: + - image + - link + - path + - text + enforced: + module: + - startups +id: node.startups.default +targetEntityType: node +bundle: startups +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_fac: + weight: 125 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_startup_image: + weight: 122 + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + type: image_image + region: content + field_twitter_link: + weight: 126 + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + type: link_default + region: content + field_website_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/startups/config/install/core.entity_view_display.node.startups.default.yml b/modules/mansimran/startups/config/install/core.entity_view_display.node.startups.default.yml new file mode 100644 index 0000000..bbdec6f --- /dev/null +++ b/modules/mansimran/startups/config/install/core.entity_view_display.node.startups.default.yml @@ -0,0 +1,82 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.startups.body + - field.field.node.startups.field_fac + - field.field.node.startups.field_startup_image + - field.field.node.startups.field_twitter_link + - field.field.node.startups.field_website_link + - node.type.startups + module: + - image + - link + - text + - user + enforced: + module: + - startups +id: node.startups.default +targetEntityType: node +bundle: startups +mode: default +content: + body: + label: hidden + type: text_default + weight: 0 + settings: { } + third_party_settings: { } + region: content + field_fac: + weight: 3 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_startup_image: + weight: 1 + label: hidden + settings: + image_style: '' + image_link: '' + third_party_settings: { } + type: image + region: content + field_twitter_link: + weight: 4 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + field_website_link: + weight: 2 + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + type: link + region: content + links: + weight: 5 + region: content + settings: { } + third_party_settings: { } +hidden: + langcode: true diff --git a/modules/mansimran/startups/config/install/core.entity_view_display.node.startups.teaser.yml b/modules/mansimran/startups/config/install/core.entity_view_display.node.startups.teaser.yml new file mode 100644 index 0000000..5e33224 --- /dev/null +++ b/modules/mansimran/startups/config/install/core.entity_view_display.node.startups.teaser.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.startups.body + - node.type.startups + module: + - text + - user + enforced: + module: + - startups +id: node.startups.teaser +targetEntityType: node +bundle: startups +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/mansimran/startups/config/install/field.field.node.startups.body.yml b/modules/mansimran/startups/config/install/field.field.node.startups.body.yml new file mode 100644 index 0000000..6a5487d --- /dev/null +++ b/modules/mansimran/startups/config/install/field.field.node.startups.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.startups + module: + - text + enforced: + module: + - startups +id: node.startups.body +field_name: body +entity_type: node +bundle: startups +label: Body +description: "description about the startup\r\n\r\n" +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true +field_type: text_with_summary diff --git a/modules/mansimran/startups/config/install/field.field.node.startups.field_fac.yml b/modules/mansimran/startups/config/install/field.field.node.startups.field_fac.yml new file mode 100644 index 0000000..6c61da9 --- /dev/null +++ b/modules/mansimran/startups/config/install/field.field.node.startups.field_fac.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_fac + - node.type.startups + module: + - link + enforced: + module: + - startups +id: node.startups.field_fac +field_name: field_fac +entity_type: node +bundle: startups +label: 'Facebook Link' +description: 'Link to facebook page of startup' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/startups/config/install/field.field.node.startups.field_startup_image.yml b/modules/mansimran/startups/config/install/field.field.node.startups.field_startup_image.yml new file mode 100644 index 0000000..2caa6db --- /dev/null +++ b/modules/mansimran/startups/config/install/field.field.node.startups.field_startup_image.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_startup_image + - node.type.startups + module: + - image + enforced: + module: + - startups +id: node.startups.field_startup_image +field_name: field_startup_image +entity_type: node +bundle: startups +label: 'startup image' +description: 'Image of startup' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: startups + file_extensions: 'png gif jpg jpeg' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: true + alt_field_required: true + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + handler: 'default:file' + handler_settings: { } +field_type: image diff --git a/modules/mansimran/startups/config/install/field.field.node.startups.field_twitter_link.yml b/modules/mansimran/startups/config/install/field.field.node.startups.field_twitter_link.yml new file mode 100644 index 0000000..e061215 --- /dev/null +++ b/modules/mansimran/startups/config/install/field.field.node.startups.field_twitter_link.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_twitter_link + - node.type.startups + module: + - link + enforced: + module: + - startups +id: node.startups.field_twitter_link +field_name: field_twitter_link +entity_type: node +bundle: startups +label: 'Twitter link' +description: 'Link to twitter page of startup' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/startups/config/install/field.field.node.startups.field_website_link.yml b/modules/mansimran/startups/config/install/field.field.node.startups.field_website_link.yml new file mode 100644 index 0000000..0642a80 --- /dev/null +++ b/modules/mansimran/startups/config/install/field.field.node.startups.field_website_link.yml @@ -0,0 +1,25 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_website_link + - node.type.startups + module: + - link + enforced: + module: + - startups +id: node.startups.field_website_link +field_name: field_website_link +entity_type: node +bundle: startups +label: 'Website link' +description: 'Link to startup website' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + link_type: 17 + title: 1 +field_type: link diff --git a/modules/mansimran/startups/config/install/field.storage.node.field_fac.yml b/modules/mansimran/startups/config/install/field.storage.node.field_fac.yml new file mode 100644 index 0000000..11d144a --- /dev/null +++ b/modules/mansimran/startups/config/install/field.storage.node.field_fac.yml @@ -0,0 +1,22 @@ +uuid: 7d236b24-5c49-4453-bd3a-1677efa27756 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - startups +id: node.field_fac +field_name: field_fac +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/startups/config/install/field.storage.node.field_startup_image.yml b/modules/mansimran/startups/config/install/field.storage.node.field_startup_image.yml new file mode 100644 index 0000000..63d4731 --- /dev/null +++ b/modules/mansimran/startups/config/install/field.storage.node.field_startup_image.yml @@ -0,0 +1,33 @@ +uuid: 93845d49-4e40-4b45-afd7-fe72de5fe49d +langcode: en +status: true +dependencies: + module: + - file + - image + - node + enforced: + module: + - startups +id: node.field_startup_image +field_name: field_startup_image +entity_type: node +type: image +settings: + uri_scheme: public + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null + target_type: file + display_field: false + display_default: false +module: image +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/mansimran/startups/config/install/field.storage.node.field_twitter_link.yml b/modules/mansimran/startups/config/install/field.storage.node.field_twitter_link.yml new file mode 100644 index 0000000..e19d298 --- /dev/null +++ b/modules/mansimran/startups/config/install/field.storage.node.field_twitter_link.yml @@ -0,0 +1,22 @@ +uuid: 37fe0a08-9f47-46b2-9345-153a73d56665 +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - startups +id: node.field_twitter_link +field_name: field_twitter_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/startups/config/install/field.storage.node.field_website_link.yml b/modules/mansimran/startups/config/install/field.storage.node.field_website_link.yml new file mode 100644 index 0000000..6f17116 --- /dev/null +++ b/modules/mansimran/startups/config/install/field.storage.node.field_website_link.yml @@ -0,0 +1,22 @@ +uuid: 66e04bca-9f7d-43c0-a750-8512cd0dd1ba +langcode: en +status: true +dependencies: + module: + - link + - node + enforced: + module: + - startups +id: node.field_website_link +field_name: field_website_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/startups/config/install/migrate_plus.migration.startups_1.yml b/modules/mansimran/startups/config/install/migrate_plus.migration.startups_1.yml new file mode 100644 index 0000000..c90aa0f --- /dev/null +++ b/modules/mansimran/startups/config/install/migrate_plus.migration.startups_1.yml @@ -0,0 +1,64 @@ +uuid: 428450d7-45f6-400c-b7e1-57b14e9d348d +langcode: en +id: startups_1 +status: true +class: null +field_plugin_method: null +cck_plugin_method: null +migration_tags: + - CSV +migration_group: default +label: 'startups_csv_import1' +source: + plugin: csv + path: /home/mansimran/Desktop/mansimran1/startups1.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/migrationdata/startups + file_dest: 'public://startups/' +process: + type: + plugin: default_value + default_value: startups + source_path: + - + plugin: skip_on_empty + method: process + source: image + - + plugin: concat + delimiter: / + source: + - constants/file_source + - image + title: title + body/value: body + body/format: + plugin: default_value + default_value: basic_html + field_fac/uri: fb_link + field_fac/title: + plugin: default_value + default_value: 'Fb Link' + field_startup_image: + plugin: file_import + source: '@source_path' + destination: constants/file_dest + field_twitter_link/uri: twitter_link + field_twitter_link/title: + plugin: default_value + default_value: 'Twitter Link' + field_website_link/uri: website + field_website_link/title: + plugin: default_value + default_value: 'Startup website' +destination: + plugin: 'entity:node' + bundle: startups +migration_dependencies: + required: { } + optional: { }
\ No newline at end of file diff --git a/modules/mansimran/startups/config/install/node.type.startups.yml b/modules/mansimran/startups/config/install/node.type.startups.yml new file mode 100644 index 0000000..de62c03 --- /dev/null +++ b/modules/mansimran/startups/config/install/node.type.startups.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - startups +third_party_settings: + menu_ui: + available_menus: + - main + parent: 'main:' +name: startups +type: startups +description: 'A list of startups in campus' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/modules/mansimran/startups/src/Controller/startupsController.php b/modules/mansimran/startups/src/Controller/startupsController.php new file mode 100644 index 0000000..a80cf11 --- /dev/null +++ b/modules/mansimran/startups/src/Controller/startupsController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\startups\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class startupsController. + */ +class startupsController 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/startups/startups.info.yml b/modules/mansimran/startups/startups.info.yml new file mode 100644 index 0000000..96618d1 --- /dev/null +++ b/modules/mansimran/startups/startups.info.yml @@ -0,0 +1,13 @@ +name: 'startups' +type: module +description: 'startups content type' +core: 8.x +package: 'Custom' +dependencies: + - drupal:node + - drupal:link + - drupal:file + - drupal:image + - drupal:text + - drupal:user + - drupal:menu_ui diff --git a/modules/mansimran/startups/startups.install b/modules/mansimran/startups/startups.install new file mode 100644 index 0000000..273a08b --- /dev/null +++ b/modules/mansimran/startups/startups.install @@ -0,0 +1,27 @@ + +<?php +/** +* Implements hook_uninstall(). +*/ +function startups_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', 'startups'); + $nids = $query->execute(); + + + + // Delete entities. + if (!empty($nids)) { + $entities = $nodeStorage->loadMultiple($nids); + $nodeStorage->delete($entities); + } +} + diff --git a/modules/mansimran/startups/startups.module b/modules/mansimran/startups/startups.module new file mode 100644 index 0000000..b704942 --- /dev/null +++ b/modules/mansimran/startups/startups.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains startups.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function startups_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the startups module. + case 'help.page.startups': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('startups content type') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function startups_theme() { + return [ + 'startups' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/mansimran/startups/startups.routing.yml b/modules/mansimran/startups/startups.routing.yml new file mode 100644 index 0000000..a1edf8f --- /dev/null +++ b/modules/mansimran/startups/startups.routing.yml @@ -0,0 +1,8 @@ + +startups.startups_controller_hello: + path: '/startups/hello/{name}' + defaults: + _controller: '\Drupal\startups\Controller\startupsController::hello' + _title: 'startupsController' + requirements: + _permission: 'access content' diff --git a/modules/mansimran/startups/templates/startups.html.twig b/modules/mansimran/startups/templates/startups.html.twig new file mode 100644 index 0000000..91e43c8 --- /dev/null +++ b/modules/mansimran/startups/templates/startups.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here -->
\ No newline at end of file diff --git a/modules/mansimran/startups/tests/src/Functional/LoadTest.php b/modules/mansimran/startups/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..949df7a --- /dev/null +++ b/modules/mansimran/startups/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\startups\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group startups + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['startups']; + + /** + * 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); + } + +} |