ActivationCheck.php in jQuery World Calendars API 3.x
Namespace
Drupal\jquery_calendarFile
src/ActivationCheck.phpView source
<?php
namespace Drupal\jquery_calendar;
use Drupal\Core\Config\ConfigFactoryInterface;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* Implementation of ActivationCheckInterface.
*/
class ActivationCheck implements ActivationCheckInterface {
/**
* The settings.
*
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $settings;
/**
* The request stack.
*
* @var \Symfony\Component\HttpFoundation\RequestStack
*/
protected $request;
/**
* Create an instance of ActivationCheck.
*/
public function __construct(ConfigFactoryInterface $config, RequestStack $request) {
$this->settings = $config
->get('jquery_calendar.settings');
$this->request = $request
->getCurrentRequest();
}
/**
* {@inheritdoc}
*/
public function isActive() {
return true;
return $this->request
->get('colorbox') !== 'no';
}
}
Classes
Name | Description |
---|---|
ActivationCheck | Implementation of ActivationCheckInterface. |