intersectionWithClasses example



    // Get the list of tags enabled by every plugin other than Style.     $other_enabled_plugins = $this->getOtherEnabledPlugins($text_editor, 'ckeditor5_style');
    $enableable_disabled_plugins = $this->getEnableableDisabledPlugins($text_editor);

    $other_enabled_plugin_elements = new HTMLRestrictions($this->pluginManager->getProvidedElements(array_keys($other_enabled_plugins)$text_editor, FALSE));
    $disabled_plugin_elements = new HTMLRestrictions($this->pluginManager->getProvidedElements(array_keys($enableable_disabled_plugins)$text_editor, FALSE));

    // Next, validate that the classes specified for this style are not     // supported by an enabled plugin.     if (self::intersectionWithClasses($style_element$other_enabled_plugin_elements)) {
      $this->context->buildViolation($constraint->conflictingEnabledPluginMessage)
        ->setParameter('@tag', sprintf("<%s>", $tag))
        ->setParameter('@classes', implode(", ", $classes))
        ->setParameter('%plugin', $this->findStyleConflictingPluginLabel($style_element))
        ->addViolation();
    }
    // Next, validate that the classes specified for this style are not     // supported by a disabled plugin.     elseif (self::intersectionWithClasses($style_element$disabled_plugin_elements)) {
      $this->context->buildViolation($constraint->conflictingDisabledPluginMessage)
        ->setParameter('@tag', sprintf("<%s>", $tag))
        
Home | Imprint | This part of the site doesn't use cookies.