You are here

public function DefaultController::lightbox2_contact in Lightbox2 8

Same name in this branch
  1. 8 src/DefaultController.php \Drupal\lightbox2\DefaultController::lightbox2_contact()
  2. 8 src/Controller/DefaultController.php \Drupal\lightbox2\Controller\DefaultController::lightbox2_contact()
1 string reference to 'DefaultController::lightbox2_contact'
lightbox2.routing.yml in ./lightbox2.routing.yml
lightbox2.routing.yml

File

src/Controller/DefaultController.php, line 69
Contains \Drupal\lightbox2\Controller\DefaultController.

Class

DefaultController
Default controller for the lightbox2 module.

Namespace

Drupal\lightbox2\Controller

Code

public function lightbox2_contact() {
  if (module_exists('contact') && variable_get('lightbox2_enable_contact', FALSE) && user_access('access site-wide contact form')) {
    $path = drupal_get_path('module', 'contact');
    include_once $path . '/contact.pages.inc';
    print drupal_render(drupal_get_form('contact_site_form'));

    // drupal_add_js() with 'inline' didn't seem to work, possibly because this is
    // AJAX loaded content.
    print '<script type="text/javascript">Drupal.attachBehaviors();</script>';
    exit;
  }
}