From 5f0f1f4c3c4dd9efe8e2eac25162f068014121ad Mon Sep 17 00:00:00 2001 From: Rajab Natshah <rajabn@gmail.com> Date: Tue, 30 May 2017 13:30:58 +0300 Subject: [PATCH] Issue #2882198: Updated [CHANGELOG.md, UPDATE.md] files and filtered the code for Drupal 8 Coding Standard --- CHANGELOG.md | 124 +++++++- README.md | 3 +- UPDATE.md | 66 +++- .../varbase_admin/varbase_admin.install | 55 +++- .../varbase_landing/varbase_landing.install | 6 +- .../css/varbase_media.common_logged.css | 12 +- .../varbase_media/varbase_media.install | 29 +- .../varbase_media/varbase_media.module | 47 +-- .../varbase_security/varbase_security.install | 53 +++- .../varbase_seo/varbase_seo.install | 85 +++-- src/Config/ConfigBit.php | 6 +- src/Form/AssemblerForm.php | 8 +- src/assets/robots-staging.txt | 2 +- src/composer/ScriptHandler.php | 12 +- tests/{README.txt => README.md} | 0 tests/features/bootstrap/SelectorsContext.php | 292 +++++++++--------- tests/tools/google/README.txt | 1 - tests/tools/install-varbase/README.txt | 1 - tests/tools/languages/README.txt | 2 +- tests/tools/screenshots/README.txt | 2 +- tests/tools/selectors/README.txt | 2 +- tests/tools/users/README.txt | 2 +- .../VARTHEME_SUBTHEME/VARTHEME_SUBTHEME.theme | 1 + themes/vartheme/theme-settings.php | 5 +- themes/vartheme/vartheme.theme | 1 + .../css/vartheme-admin.theme.style-rtl.css | 10 +- .../css/vartheme-admin.theme.style.css | 10 +- themes/vartheme_admin/vartheme.theme | 1 + varbase.install | 180 +++++++++-- varbase.profile | 5 +- 30 files changed, 719 insertions(+), 304 deletions(-) rename tests/{README.txt => README.md} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57e87a26..903f340a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,123 @@ +## 8.4.04 +* Issue #2871377: Updated [Entity Browser] module from 8.1.0-rc2 to 8.1.0 , and + Updated the patch for entity browser 8.x-1.0 +* Issue #2872094: Updated [Display Suite] module from 8.3.0-beta2 to 8.3.0-beta3 +* Issue #2872095: Updated [webform] module from 8.5.0-beta11 to 8.5.0-beta12 +* Issue #2872100: Added [DRD Agent] module base code, but not enabled. +* Issue #2872103: Added [Node Edit Protection] module. +* Issue #2870172: Added [ Feature: Navigational Features - Other menus. + - Standard menus ] for Automated Functional Testing. +* Issue #2870172: Removed [ Feature: Navigational Features - Other + menus - Standard menus ] . +* Issue #2872284: Enabled [Admin Toolbar Extra Tools] module. +* Issue #2872284: Added the varbase x-small emblem white logo to the admin + toolbar with the varbase/toolbar.icon library. +* Issue #2872284: Added an Updated function to nable Admin Toolbar Extra Tools + module in the next update. +* Issue #2873260: Updated [Devel] module from 8.1.0-rc1 to 8.1.0-rc2 +* Issue #2873263: Updated [video embed field] module from 8.1.4 to 8.1.5 +* Issue #2874207: Updated [Varbase Editor] feature from 8.4.6 to 8.4.7 +* Issue #2874207: Added the [CKEditor - BiDi (Text Direction)] library to to + varbase code because it^s not listed in the Drupal.org + Library Packaging Whitelist, we will move the command to get + the library in the drupal-org.make file, until it been added + to the Packaging Whitelist https://www.drupal.org/node/2874359 +* Issue #2874409: Updated [ctools] module from 8.3.0-beta2 to 8.3.0 +* Issue #2874429: Updated [Pathauto] module from 8.1.0-rc1 to 8.1.0 +* Issue #2874442: Updated [token] module from 8.1.0-rc1 to 8.1.0 +* Issue #2874479: Updated [page manager] module from 8.4.0-beta1 to 8.4.0-beta2 +* Issue #2874483: Updated [panelizer] module from 8.4.0-beta3 to 8.4.0 +* Issue #2874485: Updated [panels] module from 8.4.0-beta1 to 8.4.0 +* Issue #2874602: Updated [View Modes inventory] module + from 8.1.x-dev to 8.1.0-alpha1 +* Issue #2874737: Updated [panels] module from 8.4.0 to 8.4.1 +* Issue #2874798: Updated [Varbase Hero Slider Media] feature module from + 8.4.0-alpha6 to 8.4.0-beta1 +* Issue #2875297: Updated [Varbase Editor] feature from 8.4.7 to 8.4.8 +* Issue #2875297: Updated [ Feature: Content Editing - Rich Text Editor - + Input formats ] automated functional test. +* Issue #2875352: Added newly installed modules in update hook (only modules + that makes sense). +* Issue #2871079: Optimization round no. 2 for varbase admin theme. +* Issue #2875477: Disabled [ds_switch_view_mode] module. +* Issue #2875498: Updated [Varbase Editor] feature from 8.4.8 to 8.4.9 +* Issue #2875352: Enable newly installed modules and disable not needed modules. + in the update function to cover updates from far early + versions. +* Issue #2875600: Updated [Varbase Editor] feature from 8.4.9 to 8.4.10 +* Issue #2875352: Added newly installed modules in update hook (only modules + that makes sense). +* Issue #2875625: Updated [Drupal core] from 8.3.1 to 8.3.2 +* Issue #2875673: Updated [adminimal admin toolbar] from 8.1.3 to 8.1.4 +* Issue #2875677: Updated [Display Suite] module from 8.3.0-beta2 to 8.3.0-beta4 +* Issue #2871254: [Varbase Media] Optimization round no. 4 , and various + admin theme enhancement. +* Issue #2877015: Added [Mail Editor] module. +* Issue #2877033: Added [Honeypot] module. +* Issue #2877033: Updated [varbase security] feature: Have honeypot with log + been sat to true. +* Issue #2877053: Added [Taxonomy access fix] module. +* Issue #2877070: Added [Better Exposed Filters] module. +* Issue #2877079: Added [Menu Admin per Menu] module. +* Issue #2877214: Added [Link Attributes widget] module. +* Issue #2877221: Added [Custom Permissions] module. +* Issue #2877228: Updated [Display Suite] module from 8.3.0-beta4 to 8.3.0-rc1 +* Issue #2877230: Removed Trivial Automated Functional tests, which needs big + time from the robot. +* Issue #2871254: [Varbase Media] Optimization round no. 4 : Added the Symfony + Component Yaml namespace. +* Issue #2877414: Removed [Custom Permissions] module +* Issue #2877427: Updated [Varbase Hero Slider Media] feature module + from 8.4.0-beta1 to 8.4.0-beta2 +* Issue #2877575: Updated [DRD Agent] from 8.3.0 to 8.3.1 +* Issue #2877702: Added the Patch for [Real-time SEO] module to have [ Text + (plain, long) ] filed type [string_log] for yoast seo to use. +* Issue #2878288: Updated [Bootstrap] theme from 8.3.3 to 8.3.4 +* Issue #2878290: Updated [Honeypot] module from 8.1.24 to 8.1.25 +* Issue #2878292: Theme edits for Vartheme: Move title above tabs. +* Issue #2877033: Moved capatch and recaptcha config to config/optional +* Issue #2878296: Add field description to Varbase Core. +* Issue #2875352: Fixed the updated function to NOT enable CAPTCHA, and + reCAPTCHA, But Enable ACE Editor module. +* Issue #2878061: Added Theme Settings for Vartheme (base theme) + with header full-width option. +* Issue #2878061: Optimization for Vartheme Settings to work with + VARTHEME_SUBTHEME too. +* Issue #2878292: Theme edits for Vartheme about edge to edge and bootstrap + spacing and no spacing. +* Issue #2879178: [Varbase Media] Media Enhancements +* Issue #2879178: Updated [Feature: File & Media Management - Assets Management + - Ability to embed existing meida image library in the rich + text editor] Automated Functional Test. +* Issue #2879251: Updated [Bootstrap] theme from 8.3.4 to 8.3.5 +* Updated .travis.yml file : Removed test matrix for PHP7.1 +* Issue #2879403: Updated [Display Suite] module from 8.3.0-rc1 to 8.3.0 +* Issue #2879645: Updated [Varbase Media] Feature: Revised naming for Entity + browsers, and bettered up the upload behaviour with edit. +* Issue #2880116: Updated [dropzonejs] module from 8.1.0-alpha6 to 8.1.0-alpha7 +* Issue #2880252: Updated [CKEditor bidi button] module from 8.1.x-dev to 8.1.0 +* Issue #2874207: Have CKEditor - BiDi (Text Direction) added to the Packaging + Whitelist https://www.drupal.org/node/2874359, So we are + calling it in the .make build file and composer. +* Issue #2881032: Updated [Responsive Theme Preview] module + from 8.1.0-alpha4 to 8.1.0-alpha5 +* Issue #2879178: [Varbase Media] Media Enhancements: Editing title and alt in + WYSIWYG in Varbase when adding Media embed +* Issue #2881954: Updated Media Sizing Media sizes and Responsive View Modes, + Added view modes for "Media" to be same as Responsive image + styles, Edited responsive image styles according to new + standard, Added e2e image style (Edge to Edge) for both + responsive and standard. +* Issue #2882075: Updated [blazy] module from 8.1.0-rc1 to 8.1.0-rc2 +* Issue #2882078: Updated [Display Suite] module from 8.3.0 to 8.3.1 +* Issue #2882100: Updated [slick] module from 8.1.0-rc3 to 8.1.0 +* Issue #2882103: Updated [Slick Media] module from 8.1.0-rc1 to 8.1.0 +* Issue #2882108: Updated [CKEditor BiDi Buttons] module from 8.1.0 to 8.2.0 +* Issue #2882145: Updated [anchor link] module from 8.1.3 to 8.1.4 +* Issue #2882144: Updated [Varbase editor] feature module from 8.x-4.10 to 8.4.11 +* Issue #2882198: Updated [CHANGELOG.md, UPDATE.md] files and filtered the code + for Drupal 8 Coding Standard. + ## 8.4.03 * Issue #2868568: Updated [Bootstrap] theme from 8.3.2 to 8.3.3 * Issue #2865977: Establishing profile inheritance for new distros @@ -48,7 +168,7 @@ * Issue #2864090: Updated [Slick Carousel] module from 8.1.0-rc2 to 8.1.0-rc3 * Issue #2864150: Updated [Varbase Editor] from 8.4.5 to 8.4.6 * Issue #2864258: Enable [ImageMagick] module by default for the image took kit -* Issue #2864261: Add [Image Optimize (or ImageAPI Optimize)] module +* Issue #2864261: Added [Image Optimize (or ImageAPI Optimize)] module * Issue #2864292: Added [Fast 404] module * Issue #2864315: Added [Rabbit Hole] module: Only Enabled [Rabbit Hole, Rabbit Hole nodes, Rabbit Hole taxonomy] modules and basic settings @@ -63,7 +183,7 @@ [Content admin, and Site admin]. * Issue #2864624: Updated [Chaos tool suite (ctools)] module from 8.3.0-alpha27 to 8.3.0-beta1 -* Issue #2864360: Add [Mail System, SMTP] modules +* Issue #2864360: Added [Mail System, SMTP] modules * Issue #2864360: Enabled [Mail System, SMTP] modules * Issue #2864966: [Vartheme] Add [Varbase/bootstrap-print] less/css library in base theme (vartheme) diff --git a/README.md b/README.md index a8837613..35315690 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,8 @@ instructions. ## Install with Composer ``` -composer create-project Vardot/varbase-build:^8.4.03 PROJECT_DIR_NAME --no-dev --no-interaction +composer create-project Vardot/varbase-build:^8.4.04 PROJECT_DIR_NAME --no-dev --no-interaction ``` ## Building Varbase 8.x-4.x projects with Varbase Build https://github.com/Vardot/varbase-build - diff --git a/UPDATE.md b/UPDATE.md index 5c0812ff..e5016eb2 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -22,7 +22,8 @@ developers need to do to update the last release to the new release. * From Drupal website: https://www.drupal.org/project/varbase * Using Varbase-Build: https://packagist.org/packages/vardot/varbase-build -# 4 - From your terminal, change directory to the root directory of your project to do the update: +# 4 - From your terminal, change directory to the root directory of your +# project to do the update: # For Example: @@ -76,6 +77,55 @@ while working on the project. * Done :\) +--- + +# Varbase 8.4.03 to Varbase 8.4.04 + +If you are updating from Varbase 8.4.01 or earlier, please follow the steps +to updated to Varbase 8.4.02 first. in the UPDATE.md file. + +## Updating files with Copy and Paste for Varbase 8.4.03 to Varbase 8.4.04 +``` + Given that we are at the drupal root folder for varbase + When we delete all drupal core folders and files + And we copy all new Varbase files drupal root folder for varbase + And we make sure that we have all custom module or themes still in the + "sites" folder + And we make sure that all new used modules and features are present. + Then we will be ready to update the active config and database. +``` + +## Updating files with composer from Varbase 8.4.03 to Varbase 8.4.04 +``` + Given that we are at the root folder for varbase project, not the docroot + And we make sure that the current "Varbase-Build" composer.json file and + files are the latest + When we delete the "vendor" folder + And we delete the "composer.lock" file + And we run the "composer require vardot/varbase:8.4.04" command + And wait for composer to finish work + Then we should not see any issues in the terminal + And we should see "Writing lock file" in the terminal + And we should see "Generating autoload files" in the terminal + When the composer finishes work with no errors + Then we will be ready to update the active config and database. +``` + +## Updating the active config and database from Varbase 8.4.03 to Varbase 8.4.04 +``` + Given that we are in the docroot of the current Varbase project + And all files are updated using (copy and past) or (composer require/update + When we run drush "updb" or go to "/update.php" + Then we should see the steps of updates. + When we run drush "updb" or go to "/update.php" again + Then we will have the site update with the new Varbase 8.4.04 version + When we go to "/admin/config/development/features" + Then we should see "Changed" + When we follow with each feature to import new changes. + Then we will have the Varbase site updated to the latest version. +``` + + --- # Varbase 8.4.02 to Varbase 8.4.03 @@ -88,7 +138,8 @@ to updated to Varbase 8.4.02 first. in the UPDATE.md file. Given that we are at the drupal root folder for varbase When we delete all drupal core folders and files And we copy all new Varbase files drupal root folder for varbase - And we make sure that we have all custom module or themes still in the "sites" folder + And we make sure that we have all custom module or themes still in the + "sites" folder And we make sure that all new used modules and features are present. Then we will be ready to update the active config and database. ``` @@ -96,7 +147,8 @@ to updated to Varbase 8.4.02 first. in the UPDATE.md file. ## Updating files with composer from Varbase 8.4.02 to Varbase 8.4.03 ``` Given that we are at the root folder for varbase project, not the docroot - And we make sure that the current "Varbase-Build" composer.json file and files are the latest + And we make sure that the current "Varbase-Build" composer.json file and + files are the latest When we delete the "vendor" folder And we delete the "composer.lock" file And we run the "composer require vardot/varbase:8.4.03" command @@ -132,7 +184,8 @@ to updated to Varbase 8.4.02 first. in the UPDATE.md file. Given that we are at the drupal root folder for varbase When we delete all drupal core folders and files And we copy all new Varbase files drupal root folder for varbase - And we make sure that we have all custom module or themes still in the "sites" folder + And we make sure that we have all custom module or themes still in the + "sites" folder And we make sure that all new used modules and features are present. Then we will be ready to update the active config and database. ``` @@ -140,7 +193,8 @@ to updated to Varbase 8.4.02 first. in the UPDATE.md file. ## Updating files with composer from Varbase 8.4.01 to Varbase 8.4.02 ``` Given that we are at the root folder for varbase project, not the docroot - And we make sure that the current "Varbase-Build" composer.json file and files are the latest + And we make sure that the current "Varbase-Build" composer.json file and + files are the latest When we delete the "vendor" folder And we delete the "composer.lock" file And we run the "composer require vardot/varbase:8.4.02" command @@ -167,4 +221,4 @@ to updated to Varbase 8.4.02 first. in the UPDATE.md file. Then we should see "Changed" When we follow with each feature to import new changes. Then we will have the Varbase site updated to the latest version. -``` \ No newline at end of file +``` diff --git a/modules/varbase_features/varbase_admin/varbase_admin.install b/modules/varbase_features/varbase_admin/varbase_admin.install index 3987ff83..b4a74d05 100644 --- a/modules/varbase_features/varbase_admin/varbase_admin.install +++ b/modules/varbase_features/varbase_admin/varbase_admin.install @@ -1,56 +1,87 @@ <?php + /** * @file * Install, update and uninstall functions for the Varbase admin module. */ /** - * Enable newly installed modules and disable not needed modules. + * Enable admin toolbar extra tools module. */ function varbase_admin_update_8001() { - // Enable admin toolbar extra tools module. if (!\Drupal::moduleHandler()->moduleExists('admin_toolbar_tools')) { \Drupal::service('module_installer')->install(['admin_toolbar_tools'], FALSE); } +} - // Enable adminimal admin toolbar tools module. +/** + * Enable adminimal admin toolbar tools module. + */ +function varbase_admin_update_8002() { if (!\Drupal::moduleHandler()->moduleExists('adminimal_admin_toolbar')) { \Drupal::service('module_installer')->install(['adminimal_admin_toolbar'], FALSE); } +} - // Enable Masquerade module. +/** + * Enable Masquerade module. + */ +function varbase_admin_update_8003() { if (!\Drupal::moduleHandler()->moduleExists('masquerade')) { \Drupal::service('module_installer')->install(['masquerade'], FALSE); } +} - // Enable RoleAssign module. +/** + * Enable RoleAssign module. + */ +function varbase_admin_update_8004() { if (!\Drupal::moduleHandler()->moduleExists('roleassign')) { \Drupal::service('module_installer')->install(['roleassign'], FALSE); } +} - // Enable User protect module. +/** + * Enable User protect module. + */ +function varbase_admin_update_8005() { if (!\Drupal::moduleHandler()->moduleExists('userprotect')) { \Drupal::service('module_installer')->install(['userprotect'], FALSE); } +} - // Enable Responsive Preview module. +/** + * Enable Responsive Preview module. + */ +function varbase_admin_update_8006() { if (!\Drupal::moduleHandler()->moduleExists('responsive_preview')) { \Drupal::service('module_installer')->install(['responsive_preview'], FALSE); } +} - // Enable Mail Editor module. +/** + * Enable Mail Editor module. + */ +function varbase_admin_update_8007() { if (!\Drupal::moduleHandler()->moduleExists('mail_edit')) { \Drupal::service('module_installer')->install(['mail_edit'], FALSE); } +} - // Enable Taxonomy access fix module. +/** + * Enable Taxonomy access fix module. + */ +function varbase_admin_update_8008() { if (!\Drupal::moduleHandler()->moduleExists('taxonomy_access_fix')) { \Drupal::service('module_installer')->install(['taxonomy_access_fix'], FALSE); } +} - // Enable Menu Admin per Menu module. +/** + * Enable Menu Admin per Menu module. + */ +function varbase_admin_update_8009() { if (!\Drupal::moduleHandler()->moduleExists('menu_admin_per_menu')) { \Drupal::service('module_installer')->install(['menu_admin_per_menu'], FALSE); } - -} \ No newline at end of file +} diff --git a/modules/varbase_features/varbase_landing/varbase_landing.install b/modules/varbase_features/varbase_landing/varbase_landing.install index 452c77d2..d79f2e57 100644 --- a/modules/varbase_features/varbase_landing/varbase_landing.install +++ b/modules/varbase_features/varbase_landing/varbase_landing.install @@ -1,15 +1,15 @@ <?php + /** * @file * Install, update and uninstall functions for the Varbase landing module. */ /** - * Enable newly installed modules and disable not needed modules. + * Enable panelizer quick edit module. */ function varbase_landing_update_8001() { - // Enable panelizer quick edit module. if (!\Drupal::moduleHandler()->moduleExists('panelizer_quickedit')) { \Drupal::service('module_installer')->install(['panelizer_quickedit'], FALSE); } -} \ No newline at end of file +} diff --git a/modules/varbase_features/varbase_media/css/varbase_media.common_logged.css b/modules/varbase_features/varbase_media/css/varbase_media.common_logged.css index 6ed5627c..1f0b33e2 100644 --- a/modules/varbase_features/varbase_media/css/varbase_media.common_logged.css +++ b/modules/varbase_features/varbase_media/css/varbase_media.common_logged.css @@ -134,15 +134,15 @@ body .form-wrapper.field--widget-entity-browser-entity-reference .entities-list /** Style the dropzone upload in entity browsers **/ .entity-browser-form div#ief-dropzone-upload > div { - border: 2px dashed hsla(0,0%,42%,0.65); - border-radius: 20px; - padding: 15px; - margin: 0 15px 15px 15px; + border: 2px dashed hsla(0,0%,42%,0.65); + border-radius: 20px; + padding: 15px; + margin: 0 15px 15px 15px; } .entity-browser-form div#ief-dropzone-upload > div .image-widget-data { - float: left; - width: 70%; + float: left; + width: 70%; } a.entity-browser-handle.entity-browser-iframe { diff --git a/modules/varbase_features/varbase_media/varbase_media.install b/modules/varbase_features/varbase_media/varbase_media.install index 396a7301..3c1f31f8 100644 --- a/modules/varbase_features/varbase_media/varbase_media.install +++ b/modules/varbase_features/varbase_media/varbase_media.install @@ -29,39 +29,50 @@ function varbase_media_install() { /** * Enable blazy module. - * Updated field preview image style (150xTraditional 4:3). - * Updated browser teaser image meida view mode. - * Updated field preview image meida view mode. - * Changed name of Media embed button to be "Media Library". */ function varbase_media_update_8001() { - // Enable blazy module. if (!\Drupal::moduleHandler()->moduleExists('blazy')) { \Drupal::service('module_installer')->install(['blazy'], FALSE); } +} - // Updated field preview image style (150xTraditional 4:3). +/** + * Updated field preview image style (150xTraditional 4:3). + */ +function varbase_media_update_8002() { $field_preview_image_style_config = \Drupal::service('config.factory')->getEditable('image.style.field_preview'); $field_preview_image_style_config_file = \Drupal::root() . '/' . drupal_get_path('module', 'varbase_media') . '/config/install/image.style.field_preview.yml'; $field_preview_image_style_config_content = file_get_contents($field_preview_image_style_config_file); $field_preview_image_style_config_content_data = (array) Yaml::parse($field_preview_image_style_config_content); $field_preview_image_style_config->setData($field_preview_image_style_config_content_data)->save(); +} - // Updated browser teaser image meida view mode. +/** + * Updated browser teaser image meida view mode. + */ +function varbase_media_update_8003() { $browser_teaser_view_mode_config = \Drupal::service('config.factory')->getEditable('core.entity_view_display.media.image.browser_teaser'); $browser_teaser_view_mode_config_file = \Drupal::root() . '/' . drupal_get_path('module', 'varbase_media') . '/config/install/core.entity_view_display.media.image.browser_teaser.yml'; $browser_teaser_view_mode_config_content = file_get_contents($browser_view_mode_teaser_config_file); $browser_teaser_view_mode_config_content_data = (array) Yaml::parse($browser_teaser_view_mode_config_content); $browser_teaser_view_mode_config->setData($browser_teaser_view_mode_config_content_data)->save(); +} - // Updated field preview image meida view mode. +/** + * Updated field preview image meida view mode. + */ +function varbase_media_update_8004() { $field_preview_view_mode_config = \Drupal::service('config.factory')->getEditable('core.entity_view_display.media.image.field_preview'); $field_preview_view_mode_config_file = \Drupal::root() . '/' . drupal_get_path('module', 'varbase_media') . '/config/install/core.entity_view_display.media.image.field_preview.yml'; $field_preview_view_mode_config_content = file_get_contents($field_preview_view_mode_config_file); $field_preview_view_mode_config_content_data = (array) Yaml::parse($field_preview_view_mode_config_content); $field_preview_view_mode_config->setData($field_preview_view_mode_config_content_data)->save(); +} - // Changed name of Media embed button to be "Media Library". +/** + * Changed name of Media embed button to be "Media Library". + */ +function varbase_media_update_8005() { $embed_button_config = \Drupal::service('config.factory')->getEditable('embed.button.media'); if (strtolower($embed_button_config->get('label')) === 'media') { $embed_button_config->set('label', 'Media Library')->save(); diff --git a/modules/varbase_features/varbase_media/varbase_media.module b/modules/varbase_features/varbase_media/varbase_media.module index a2045912..db6e3d76 100644 --- a/modules/varbase_features/varbase_media/varbase_media.module +++ b/modules/varbase_features/varbase_media/varbase_media.module @@ -5,7 +5,8 @@ * Contains varbase_media.module. */ - use Drupal\editor\Entity\Editor; +use Drupal\Core\Form\FormStateInterface; +use Drupal\editor\Entity\Editor; /** * Implements hook_page_attachments(). @@ -35,7 +36,7 @@ function varbase_media_ckeditor_css_alter(array &$css, Editor $editor) { /** * Implements hook_form_FORM_ID_alter(). */ -function varbase_media_form_entity_embed_dialog_alter (&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { +function varbase_media_form_entity_embed_dialog_alter(&$form, FormStateInterface $form_state, $form_id) { // Only at the embed step. if ($form_state->get('step') == 'embed') { @@ -44,57 +45,59 @@ function varbase_media_form_entity_embed_dialog_alter (&$form, \Drupal\Core\Form $entity_element += $form_state->get('entity_element'); $form_state->set('entity_element', $entity_element); $entity = $form_state->get('entity'); - + // Get the entity bundle type. $bundle_type = $entity->bundle(); $values = $form_state->getValues(); - + switch ($bundle_type) { case "image": // Adding the alt field to the embed dialog form. - $form['attributes']['alt'] = array( + $form['attributes']['alt'] = [ '#title' => t('Alternative text'), '#type' => 'textfield', - '#required' => true , - '#default_value' =>$entity->field_image->alt, + '#required' => TRUE , + '#default_value' => $entity->field_image->alt, '#description' => t('This text will be used by screen readers, search engines, or when the image cannot be loaded.'), - ); + ]; // Adding the title field to the embed dialog form. - $form['attributes']['title'] = array( + $form['attributes']['title'] = [ '#title' => t('Title'), '#type' => 'textfield', '#default_value' => $entity->field_image->title, '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.'), - ); + ]; // Render the Embed entity. - $form['entity'] = array ( + $form['entity'] = [ '#type' => 'item', '#markup' => render(entity_view($entity)), - ); + ]; // Change the "data align" field from rado buttons to Select list. $form['attributes']['data-align']['#type'] = 'select'; $form['attributes']['data-align']['#wrapper_attributes'] = ''; - $form['attributes']['data-align'] += array ( + $form['attributes']['data-align'] += [ '#description' => t('Choose the positioning of the image.'), - ); + ]; - // Add description for the caption field. - $form['attributes']['data-caption'] += array( + // Add description for the caption field. + $form['attributes']['data-caption'] += [ '#description' => t('A caption will be displayed under the image, to describe it in context of your content.'), - ); - - // Adding the updated title and alt text to the media entity. + ]; + + // Adding the updated alt text to the media entity. if (isset($entity_element['alt'])) { - $entity->field_image->alt=$entity_element['alt']; + $entity->field_image->alt = $entity_element['alt']; } - + + // Adding the updated title text to the media entity. if (isset($entity_element['title'])) { - $entity->field_image->title=$entity_element['title']; + $entity->field_image->title = $entity_element['title']; } + $entity->save(); break; } diff --git a/modules/varbase_features/varbase_security/varbase_security.install b/modules/varbase_features/varbase_security/varbase_security.install index f3fb6835..db7ec6ef 100644 --- a/modules/varbase_features/varbase_security/varbase_security.install +++ b/modules/varbase_features/varbase_security/varbase_security.install @@ -1,55 +1,86 @@ <?php + /** * @file * Install, update and uninstall functions for the Varbase Security module. */ /** - * Enable newly installed modules and disable not needed modules. + * Enable Password Policy module. */ function varbase_security_update_8001() { - - // Enable Password Policy module. if (!\Drupal::moduleHandler()->moduleExists('password_policy')) { \Drupal::service('module_installer')->install(['password_policy'], FALSE); } +} - // Enable Password Character Length Policy module. +/** + * Enable Password Character Length Policy module. + */ +function varbase_security_update_8002() { if (!\Drupal::moduleHandler()->moduleExists('password_policy_length')) { \Drupal::service('module_installer')->install(['password_policy_length'], FALSE); } +} - // Enable Password Character Type Policy module. +/** + * Enable Password Character Type Policy module. + */ +function varbase_security_update_8003() { if (!\Drupal::moduleHandler()->moduleExists('password_policy_characters')) { \Drupal::service('module_installer')->install(['password_policy_characters'], FALSE); } +} - // Enable Password Character Types Policy module. +/** + * Enable Password Character Types Policy module. + */ +function varbase_security_update_8004() { if (!\Drupal::moduleHandler()->moduleExists('password_policy_character_types')) { \Drupal::service('module_installer')->install(['password_policy_character_types'], FALSE); } +} - // Enable Password Policy History module. +/** + * Enable Password Policy History module. + */ +function varbase_security_update_8005() { if (!\Drupal::moduleHandler()->moduleExists('password_policy_history')) { \Drupal::service('module_installer')->install(['password_policy_history'], FALSE); } +} - // Enable Password Username Policy module. +/** + * Enable Password Username Policy module. + */ +function varbase_security_update_8006() { if (!\Drupal::moduleHandler()->moduleExists('password_policy_username')) { \Drupal::service('module_installer')->install(['password_policy_username'], FALSE); } +} - // Enable Security Kit module. +/** + * Enable Security Kit module. + */ +function varbase_security_update_8007() { if (!\Drupal::moduleHandler()->moduleExists('seckit')) { \Drupal::service('module_installer')->install(['seckit'], FALSE); } +} - // Enable Security Review module. +/** + * Enable Security Review module. + */ +function varbase_security_update_8008() { if (!\Drupal::moduleHandler()->moduleExists('security_review')) { \Drupal::service('module_installer')->install(['security_review'], FALSE); } +} - // Enable Username Enumeration Prevention module. +/** + * Enable Username Enumeration Prevention module. + */ +function varbase_security_update_8009() { if (!\Drupal::moduleHandler()->moduleExists('username_enumeration_prevention')) { \Drupal::service('module_installer')->install(['username_enumeration_prevention'], FALSE); } diff --git a/modules/varbase_features/varbase_seo/varbase_seo.install b/modules/varbase_features/varbase_seo/varbase_seo.install index a799ea57..c8be9f9d 100644 --- a/modules/varbase_features/varbase_seo/varbase_seo.install +++ b/modules/varbase_features/varbase_seo/varbase_seo.install @@ -1,65 +1,104 @@ <?php + /** * @file * Install, update and uninstall functions for the Varbase SEO module. */ /** - * Enable newly installed modules and disable not needed modules. + * Enable Metatag: Facebook module. */ function varbase_seo_update_8001() { - - // Enable Metatag: Facebookmodule. if (!\Drupal::moduleHandler()->moduleExists('metatag_facebook')) { \Drupal::service('module_installer')->install(['metatag_facebook'], FALSE); } - - // Enable Metatag: Google Plus module. +} + +/** + * Enable Metatag: Google Plus module. + */ +function varbase_seo_update_8002() { if (!\Drupal::moduleHandler()->moduleExists('metatag_google_plus')) { \Drupal::service('module_installer')->install(['metatag_google_plus'], FALSE); } - - // Enable Metatag: hreflang module. +} + +/** + * Enable Metatag: hreflang module. + */ +function varbase_seo_update_8003() { if (!\Drupal::moduleHandler()->moduleExists('metatag_hreflang')) { \Drupal::service('module_installer')->install(['metatag_hreflang'], FALSE); } - - // Enable Metatag: Mobile & UI Adjustments module. +} + +/** + * Enable Metatag: Mobile & UI Adjustments module. + */ +function varbase_seo_update_8004() { if (!\Drupal::moduleHandler()->moduleExists('metatag_mobile')) { \Drupal::service('module_installer')->install(['metatag_mobile'], FALSE); } - - // Enable Metatag: Open Graph module. +} + +/** + * Enable Metatag: Open Graph module. + */ +function varbase_seo_update_8005() { if (!\Drupal::moduleHandler()->moduleExists('metatag_open_graph')) { \Drupal::service('module_installer')->install(['metatag_open_graph'], FALSE); } - - // Enable Metatag: Twitter Cards module. +} + +/** + * Enable Metatag: Twitter Cards module. + */ +function varbase_seo_update_8006() { if (!\Drupal::moduleHandler()->moduleExists('metatag_twitter_cards')) { \Drupal::service('module_installer')->install(['metatag_twitter_cards'], FALSE); } - - // Enable Metatag: Verification module. +} + +/** + * Enable Metatag: Verification module. + */ +function varbase_seo_update_8007() { if (!\Drupal::moduleHandler()->moduleExists('metatag_verification')) { \Drupal::service('module_installer')->install(['metatag_verification'], FALSE); } - - // Enable Real-time SEO for Drupal module. +} + +/** + * Enable Real-time SEO for Drupal module. + */ +function varbase_seo_update_8008() { if (!\Drupal::moduleHandler()->moduleExists('yoast_seo')) { \Drupal::service('module_installer')->install(['yoast_seo'], FALSE); } - - // Enable Simple XML Sitemap module. +} + +/** + * Enable Simple XML Sitemap module. + */ +function varbase_seo_update_8009() { if (!\Drupal::moduleHandler()->moduleExists('simple_sitemap')) { \Drupal::service('module_installer')->install(['simple_sitemap'], FALSE); } - - // Enable Google Analytics module. +} + +/** + * Enable Google Analytics module. + */ +function varbase_seo_update_8010() { if (!\Drupal::moduleHandler()->moduleExists('google_analytics')) { \Drupal::service('module_installer')->install(['google_analytics'], FALSE); } - - // Enable Redirect 404 module. +} + +/** + * Enable Redirect 404 module. + */ +function varbase_seo_update_8011() { if (!\Drupal::moduleHandler()->moduleExists('redirect_404')) { \Drupal::service('module_installer')->install(['redirect_404'], FALSE); } diff --git a/src/Config/ConfigBit.php b/src/Config/ConfigBit.php index be88ed3a..5586f2b2 100644 --- a/src/Config/ConfigBit.php +++ b/src/Config/ConfigBit.php @@ -12,7 +12,7 @@ class ConfigBit { /** * Get Config Bit file. * - * Load config bit file as an array, with full file name and path. + * Load config bit file as an array, with full file name and path. * * @param string $full_config_bit_file_name * Config bit file name in the root configbit folder. @@ -172,7 +172,7 @@ class ConfigBit { $configs_to_add = $config_bit_data['action']['add'][$target]; foreach ($configs_to_add as $config_to_add) { if (!in_array($config_to_add, $config_target_data[$target])) { - $config_target_data[$target][] = (string)$config_to_add; + $config_target_data[$target][] = (string) $config_to_add; } } @@ -219,7 +219,7 @@ class ConfigBit { $configs_to_remove = $config_bit_data['action']['remove'][$target]; foreach ($configs_to_remove as $config_to_remove) { - $config_to_remove_key = array_search((string)$config_to_remove, $config_target_data[$target], TRUE); + $config_to_remove_key = array_search((string) $config_to_remove, $config_target_data[$target], TRUE); if ($config_to_remove_key !== FALSE) { unset($config_target_data[$target][$config_to_remove_key]); } diff --git a/src/Form/AssemblerForm.php b/src/Form/AssemblerForm.php index 46fff05d..992400a9 100644 --- a/src/Form/AssemblerForm.php +++ b/src/Form/AssemblerForm.php @@ -84,7 +84,7 @@ class AssemblerForm extends FormBase { // Extra Varbase components, which could be selected to be installed. $extra_components_to_assemble = ConfigBit::getList($configbit_root . '/extra.components.varbase.bit.yml', 'show_extra_components', TRUE, 'dependencies'); - + // Combine default Varbase components and selected extra varbase components. $combined_extra_components = array_combine($extra_components_to_assemble, $extra_components_to_assemble); $extra_components = array_intersect_key($component_discovery->scan('module'), $combined_extra_components); @@ -94,7 +94,7 @@ class AssemblerForm extends FormBase { yield $key => $extra_component_info; } } - + /** * Get selected extra varbase's components. * @@ -132,14 +132,14 @@ class AssemblerForm extends FormBase { '#type' => 'actions', '#weight' => 5, ]; - + // Configbit root folder for varbase profile. $configbit_root = \Drupal::root() . '/profiles/varbase/configbit'; foreach ($this->getExtraComponentsInfo($configbit_root) as $key => $info) { $form['extra_components']['#options'][$key] = $info['name']; } - + // Default selected extra components. $form['extra_components']['#default_value'] = $this->getSelectedExtraComponents($configbit_root); diff --git a/src/assets/robots-staging.txt b/src/assets/robots-staging.txt index 77470cb3..1f53798b 100644 --- a/src/assets/robots-staging.txt +++ b/src/assets/robots-staging.txt @@ -1,2 +1,2 @@ User-agent: * -Disallow: / \ No newline at end of file +Disallow: / diff --git a/src/composer/ScriptHandler.php b/src/composer/ScriptHandler.php index da2ec518..f0e796c2 100644 --- a/src/composer/ScriptHandler.php +++ b/src/composer/ScriptHandler.php @@ -1,20 +1,19 @@ <?php -/** - * @file - * Contains \Varbase\composer\ScriptHandler. - */ - namespace Varbase\composer; use Symfony\Component\Filesystem\Filesystem; +/** + * Varbase Composer Script Handler. + */ class ScriptHandler { /** * Get the Drupal root directory. * - * @param type $project_root + * @param string or int or object... $project_root + * * @return type */ protected static function getDrupalRoot($project_root) { @@ -107,4 +106,5 @@ class ScriptHandler { file_put_contents($varbase_info_file_with_root_path, $new_varbase_info); } } + } diff --git a/tests/README.txt b/tests/README.md similarity index 100% rename from tests/README.txt rename to tests/README.md diff --git a/tests/features/bootstrap/SelectorsContext.php b/tests/features/bootstrap/SelectorsContext.php index 913117b3..94c34f93 100644 --- a/tests/features/bootstrap/SelectorsContext.php +++ b/tests/features/bootstrap/SelectorsContext.php @@ -1,6 +1,9 @@ <?php -use Behat\Behat\Tester\Exception\PendingException; +/** + * @file + */ + use Drupal\DrupalExtension\Context\RawDrupalContext; use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; @@ -21,18 +24,21 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte /** * Holed a list of CSS Selectors. + * * @var array */ protected $cssSelectors = array(); /** * Holed a list of XPaht Selectors. + * * @var array */ protected $xpathSelectors = array(); /** * Holed the file path for where we could have selector files. + * * @var string */ protected $filesPath = ''; @@ -52,50 +58,50 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte (isset($parameters['files_path']) && isset($parameters['files']))) { - if (isset($parameters['selectors']['css']) && + if (isset($parameters['selectors']['css']) && count($parameters['selectors']['css'])) { - $this->cssSelectors = $parameters['selectors']['css']; - } + $this->cssSelectors = $parameters['selectors']['css']; + } - if (isset($parameters['selectors']['xpath']) && + if (isset($parameters['selectors']['xpath']) && count($parameters['selectors']['xpath'])) { - $this->xpathSelectors = $parameters['selectors']['xpath']; - } + $this->xpathSelectors = $parameters['selectors']['xpath']; + } - if (isset($parameters['files_path']) && + if (isset($parameters['files_path']) && $parameters['files_path'] != '' && isset($parameters['files']) && count($parameters['files'])) { - $this->filesPath = $parameters['files_path']; + $this->filesPath = $parameters['files_path']; - foreach ($parameters['files'] as $selectorFile) { + foreach ($parameters['files'] as $selectorFile) { - // Get the content of the selector file. - $fileContent = file_get_contents($this->filesPath . $selectorFile); - if (!empty($fileContent) && $fileContent != '') { - $fileSelectors = Yaml::parse($fileContent); + // Get the content of the selector file. + $fileContent = file_get_contents($this->filesPath . $selectorFile); + if (!empty($fileContent) && $fileContent != '') { + $fileSelectors = Yaml::parse($fileContent); - // Add all list of CSS selectors to the cssSelectors Array. - if (isset($fileSelectors['css']) && count($fileSelectors['css'])) { + // Add all list of CSS selectors to the cssSelectors Array. + if (isset($fileSelectors['css']) && count($fileSelectors['css'])) { foreach ($fileSelectors['css'] as $selectorName => $cssSelecter) { $this->cssSelectors[$selectorName] = $cssSelecter; } - } - - // Add all list of XPath selectors to the xpathSelectors Array. - if (isset($fileSelectors['xpath']) && count($fileSelectors['xpath'])) { - foreach ($fileSelectors['xpath'] as $selectorName => $xpathSelector) { - $this->xpathSelectors[$selectorName] = $xpathSelector; - } - } - - } - else { - throw new Exception('The file "' . $this->filesPath . $selectorFile . '" is empty or does not exist under SelectorsContext'); - } - } - } + } + + // Add all list of XPath selectors to the xpathSelectors Array. + if (isset($fileSelectors['xpath']) && count($fileSelectors['xpath'])) { + foreach ($fileSelectors['xpath'] as $selectorName => $xpathSelector) { + $this->xpathSelectors[$selectorName] = $xpathSelector; + } + } + + } + else { + throw new Exception('The file "' . $this->filesPath . $selectorFile . '" is empty or does not exist under SelectorsContext'); + } + } + } } else { @@ -109,68 +115,68 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte */ public function registorSelectors(BeforeScenarioScope $scope) { - $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); - - // Register selector name for all CSS selectors. - $css = new CssSelector(); - foreach ($this->cssSelectors as $name => $selector) { - $selectorHandler->registerNamedXpath($name, $css->translateToXPath($selector)); - } - - // Registor selector name for all XPath selectors. - foreach ($this->xpathSelectors as $name => $selector) { - $selectorHandler->registerNamedXpath($name, $selector); - } - } - - /** - * #Selector : To add a new selector name with a css selector. - * - * Exmaple 1: When I add "mobile logo" selector for "header img#logo" css selector - * Example 2: And I add "breadcrumb" selector for ".breadcrumb" css selector - * Example 3: And I add "breadcrumb first link" selector for ".breadcrumb li:nth-child(1) a" css selector - * - * You could add in the behat.yml file so that you do not need - * to add the most general selectors in your features. - * default: - * suites: - * default: - * contexts: - * - SelectorsContext: - * parameters: - * selectors: - * css: - * breadcrumb first link: ".breadcrumb li:nth-child(1) a" - * xpath: - * page title: "//h1[contains(@class, 'page-header')" - * - * @When /^I add "(?P<selectorName>[^"]*)" selector for "(?P<cssSelecter>[^"]*)" css selector$/ - */ - public function addSelectorNameForCssSelector($selectorName, $cssSelecter) { - - if (!empty($selectorName) && $selectorName != '' && !empty($cssSelecter) && $cssSelecter != '') { - // Add the selector name for the css selector to the selectors array. - $this->cssSelectors[$selectorName] = $cssSelecter; - - // Translate the CSS selector to XPath selector - $css = new CssSelector(); - $xpathSelector = $css->translateToXPath($cssSelecter); - - // Registor the name for the XPath selector. - $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); - $selectorHandler->registerNamedXpath($selectorName, $xpathSelector); - } - else { + $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); + + // Register selector name for all CSS selectors. + $css = new CssSelector(); + foreach ($this->cssSelectors as $name => $selector) { + $selectorHandler->registerNamedXpath($name, $css->translateToXPath($selector)); + } + + // Registor selector name for all XPath selectors. + foreach ($this->xpathSelectors as $name => $selector) { + $selectorHandler->registerNamedXpath($name, $selector); + } + } + + /** + * #Selector : To add a new selector name with a css selector. + * + * Exmaple 1: When I add "mobile logo" selector for "header img#logo" css selector + * Example 2: And I add "breadcrumb" selector for ".breadcrumb" css selector + * Example 3: And I add "breadcrumb first link" selector for ".breadcrumb li:nth-child(1) a" css selector. + * + * You could add in the behat.yml file so that you do not need + * to add the most general selectors in your features. + * default: + * suites: + * default: + * contexts: + * - SelectorsContext: + * parameters: + * selectors: + * css: + * breadcrumb first link: ".breadcrumb li:nth-child(1) a" + * xpath: + * page title: "//h1[contains(@class, 'page-header')" + * + * @When /^I add "(?P<selectorName>[^"]*)" selector for "(?P<cssSelecter>[^"]*)" css selector$/ + */ + public function addSelectorNameForCssSelector($selectorName, $cssSelecter) { + + if (!empty($selectorName) && $selectorName != '' && !empty($cssSelecter) && $cssSelecter != '') { + // Add the selector name for the css selector to the selectors array. + $this->cssSelectors[$selectorName] = $cssSelecter; + + // Translate the CSS selector to XPath selector. + $css = new CssSelector(); + $xpathSelector = $css->translateToXPath($cssSelecter); + + // Registor the name for the XPath selector. + $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); + $selectorHandler->registerNamedXpath($selectorName, $xpathSelector); + } + else { throw new Exception('The selector name and the CSS selector must not be empty.'); - } - } + } + } - /** + /** * #Selector : To add a new selector name with a XPath selector. * * Exmaple 1: When I add "page title" selector for "//h1[contains(@class, 'page-header')" xpath selector * Example 2: And I add "Dashboard" selector for "//*[@id='navbar-link-admin-dashboard']" xpath selector - * Example 3: And I add "Vertical orientation" selector for "//*[@id='navbar-item--2-tray']/div/div[2]/div/button" xpath selector + * Example 3: And I add "Vertical orientation" selector for "//*[@id='navbar-item--2-tray']/div/div[2]/div/button" xpath selector. * * * You could add in the behat.yml file so that you do not need @@ -189,27 +195,26 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte * * @When /^I add "(?P<selectorName>[^"]*)" selector for "(?P<xpathSelector>[^"]*)" xpath selector$/ */ - public function addSelectorNameForXPathSelector($selectorName, $xpathSelector) { - if (!empty($selectorName) && $selectorName != '' && !empty($xpathSelector) && $xpathSelector != '') { - // Add the selector name for the XPath selector to the selectors array. - $this->xpathSelectors[$selectorName] = $xpathSelector; - - // Registor the name for the XPath selecor. - $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); - $selectorHandler->registerNamedXpath($selectorName, $xpathSelector); - } - else { + public function addSelectorNameForXPathSelector($selectorName, $xpathSelector) { + if (!empty($selectorName) && $selectorName != '' && !empty($xpathSelector) && $xpathSelector != '') { + // Add the selector name for the XPath selector to the selectors array. + $this->xpathSelectors[$selectorName] = $xpathSelector; + + // Registor the name for the XPath selecor. + $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); + $selectorHandler->registerNamedXpath($selectorName, $xpathSelector); + } + else { throw new Exception('The selector name and the XPath selector must not be empty.'); - } - } + } + } - /** + /** * #Selector : To add a new selector name with a css selector. * * Exmaple 1: When I load selectors from "" file * Example 2: And I add "breadcrumb" selector for ".breadcrumb" css selector - * Example 3: And I add "breadcrumb first link" selector for ".breadcrumb li:nth-child(1) a" css selector - * + * Example 3: And I add "breadcrumb first link" selector for ".breadcrumb li:nth-child(1) a" css selector. * * @When /^I add selectors from "(?P<fileName>[^"]*)" file$/ */ @@ -230,7 +235,7 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte // Add the css selector to the css selector array. $this->cssSelectors[$selectorName] = $cssSelecter; - // Translate the CSS selector to XPath selector + // Translate the CSS selector to XPath selector. $css = new CssSelector(); $xpathSelector = $css->translateToXPath($cssSelecter); @@ -242,14 +247,14 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte // Register all XPath selectors in the file. if (isset($fileSelectors['xpath']) && count($fileSelectors['xpath'])) { - foreach ($fileSelectors['xpath'] as $selectorName => $xpathSelector) { - // Add the selector name for the XPath selector to the xpath selectors array. - $this->xpathSelectors[$selectorName] = $xpathSelector; - - // Registor the name for the XPath selecor. - $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); - $selectorHandler->registerNamedXpath($selectorName, $xpathSelector); - } + foreach ($fileSelectors['xpath'] as $selectorName => $xpathSelector) { + // Add the selector name for the XPath selector to the xpath selectors array. + $this->xpathSelectors[$selectorName] = $xpathSelector; + + // Registor the name for the XPath selecor. + $selectorHandler = $this->getSession()->getSelectorsHandler()->getSelector('named'); + $selectorHandler->registerNamedXpath($selectorName, $xpathSelector); + } } } @@ -258,65 +263,65 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte } } else { - throw new Exception('No file name or the file_path parameter is not right in the behat.yml file'); + throw new Exception('No file name or the file_path parameter is not right in the behat.yml file'); } } /** - * #Selector : To print list of CSS selectors which has been registered. - * - * Exmaple : When I print css selectors - * - * @Then /^(?:|I )print css selectors$/ - */ + * #Selector : To print list of CSS selectors which has been registered. + * + * Exmaple : When I print css selectors. + * + * @Then /^(?:|I )print css selectors$/ + */ public function printCssSelectors() { echo Yaml::dump($this->cssSelectors); } - /** + /** * #Selector : To print list of XPath selectors which has been registered. * - * Exmaple : When I print xpath selectors + * Exmaple : When I print xpath selectors. * * @Then /^(?:|I )print xpath selectors$/ */ - public function printXPathSelectors() { - echo Yaml::dump($this->xpathSelectors); - } - - /** - * #vardot : Move the focus to selected field input element. - * - * Example #1: When I move focus to "Title" field - * Example #2: And I move focus to "Body" field - * - * @When /^(?:|I )move focus to "(?P<selectedField>[^"]*)" field$/ - */ - function moveFocusToField($selectedField) { - $field = $this->getSession()->getPage()->findField($selectedField); - $fieldid = $field->getAttribute('id'); - $this->getSession()->getDriver()->evaluateScript("jQuery('#{$fieldid}').focus();"); - } + public function printXPathSelectors() { + echo Yaml::dump($this->xpathSelectors); + } + + /** + * #vardot : Move the focus to selected field input element. + * + * Example #1: When I move focus to "Title" field + * Example #2: And I move focus to "Body" field. + * + * @When /^(?:|I )move focus to "(?P<selectedField>[^"]*)" field$/ + */ + function moveFocusToField($selectedField) { + $field = $this->getSession()->getPage()->findField($selectedField); + $fieldid = $field->getAttribute('id'); + $this->getSession()->getDriver()->evaluateScript("jQuery('#{$fieldid}').focus();"); + } /** * #vardot : Select all text in selected field input element. * * Example #1: When I select all text in "Title" field - * Example #2: And I select all text in "Description" field + * Example #2: And I select all text in "Description" field. * * @When /^(?:|I )select all text in "(?P<selectedField>[^"]*)" field$/ */ function selectAllTextInField($selectedField) { $field = $this->getSession()->getPage()->findField($selectedField); $fieldid = $field->getAttribute('id'); - $this->getSession()->getDriver()->evaluateScript('document.getElementById("'. $fieldid .'").select();'); + $this->getSession()->getDriver()->evaluateScript('document.getElementById("' . $fieldid . '").select();'); } /** * #vardot : Select part of the text in selected field input element. * * Example #1: When I select from 0 to 5 text in "Title" field - * Example #2: And I select from 0 to 5 text in "Description" field + * Example #2: And I select from 0 to 5 text in "Description" field. * * @When /^(?:|I )select from (?P<from>\d+) to (?P<to>\d+) text in "(?P<selectedField>[^"]*)" field$/ */ @@ -332,14 +337,14 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte $to = $field->getValue()->length(); } - $this->getSession()->getDriver()->evaluateScript('document.getElementById("'. $fieldid .'").setSelectionRange(' . $from . ',' . $to . ');'); + $this->getSession()->getDriver()->evaluateScript('document.getElementById("' . $fieldid . '").setSelectionRange(' . $from . ',' . $to . ');'); } /** * #vardot : Select a part text in selected field input element. * * Example #1: When I select "title name" text in "Title" field - * Example #2: And I select "some content" text in "Description" field + * Example #2: And I select "some content" text in "Description" field. * * @When /^(?:|I )select "(?P<selectedText>[^"]*)" text in "(?P<selectedField>[^"]*)" field$/ */ @@ -359,6 +364,7 @@ class SelectorsContext extends RawDrupalContext implements SnippetAcceptingConte // Have the selectionEnd. $selectionEnd = $selectionStart + strlen($selectedText); - $this->getSession()->getDriver()->evaluateScript('document.getElementById("'. $fieldid .'").setSelectionRange(' . $selectionStart . ',' . $selectionEnd . ');'); + $this->getSession()->getDriver()->evaluateScript('document.getElementById("' . $fieldid . '").setSelectionRange(' . $selectionStart . ',' . $selectionEnd . ');'); } + } diff --git a/tests/tools/google/README.txt b/tests/tools/google/README.txt index a4889115..905608ea 100644 --- a/tests/tools/google/README.txt +++ b/tests/tools/google/README.txt @@ -9,4 +9,3 @@ If you want to test the any of the tools features, you will need to use the $ bin/behat --config=behat.varbase-tools.yml tools/google/gmail.feature $ bin/behat --config=behat.varbase-tools.yml tools/google/search.feature - diff --git a/tests/tools/install-varbase/README.txt b/tests/tools/install-varbase/README.txt index 7af7976e..cc5f34eb 100644 --- a/tests/tools/install-varbase/README.txt +++ b/tests/tools/install-varbase/README.txt @@ -46,4 +46,3 @@ equivalent to: ``` drush site-install varbase --yes --site-name=Varbase4 --account-name=webmaster --account-pass=dD.123123ddd --account-mail=webmaster@vardot.com --db-url=mysql://root:123___@localhost/test_varbase4 --locale=ar varbase_multilingual_configuration.enable_multilingual=false -vvv ``` - diff --git a/tests/tools/languages/README.txt b/tests/tools/languages/README.txt index 919e9080..05c48636 100644 --- a/tests/tools/languages/README.txt +++ b/tests/tools/languages/README.txt @@ -10,4 +10,4 @@ $ bin/behat --config=behat.varbase-tools.yml tools/languages/add-arabic.feature $ bin/behat --config=behat.varbase-tools.yml tools/languages/delete-arabic.feature -$ bin/behat --config=behat.varbase-tools.yml tools/languages/delete-french.feature \ No newline at end of file +$ bin/behat --config=behat.varbase-tools.yml tools/languages/delete-french.feature diff --git a/tests/tools/screenshots/README.txt b/tests/tools/screenshots/README.txt index edc051f0..82a7b763 100644 --- a/tests/tools/screenshots/README.txt +++ b/tests/tools/screenshots/README.txt @@ -4,4 +4,4 @@ step in scenarios. If you want to test the any of the tools features, you will need to use the varbase tools config file, as you can see in the following command. -$ bin/behat --config=behat.varbase-tools.yml tools/screenshots/screenshot-example.feature \ No newline at end of file +$ bin/behat --config=behat.varbase-tools.yml tools/screenshots/screenshot-example.feature diff --git a/tests/tools/selectors/README.txt b/tests/tools/selectors/README.txt index 4085f928..5d4caf2f 100644 --- a/tests/tools/selectors/README.txt +++ b/tests/tools/selectors/README.txt @@ -4,4 +4,4 @@ use types of selectors. If you want to test the any of the tools features, you will need to use the varbase tools config file, as you can see in the following command. -$ bin/behat --config=behat.varbase-tools.yml tools/selectors/test-selectors.feature \ No newline at end of file +$ bin/behat --config=behat.varbase-tools.yml tools/selectors/test-selectors.feature diff --git a/tests/tools/users/README.txt b/tests/tools/users/README.txt index 5be94424..09711de1 100644 --- a/tests/tools/users/README.txt +++ b/tests/tools/users/README.txt @@ -6,4 +6,4 @@ If you want to test the any of the tools features, you will need to use the $ bin/behat --config=behat.varbase-tools.yml tools/users/create-default-testing-users.feature -$ bin/behat --config=behat.varbase-tools.yml tools/users/delete-default-testing-users.feature \ No newline at end of file +$ bin/behat --config=behat.varbase-tools.yml tools/users/delete-default-testing-users.feature diff --git a/themes/vartheme/VARTHEME_SUBTHEME/VARTHEME_SUBTHEME.theme b/themes/vartheme/VARTHEME_SUBTHEME/VARTHEME_SUBTHEME.theme index b874f3e3..342ecf7c 100644 --- a/themes/vartheme/VARTHEME_SUBTHEME/VARTHEME_SUBTHEME.theme +++ b/themes/vartheme/VARTHEME_SUBTHEME/VARTHEME_SUBTHEME.theme @@ -1,4 +1,5 @@ <?php + /** * @file * Varbase sub-theme. diff --git a/themes/vartheme/theme-settings.php b/themes/vartheme/theme-settings.php index 7635cdfb..38ebf081 100644 --- a/themes/vartheme/theme-settings.php +++ b/themes/vartheme/theme-settings.php @@ -1,10 +1,10 @@ <?php + /** * @file * theme-settings.php * * Provides theme settings for vartheme. - * */ use Drupal\Core\Form\FormStateInterface; @@ -39,7 +39,8 @@ function vartheme_form_system_theme_settings_alter(&$form, FormStateInterface $f $form['vartheme_general']['header']['header_container'] = array( '#type' => 'checkbox', '#title' => t('Header Fluid Container'), - '#description' => t('Use <code>.container-fluid</code> class instead of <code>.container</code> for the Header region.<br />See: @vartheme_link', array('@vartheme_link' => Drupal::l('Fluid container' , Url::fromUri('http://getbootstrap.com/css/' , ['absolute' => TRUE , 'fragment' => 'grid-example-fluid'])), + '#description' => t('Use <code>.container-fluid</code> class instead of <code>.container</code> for the Header region.<br />See: @vartheme_link', array( + '@vartheme_link' => Drupal::l('Fluid container', Url::fromUri('http://getbootstrap.com/css/', ['absolute' => TRUE, 'fragment' => 'grid-example-fluid'])), )), '#default_value' => theme_get_setting('header_container'), ); diff --git a/themes/vartheme/vartheme.theme b/themes/vartheme/vartheme.theme index 2f81593e..c10bfd8a 100644 --- a/themes/vartheme/vartheme.theme +++ b/themes/vartheme/vartheme.theme @@ -1,4 +1,5 @@ <?php + /** * @file * Varbase Vartheme. diff --git a/themes/vartheme_admin/css/vartheme-admin.theme.style-rtl.css b/themes/vartheme_admin/css/vartheme-admin.theme.style-rtl.css index 44b3f76e..b67d6be6 100644 --- a/themes/vartheme_admin/css/vartheme-admin.theme.style-rtl.css +++ b/themes/vartheme_admin/css/vartheme-admin.theme.style-rtl.css @@ -10,13 +10,13 @@ div.vertical-tabs ul li.vertical-tab-button.selected a:hover, div.vertical-tabs ul li.vertical-tab-button.selected a:focus, div.vertical-tabs ul li.vertical-tab-button.selected a:active { border-left: 0 none; - border-right: 5px solid #0074BD; + border-right: 5px solid #0074bd; margin-left: 0px; margin-right: -1px; } div.vertical-tabs ul li.vertical-tab-button a { - border-left: 1px solid #CCCCCC; + border-left: 1px solid #cccccc; border-right: 0px; } @@ -29,11 +29,13 @@ html.js input.form-autocomplete { background-position: 7px 7px; } -input.form-autocomplete, select.form-select { +input.form-autocomplete, +select.form-select { background-position: left 50%; } -.style-checkboxes input[type=checkbox], .style-checkboxes input[type=radio] { +.style-checkboxes input[type=checkbox], +.style-checkboxes input[type=radio] { margin-right: 0; margin-left: 0.25em; } diff --git a/themes/vartheme_admin/css/vartheme-admin.theme.style.css b/themes/vartheme_admin/css/vartheme-admin.theme.style.css index 95c8243a..6b1ab177 100644 --- a/themes/vartheme_admin/css/vartheme-admin.theme.style.css +++ b/themes/vartheme_admin/css/vartheme-admin.theme.style.css @@ -3,8 +3,8 @@ input[type="text"] { } #branding { - background-color: #F9F9F9; - border-bottom: 1px solid #EEE; + background-color: #f9f9f9; + border-bottom: 1px solid #eee; } #branding h1.page-title { @@ -16,7 +16,7 @@ div.breadcrumb a:hover { } div.vertical-tabs ul li.first a { - border-top: 2px solid #0074BD; + border-top: 2px solid #0074bd; } /* @todo Fix problem in checboxes with adminimal theme + fpa */ @@ -44,7 +44,8 @@ body .form-wrapper .counter:before { margin-right: 4px; } -ul.tips, div.description, +ul.tips, +div.description, .form-item .description, body .form-wrapper .counter { margin: 0.2em 0 0 0; @@ -65,4 +66,3 @@ body .form-wrapper .counter { .adminimal .ui-dialog.ui-widget.ui-widget-content .media-image-edit-form .form-actions { display: none; } - diff --git a/themes/vartheme_admin/vartheme.theme b/themes/vartheme_admin/vartheme.theme index 394a57ef..6d1cb333 100644 --- a/themes/vartheme_admin/vartheme.theme +++ b/themes/vartheme_admin/vartheme.theme @@ -1,4 +1,5 @@ <?php + /** * @file * Varbase Vartheme admin. diff --git a/varbase.install b/varbase.install index f311564a..d1199e38 100644 --- a/varbase.install +++ b/varbase.install @@ -1,4 +1,5 @@ <?php + /** * @file * Install, update and uninstall functions for the Varbase installation profile. @@ -125,155 +126,270 @@ function varbase_update_8002() { } /** - * Enable newly installed modules and disable not needed modules. + * Disable display suite switch view mode module. */ function varbase_update_8003() { - // Disable display suite switch view mode module. if (\Drupal::moduleHandler()->moduleExists('ds_switch_view_mode')) { \Drupal::service('module_installer')->uninstall(['ds_switch_view_mode'], FALSE); } +} - // Enable node edit protection module. +/** + * Enable node edit protection module. + */ +function varbase_update_8004() { if (!\Drupal::moduleHandler()->moduleExists('node_edit_protection')) { \Drupal::service('module_installer')->install(['node_edit_protection'], FALSE); } +} - // Enable Settings Tray module. +/** + * Enable Settings Tray module. + */ +function varbase_update_8005() { if (!\Drupal::moduleHandler()->moduleExists('outside_in')) { \Drupal::service('module_installer')->install(['outside_in'], FALSE); } +} - // Enable content lock module. +/** + * Enable content lock module. + */ +function varbase_update_8006() { if (!\Drupal::moduleHandler()->moduleExists('content_lock')) { \Drupal::service('module_installer')->install(['content_lock'], FALSE); } +} - // Enable content lock timeout module. +/** + * Enable content lock timeout module. + */ +function varbase_update_8007() { if (!\Drupal::moduleHandler()->moduleExists('content_lock_timeout')) { \Drupal::service('module_installer')->install(['content_lock_timeout'], FALSE); } +} - // Enable entityqueue module. +/** + * Enable entityqueue module. + */ +function varbase_update_8008() { if (!\Drupal::moduleHandler()->moduleExists('entityqueue')) { \Drupal::service('module_installer')->install(['entityqueue'], FALSE); } +} - // Enable Crop API module. +/** + * Enable Crop API module. + */ +function varbase_update_8009() { if (!\Drupal::moduleHandler()->moduleExists('crop')) { \Drupal::service('module_installer')->install(['crop'], FALSE); } +} - // Enable focal point module. +/** + * Enable focal point module. + */ +function varbase_update_8010() { if (!\Drupal::moduleHandler()->moduleExists('focal_point')) { \Drupal::service('module_installer')->install(['focal_point'], FALSE); } +} - // Enable mail system module. +/** + * Enable mail system module. + */ +function varbase_update_8011() { if (!\Drupal::moduleHandler()->moduleExists('mailsystem')) { \Drupal::service('module_installer')->install(['mailsystem'], FALSE); } +} - // Enable SMTP Authentication Support module. +/** + * Enable SMTP Authentication Support module. + */ +function varbase_update_8012() { if (!\Drupal::moduleHandler()->moduleExists('smtp')) { \Drupal::service('module_installer')->install(['smtp'], FALSE); } +} - // Enable DropzoneJS module. +/** + * Enable DropzoneJS module. + */ +function varbase_update_8013() { if (!\Drupal::moduleHandler()->moduleExists('dropzonejs')) { \Drupal::service('module_installer')->install(['dropzonejs'], FALSE); } +} - // Enable DropzoneJS entity browser widget module. +/** + * Enable DropzoneJS entity browser widget module. + */ +function varbase_update_8014() { if (!\Drupal::moduleHandler()->moduleExists('dropzonejs_eb_widget')) { \Drupal::service('module_installer')->install(['dropzonejs_eb_widget'], FALSE); } +} - // Enable Enhanced Entity Browser module. +/** + * Enable Enhanced Entity Browser module. + */ +function varbase_update_8015() { if (!\Drupal::moduleHandler()->moduleExists('entity_browser_enhanced')) { \Drupal::service('module_installer')->install(['entity_browser_enhanced'], FALSE); } +} - // Enable Image Optimize (or ImageAPI Optimize) module. +/** + * Enable Image Optimize (or ImageAPI Optimize) module. + */ +function varbase_update_8016() { if (!\Drupal::moduleHandler()->moduleExists('imageapi_optimize')) { \Drupal::service('module_installer')->install(['imageapi_optimize'], FALSE); } +} - // Enable Libraries module. +/** + * Enable Libraries module. + */ +function varbase_update_8017() { if (!\Drupal::moduleHandler()->moduleExists('libraries')) { \Drupal::service('module_installer')->install(['libraries'], FALSE); } - - // Enable ACE Editor module. +} + +/** + * Enable ACE Editor module. + */ +function varbase_update_8018() { if (!\Drupal::moduleHandler()->moduleExists('ace_editor')) { \Drupal::service('module_installer')->install(['ace_editor'], FALSE); } +} - // Enable Menu Block module. +/** + * Enable Menu Block module. + */ +function varbase_update_8019() { if (!\Drupal::moduleHandler()->moduleExists('menu_block')) { \Drupal::service('module_installer')->install(['menu_block'], FALSE); } +} - // Enable Persistent Login module. +/** + * Enable Persistent Login module. + */ +function varbase_update_8020() { if (!\Drupal::moduleHandler()->moduleExists('persistent_login')) { \Drupal::service('module_installer')->install(['persistent_login'], FALSE); } +} - // Enable Rabbit Hole module. +/** + * Enable Rabbit Hole module. + */ +function varbase_update_8021() { if (!\Drupal::moduleHandler()->moduleExists('rabbit_hole')) { \Drupal::service('module_installer')->install(['rabbit_hole'], FALSE); } +} - // Enable Rabbit Hole nodes module. +/** + * Enable Rabbit Hole nodes module. + */ +function varbase_update_8022() { if (!\Drupal::moduleHandler()->moduleExists('rh_node')) { \Drupal::service('module_installer')->install(['rh_node'], FALSE); } +} - // Enable Rabbit Hole taxonomy module. +/** + * Enable Rabbit Hole taxonomy module. + */ +function varbase_update_8023() { if (!\Drupal::moduleHandler()->moduleExists('rh_taxonomy')) { \Drupal::service('module_installer')->install(['rh_taxonomy'], FALSE); } +} - // Enable Fast 404 module. +/** + * Enable Fast 404 module. + */ +function varbase_update_8024() { if (!\Drupal::moduleHandler()->moduleExists('fast404')) { \Drupal::service('module_installer')->install(['fast404'], FALSE); } +} - // Enable Views Bootstrap module. +/** + * Enable Views Bootstrap module. + */ +function varbase_update_8025() { if (!\Drupal::moduleHandler()->moduleExists('views_bootstrap')) { \Drupal::service('module_installer')->install(['views_bootstrap'], FALSE); } +} - // Enable Varbase Security module. +/** + * Enable Varbase Security module. + */ +function varbase_update_8026() { if (!\Drupal::moduleHandler()->moduleExists('varbase_security')) { \Drupal::service('module_installer')->install(['varbase_security'], FALSE); } +} - // Enable Varbase SEO module. +/** + * Enable Varbase SEO module. + */ +function varbase_update_8027() { if (!\Drupal::moduleHandler()->moduleExists('varbase_seo')) { \Drupal::service('module_installer')->install(['varbase_seo'], FALSE); } +} - // Enable Max length module. +/** + * Enable Max length module. + */ +function varbase_update_8028() { if (!\Drupal::moduleHandler()->moduleExists('maxlength')) { \Drupal::service('module_installer')->install(['maxlength'], FALSE); } +} - // Enable Menu position module. +/** + * Enable Menu position module. + */ +function varbase_update_8029() { if (!\Drupal::moduleHandler()->moduleExists('menu_position')) { \Drupal::service('module_installer')->install(['menu_position'], FALSE); } +} - // Enable Better Exposed Filters module. +/** + * Enable Better Exposed Filters module. + */ +function varbase_update_8030() { if (!\Drupal::moduleHandler()->moduleExists('better_exposed_filters')) { \Drupal::service('module_installer')->install(['better_exposed_filters'], FALSE); } +} - // Enable Link Attributes widget module. +/** + * Enable Link Attributes widget module. + */ +function varbase_update_8031() { if (!\Drupal::moduleHandler()->moduleExists('link_attributes')) { \Drupal::service('module_installer')->install(['link_attributes'], FALSE); } +} - // Add Field Description +/** + * Add Field Description. + */ +function varbase_update_8032() { $profile_path = drupal_get_path('profile', 'varbase') . '/config/install/'; $configs['field.storage.block_content.field_description'] = $profile_path . 'field.storage.block_content.field_description.yml'; $configs['field.storage.node.field_description'] = $profile_path . 'field.storage.node.field_description.yml'; diff --git a/varbase.profile b/varbase.profile index c86211a3..7522dfc0 100644 --- a/varbase.profile +++ b/varbase.profile @@ -1,4 +1,5 @@ <?php + /** * @file * Enables modules and site configuration for a Varbase site installation. @@ -76,7 +77,7 @@ function varbase_install_tasks(&$install_state) { function varbase_assemble_extra_components(array &$install_state) { // Configbit root folder for varbase profile. $configbit_root = \Drupal::root() . '/profiles/varbase/configbit'; - + // Default Varbase components, which must be installed. $default_components = ConfigBit::getList($configbit_root . '/default.components.varbase.bit.yml', 'install_default_components', TRUE, 'dependencies'); @@ -189,7 +190,7 @@ function varbase_fix_entity_update($entity_update) { * Use multilignual in the site. */ function varbase_config_bit_for_multilingual($enable_multilingual) { - + // Configbit root folder for varbase profile. $configbit_root = \Drupal::root() . '/profiles/varbase/configbit'; -- GitLab