Skip to content

Commit

Permalink
Refactor: Update FlexSlider documentation links and fix URL generation
Browse files Browse the repository at this point in the history
- Updated FlexSlider documentation links in the flexslider.module file to point to the new URL.
- Fixed URL generation in the FlexsliderOptionsetController.php file by using the `toString()` method on the URL object.

Changes:
- flexslider.module: Updated FlexSlider documentation links.
- src/Controller/FlexsliderOptionsetController.php: Fixed URL generation by using `toString()` method.
  • Loading branch information
RishiKulshreshtha committed May 30, 2023
1 parent e51fd4b commit 3e7218e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flexslider.module
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function flexslider_help($route_name, $route_match) {
case 'help.page.flexslider':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('The FlexSlider module integrates the FlexSlider library into Drupal. For more information about the library, see the <a href=":docs" target="_new">FlexSlider documentation</a>', ['@docs' => Url::fromUri('http://www.woothemes.com/flexslider/')->getUri()]) . '</p>';
$output .= '<p>' . t('The FlexSlider module integrates the FlexSlider library into Drupal. For more information about the library, see the <a href=":docs" target="_new">FlexSlider documentation</a>', [':docs' => Url::fromUri('https://www.woothemes.com/flexslider/')->getUri()]) . '</p>';
$output .= '<h3>' . t('Terminology') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Option set') . '</dt>';
Expand All @@ -134,7 +134,7 @@ function flexslider_help($route_name, $route_match) {
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
$output .= '<dt>' . t('Defining option sets') . '</dt>';
$output .= '<dd>' . t('No matter how you want to use FlexSlider (with fields or views) you need to define "option sets" to tell FlexSlider how you want it to display. Go to the <a href=":flexslider_admin">flexslider administration page</a>. From there you can edit the default option set and define new ones. These will be listed as options in the various forms where you setup FlexSlider to display. NOTE: under advanced options, you can set a namespace prefix for the optionset. This will allow you to build custom CSS for each optionset. Start by copying the flexslider_img.css from the assets subfolder to your theme. Build new custom CSS for each prefix in your optionsets.', [':flexslider_admin' => Url::fromRoute('entity.flexslider.collection')->getInternalPath()]) . '</dd>';
$output .= '<dd>' . t('No matter how you want to use FlexSlider (with fields or views) you need to define "option sets" to tell FlexSlider how you want it to display. Go to the <a href="/:flexslider_admin">flexslider administration page</a>. From there you can edit the default option set and define new ones. These will be listed as options in the various forms where you setup FlexSlider to display. NOTE: under advanced options, you can set a namespace prefix for the optionset. This will allow you to build custom CSS for each optionset. Start by copying the flexslider_img.css from the assets subfolder to your theme. Build new custom CSS for each prefix in your optionsets.', [':flexslider_admin' => Url::fromRoute('entity.flexslider.collection')->getInternalPath()]) . '</dd>';
$output .= '<dt>' . t('Configuring FlexSlider field') . '</dt>';
$output .= '<dd>' . t('The flexslider_fields module provides a way for you to turn a multi-file image field into a FlexSlider. Simply go to the "Manage Display" page of the Content type (or other Entity) containing your field and set the Format of the field to FlexSlider. There you can select your preferred option set and image style. The Responsive FlexSlider formatter is also available when core Responsive Image module is enabled.') . '</dd>';
$output .= '<dt>' . t('Configuring FlexSlider view style') . '</dt>';
Expand All @@ -148,7 +148,7 @@ function flexslider_help($route_name, $route_match) {
$output = '';
$output .= t('An <em>option set</em> defines exactly how a flexslider image gallery looks and behaves on your site.');
$output .= '<br/>';
$output .= t('For a full documentation of all options, refer to the official <a href=":docs" target="_new">FlexSlider documentation</a>.', ['@docs' => Url::fromUri('http://www.woothemes.com/flexslider/')->getUri()]);
$output .= t('For a full documentation of all options, refer to the official <a href=":docs" target="_new">FlexSlider documentation</a>.', [':docs' => Url::fromUri('https://www.woothemes.com/flexslider/')->getUri()]);
return '<p>' . $output . '</p>';
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/FlexsliderOptionsetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FlexsliderOptionsetController extends ControllerBase {
*/
public function enable(Flexslider $flexslider) {
$flexslider->enable()->save();
return new RedirectResponse($flexslider->toUrl('collection', ['absolute' => TRUE]));
return new RedirectResponse($flexslider->toUrl('collection', ['absolute' => TRUE])->toString());
}

/**
Expand All @@ -36,7 +36,7 @@ public function enable(Flexslider $flexslider) {
*/
public function disable(Flexslider $flexslider) {
$flexslider->disable()->save();
return new RedirectResponse($flexslider->toUrl('collection', ['absolute' => TRUE]));
return new RedirectResponse($flexslider->toUrl('collection', ['absolute' => TRUE])->toString());
}

}

0 comments on commit 3e7218e

Please sign in to comment.