You are here

public function SocialTourController::disableOnboarding in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  2. 8.2 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  3. 8.3 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  4. 8.4 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  5. 8.5 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  6. 8.6 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  7. 8.7 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  8. 8.8 modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  9. 10.3.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  10. 10.0.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  11. 10.1.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()
  12. 10.2.x modules/custom/social_tour/src/SocialTourController.php \Drupal\social_tour\SocialTourController::disableOnboarding()

Disable onboarding for current_user by Ajax call.

1 string reference to 'SocialTourController::disableOnboarding'
social_tour.routing.yml in modules/custom/social_tour/social_tour.routing.yml
modules/custom/social_tour/social_tour.routing.yml

File

modules/custom/social_tour/src/SocialTourController.php, line 125

Class

SocialTourController
Class SocialTourController.

Namespace

Drupal\social_tour

Code

public function disableOnboarding() {

  // Save the value in the user_data.
  $this
    ->setData(TRUE);
  $redirect = \Drupal::request()
    ->get('destination') ?: '/stream';

  // Set a message that they can be turned on again.
  drupal_set_message($this
    ->t('You will not see tips like this anymore.'));

  // Return to Profile.
  return new RedirectResponse($redirect);
}