You are here

class ActivationCheck in jQuery World Calendars API 3.x

Implementation of ActivationCheckInterface.

Hierarchy

Expanded class hierarchy of ActivationCheck

1 string reference to 'ActivationCheck'
jquery_calendar.services.yml in ./jquery_calendar.services.yml
jquery_calendar.services.yml
1 service uses ActivationCheck
jquery_calendar.activation_check in ./jquery_calendar.services.yml
Drupal\jquery_calendar\ActivationCheck

File

src/ActivationCheck.php, line 11

Namespace

Drupal\jquery_calendar
View source
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';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ActivationCheck::$request protected property The request stack.
ActivationCheck::$settings protected property The settings.
ActivationCheck::isActive public function Check if library should be activated for the current page. Overrides ActivationCheckInterface::isActive
ActivationCheck::__construct public function Create an instance of ActivationCheck.