diff options
author | Fahad Israr | 2019-07-03 13:22:13 +0530 |
---|---|---|
committer | Fahad Israr | 2019-07-03 13:22:13 +0530 |
commit | fd04311179377ce2b4c5697be2ae2a2b51a1b2f3 (patch) | |
tree | 8fd529d45e37612de276b07be5caaa7335114c9a /modules/bhavika/photo_gallery | |
parent | 35646d229739b283da6cf1e0958f1f7d28062442 (diff) | |
parent | 58dbf8fcb04c01c338b9e346b8266690c8b92a2f (diff) | |
download | acadmix_distribution-fd04311179377ce2b4c5697be2ae2a2b51a1b2f3.tar.gz acadmix_distribution-fd04311179377ce2b4c5697be2ae2a2b51a1b2f3.tar.bz2 acadmix_distribution-fd04311179377ce2b4c5697be2ae2a2b51a1b2f3.zip |
Merge branch 'master' of https://github.com/FOSSEE/acadmix_distribution
Diffstat (limited to 'modules/bhavika/photo_gallery')
18 files changed, 785 insertions, 0 deletions
diff --git a/modules/bhavika/photo_gallery/composer.json b/modules/bhavika/photo_gallery/composer.json new file mode 100644 index 0000000..4e0d603 --- /dev/null +++ b/modules/bhavika/photo_gallery/composer.json @@ -0,0 +1,13 @@ +{ + "name": "photo_gallery", + "type": "drupal-module", + "description": "This module is for various pictures uploaded on site", + "keywords": [ + ], + "homepage": "https://www.drupal.org/project/photo_gallery", + "minimum-stability": "dev", + "support": { + "issues": "https://www.drupal.org/project/issues/photo_gallery", + "source": "http://cgit.drupalcode.org/photo_gallery", + }, +} diff --git a/modules/bhavika/photo_gallery/config/install/core.entity_form_display.node.photo_gallery.default.yml b/modules/bhavika/photo_gallery/config/install/core.entity_form_display.node.photo_gallery.default.yml new file mode 100644 index 0000000..494750a --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/core.entity_form_display.node.photo_gallery.default.yml @@ -0,0 +1,52 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.photo_gallery.body + - field.field.node.photo_gallery.field_photo_gallery_img + - image.style.thumbnail + - node.type.photo_gallery + module: + - image + - text + enforced: + module: + - photo_gallery +id: node.photo_gallery.default +targetEntityType: node +bundle: photo_gallery +mode: default +content: + body: + weight: 26 + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + third_party_settings: { } + type: text_textarea_with_summary + region: content + field_photo_gallery_img: + weight: 1 + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + type: image_image + region: content + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + langcode: true + path: true + promote: true + status: true + sticky: true + uid: true diff --git a/modules/bhavika/photo_gallery/config/install/core.entity_view_display.node.photo_gallery.default.yml b/modules/bhavika/photo_gallery/config/install/core.entity_view_display.node.photo_gallery.default.yml new file mode 100644 index 0000000..6cf56ae --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/core.entity_view_display.node.photo_gallery.default.yml @@ -0,0 +1,68 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.photo_gallery.body + - field.field.node.photo_gallery.field_photo_gallery_img + - node.type.photo_gallery + module: + - ds + - image + - text + - user + enforced: + module: + - photo_gallery +id: node.photo_gallery.default +targetEntityType: node +bundle: photo_gallery +mode: default +content: + body: + weight: 1 + label: above + settings: { } + third_party_settings: { } + type: text_default + region: content + field_photo_gallery_img: + weight: 0 + label: hidden + settings: + image_style: '' + image_link: '' + third_party_settings: + ds: + ds_limit: '' + ft: + id: expert + settings: + lb: '' + prefix: '' + lbw-el: '' + lbw-cl: '' + lbw-at: '' + ow: true + ow-el: div + ow-cl: mb-10 + ow-at: '' + fis: true + fis-el: div + fis-cl: 'row col-sm-4' + fis-at: '' + fi-el: '' + fi-cl: '' + fi-at: '' + suffix: '' + lbw: false + lb-col: false + ow-def-at: false + ow-def-cl: false + fis-def-at: false + fi: false + fi-def-at: false + type: image + region: content +hidden: + langcode: true + links: true diff --git a/modules/bhavika/photo_gallery/config/install/core.entity_view_display.node.photo_gallery.teaser.yml b/modules/bhavika/photo_gallery/config/install/core.entity_view_display.node.photo_gallery.teaser.yml new file mode 100644 index 0000000..54960ee --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/core.entity_view_display.node.photo_gallery.teaser.yml @@ -0,0 +1,21 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.photo_gallery.field_photo_gallery_img + - node.type.photo_gallery + module: + - user + enforced: + module: + - photo_gallery +id: node.photo_gallery.teaser +targetEntityType: node +bundle: photo_gallery +mode: teaser +content: { } +hidden: + field_photo_gallery_img: true + langcode: true + links: true diff --git a/modules/bhavika/photo_gallery/config/install/field.field.node.photo_gallery.body.yml b/modules/bhavika/photo_gallery/config/install/field.field.node.photo_gallery.body.yml new file mode 100644 index 0000000..b9fcc71 --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/field.field.node.photo_gallery.body.yml @@ -0,0 +1,24 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.photo_gallery + module: + - text + enforced: + module: + - photo_gallery +id: node.photo_gallery.body +field_name: body +entity_type: node +bundle: photo_gallery +label: Body +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: false +field_type: text_with_summary diff --git a/modules/bhavika/photo_gallery/config/install/field.field.node.photo_gallery.field_photo_gallery_img.yml b/modules/bhavika/photo_gallery/config/install/field.field.node.photo_gallery.field_photo_gallery_img.yml new file mode 100644 index 0000000..a3bc37f --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/field.field.node.photo_gallery.field_photo_gallery_img.yml @@ -0,0 +1,40 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_photo_gallery_img + - node.type.photo_gallery + module: + - image + enforced: + module: + - photo_gallery +id: node.photo_gallery.field_photo_gallery_img +field_name: field_photo_gallery_img +entity_type: node +bundle: photo_gallery +label: photo_gallery_img +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + file_directory: photogallery + 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/bhavika/photo_gallery/config/install/field.storage.node.field_photo_gallery_img.yml b/modules/bhavika/photo_gallery/config/install/field.storage.node.field_photo_gallery_img.yml new file mode 100644 index 0000000..5c16698 --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/field.storage.node.field_photo_gallery_img.yml @@ -0,0 +1,36 @@ +langcode: en +status: true +dependencies: + module: + # - field_permissions + - file + - image + - node + enforced: + module: + - photo_gallery +# third_party_settings: +# field_permissions: +# permission_type: public +id: node.field_photo_gallery_img +field_name: field_photo_gallery_img +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/bhavika/photo_gallery/config/install/migrate_plus.migration.photo_gallery_import.yml b/modules/bhavika/photo_gallery/config/install/migrate_plus.migration.photo_gallery_import.yml new file mode 100644 index 0000000..636478a --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/migrate_plus.migration.photo_gallery_import.yml @@ -0,0 +1,51 @@ +uuid: 5eb7bd1c-4d96-4ff1-b6a0-c30d3bb141f0 +language: en +migration_group: default +id: photo_gallery_import +label: 'photo_gallery_import' +source: + plugin: csv + path: /var/www/photogallery/csv/pg.csv + delimiter: ',' + enclosure: '"' + header_row_count: 1 + keys: + - id + constants: + file_source: /var/www/photogallery/images + file_dest: 'public://photo/' +process: + type: + plugin: default_value + default_value: photo_gallery + 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_photo_gallery_img: + - + plugin: explode + delimiter: ',' + source: image + - + plugin: file_import + # source: '@source_path' + destination: constants/file_dest +destination: + plugin: 'entity:node' + bundle: photo_gallery +migration_dependencies: + required: { } + optional: { }
\ No newline at end of file diff --git a/modules/bhavika/photo_gallery/config/install/node.type.photo_gallery.yml b/modules/bhavika/photo_gallery/config/install/node.type.photo_gallery.yml new file mode 100644 index 0000000..f666180 --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/node.type.photo_gallery.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - menu_ui + enforced: + module: + - photo_gallery +# third_party_settings: +# menu_ui: +# available_menus: +# - main +# parent: 'main:' +name: 'Photo Gallery' +type: photo_gallery +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: true diff --git a/modules/bhavika/photo_gallery/config/install/views.view.photo_gallery.yml b/modules/bhavika/photo_gallery/config/install/views.view.photo_gallery.yml new file mode 100644 index 0000000..a7651ff --- /dev/null +++ b/modules/bhavika/photo_gallery/config/install/views.view.photo_gallery.yml @@ -0,0 +1,225 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.storage.node.field_photo_gallery_img + - node.type.photo_gallery + module: + - image + - node + - user + enforced: + module: + - photo_gallery +id: photo_gallery +label: 'Photo Gallery' +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 + options: + grouping: + - + field: field_photo_gallery_img + rendered: true + rendered_strip: false + row_class: '' + default_row_class: true + uses_fields: true + row: + type: 'entity:node' + options: + relationship: none + view_mode: teaser + fields: + field_photo_gallery_img: + id: field_photo_gallery_img + table: node__field_photo_gallery_img + field: field_photo_gallery_img + relationship: none + group_type: group + admin_label: '' + label: '' + 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: false + 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: image + settings: + image_style: '' + image_link: content + group_column: '' + group_columns: { } + group_rows: true + delta_limit: 1 + 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: + photo_gallery: photo_gallery + 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: 'Photo Gallery' + 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_photo_gallery_img' + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: 1 + display_options: + display_extenders: { } + path: photo-gallery + 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_photo_gallery_img' diff --git a/modules/bhavika/photo_gallery/photo_gallery.info.yml b/modules/bhavika/photo_gallery/photo_gallery.info.yml new file mode 100644 index 0000000..2cbcca6 --- /dev/null +++ b/modules/bhavika/photo_gallery/photo_gallery.info.yml @@ -0,0 +1,18 @@ +name: photo_gallery +type: module +description: 'This module is for various pictures uploaded on site' +core: 8.x +package: Custom +dependencies: + - drupal:node + - drupal:text + - drupal:image + - drupal:file + - drupal:user + - drupal:menu_ui + - drupal:taxonomy + - drupal:options + - drupal:path + - ds:ds + - pathauto:pathauto + diff --git a/modules/bhavika/photo_gallery/photo_gallery.install b/modules/bhavika/photo_gallery/photo_gallery.install new file mode 100644 index 0000000..4c95c95 --- /dev/null +++ b/modules/bhavika/photo_gallery/photo_gallery.install @@ -0,0 +1,63 @@ +<?php + + +/** + + +* Implements hook_uninstall(). + + +*/ + + +function photo_gallery_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', 'photo_gallert'); + + + $nids = $query->execute(); + + + + + + + + // Delete entities. + + + if (!empty($nids)) { + + + $entities = $nodeStorage->loadMultiple($nids); + + + $nodeStorage->delete($entities); + + + } + + +} diff --git a/modules/bhavika/photo_gallery/photo_gallery.module b/modules/bhavika/photo_gallery/photo_gallery.module new file mode 100644 index 0000000..17bce25 --- /dev/null +++ b/modules/bhavika/photo_gallery/photo_gallery.module @@ -0,0 +1,35 @@ +<?php + +/** + * @file + * Contains photo_gallery.module. + */ + +use Drupal\Core\Routing\RouteMatchInterface; + +/** + * Implements hook_help(). + */ +function photo_gallery_help($route_name, RouteMatchInterface $route_match) { + switch ($route_name) { + // Main module help for the photo_gallery module. + case 'help.page.photo_gallery': + $output = ''; + $output .= '<h3>' . t('About') . '</h3>'; + $output .= '<p>' . t('This module is for various pictures uploaded on site') . '</p>'; + return $output; + + default: + } +} + +/** + * Implements hook_theme(). + */ +function photo_gallery_theme() { + return [ + 'photo_gallery' => [ + 'render element' => 'children', + ], + ]; +} diff --git a/modules/bhavika/photo_gallery/photo_gallery.routing.yml b/modules/bhavika/photo_gallery/photo_gallery.routing.yml new file mode 100644 index 0000000..cb0a3fb --- /dev/null +++ b/modules/bhavika/photo_gallery/photo_gallery.routing.yml @@ -0,0 +1,8 @@ + +photo_gallery.photo_gallery_controller_photo_gallery: + path: '/photo_gallery' + defaults: + _controller: '\Drupal\photo_gallery\Controller\PhotoGalleryController::photo_gallery' + _title: 'Photo Gallery Module' + requirements: + _permission: 'access content' diff --git a/modules/bhavika/photo_gallery/src/Controller/PhotoGalleryController.php b/modules/bhavika/photo_gallery/src/Controller/PhotoGalleryController.php new file mode 100644 index 0000000..02aca82 --- /dev/null +++ b/modules/bhavika/photo_gallery/src/Controller/PhotoGalleryController.php @@ -0,0 +1,25 @@ +<?php + +namespace Drupal\photo_gallery\Controller; + +use Drupal\Core\Controller\ControllerBase; + +/** + * Class PhotoGalleryController. + */ +class PhotoGalleryController extends ControllerBase { + + /** + * Photo_gallery. + * + * @return string + * Return Hello string. + */ + public function photo_gallery() { + return [ + '#type' => 'markup', + '#markup' => $this->t('Implement method: photo_gallery') + ]; + } + +} diff --git a/modules/bhavika/photo_gallery/templates/photo-gallery.html.twig b/modules/bhavika/photo_gallery/templates/photo-gallery.html.twig new file mode 100644 index 0000000..95722bd --- /dev/null +++ b/modules/bhavika/photo_gallery/templates/photo-gallery.html.twig @@ -0,0 +1 @@ +<!-- Add you custom twig html here --> diff --git a/modules/bhavika/photo_gallery/tests/Controller/PhotoGalleryControllerTest.php b/modules/bhavika/photo_gallery/tests/Controller/PhotoGalleryControllerTest.php new file mode 100644 index 0000000..5dd8f26 --- /dev/null +++ b/modules/bhavika/photo_gallery/tests/Controller/PhotoGalleryControllerTest.php @@ -0,0 +1,39 @@ +<?php + +namespace Drupal\photo_gallery\Tests; + +use Drupal\simpletest\WebTestBase; + +/** + * Provides automated tests for the photo_gallery module. + */ +class PhotoGalleryControllerTest extends WebTestBase { + + + /** + * {@inheritdoc} + */ + public static function getInfo() { + return [ + 'name' => "photo_gallery PhotoGalleryController's controller functionality", + 'description' => 'Test Unit for module photo_gallery and controller PhotoGalleryController.', + 'group' => 'Other', + ]; + } + + /** + * {@inheritdoc} + */ + public function setUp() { + parent::setUp(); + } + + /** + * Tests photo_gallery functionality. + */ + public function testPhotoGalleryController() { + // Check that the basic functions of module photo_gallery. + $this->assertEquals(TRUE, TRUE, 'Test Unit Generated via Drupal Console.'); + } + +} diff --git a/modules/bhavika/photo_gallery/tests/src/Functional/LoadTest.php b/modules/bhavika/photo_gallery/tests/src/Functional/LoadTest.php new file mode 100644 index 0000000..dfe0211 --- /dev/null +++ b/modules/bhavika/photo_gallery/tests/src/Functional/LoadTest.php @@ -0,0 +1,46 @@ +<?php + +namespace Drupal\Tests\photo_gallery\Functional; + +use Drupal\Core\Url; +use Drupal\Tests\BrowserTestBase; + +/** + * Simple test to ensure that main page loads with module enabled. + * + * @group photo_gallery + */ +class LoadTest extends BrowserTestBase { + + /** + * Modules to enable. + * + * @var array + */ + public static $modules = ['photo_gallery']; + + /** + * 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); + } + +} |