Results
22.06.2022
commerce_zones 1.0.0 ::
src/Plugin/Commerce/Condition/BaseZoneAddress.php
'#title' => $this->t('Negate'), '#description' => $this->t('If checked, the value(s) selected should not match.'), '#default_value' => $this->configuration['negate'], ]; return $form; } /**
$values = $form_state->getValue($form['#parents']); $this->configuration['zones'] = $values['zones']; $this->configuration['negate'] = $values['negate']; } /** * Helper to evaluate match of address against multiple zones. * * @param \Drupal\address\Plugin\Field\FieldType\AddressItem $address
$negate_condition = (bool) $this->configuration['negate']; /** @var \Drupal\commerce_zones\Entity\ZoneInterface[] $commerce_zones */ $commerce_zones = $this->zoneStorage->loadMultiple($zone_ids); foreach ($commerce_zones as $commerce_zone) { $match = $commerce_zone->match($address);
07.06.2021
condition_path 1.0.0-beta2 ::
src/Plugin/Condition/RequestPathInclexcl.php
if (!empty($countIncluded)) { $summary .= $this->t('Pages included for visibility: @count', [ '@count' => empty($this->configuration['negate']) ? $countIncluded : $countExcluded, ]); } if (!empty($countExcluded)) { $summary .= empty($summary) ? '' : '<br />'; $summary .= $this->t('Pages excluded for visibility: @count', [
$summary .= empty($summary) ? '' : '<br />'; $summary .= $this->t('Pages excluded for visibility: @count', [ '@count' => empty($this->configuration['negate']) ? $countExcluded : $countIncluded, ]); } return $summary; }
16.10.2019
condition_plugins 8.x-1.x-dev ::
src/Plugin/Condition/RequestParameterWithValue.php
$parameters = $this->getNeededParameters(); $parameters = implode(', ', $parameters); if (!empty($this->configuration['negate'])) { return $this->t('Do not return true if the current request does not have @mode parameters: @parameters.', [ '@mode' => $this->configuration['all'] ? $this->t('all') : $this->t('any of the'), '@parameters' => $parameters, ]); } return $this->t('Return true if the current request has @mode parameters: @parameters.', [
16.10.2019
condition_plugins 8.x-1.x-dev ::
src/Plugin/Condition/RequestParameter.php
$parameters = $this->getNeededParameters(); $parameters = implode(', ', $parameters); if (!empty($this->configuration['negate'])) { return $this->t('Do not return true if the current request does not have @mode parameters: @parameters.', [ '@mode' => $this->configuration['all'] ? $this->t('all') : $this->t('any of the'), '@parameters' => $parameters, ]); } return $this->t('Return true if the current request has @mode parameters: @parameters.', [
15.10.2019
condition_plugins_commerce 8.x-1.x-dev ::
src/Plugin/Condition/OrderHasProductVariation.php
return $this->t('@comparison production variation @variations or @last.', [ '@comparison' => (empty($this->configuration['negate'])) ? $this->t('Has') : $this->t('Has not'), '@variations' => $variations, '@last' => $last, ] ); } $variations = reset($this->configuration['product_variations']);
return $this->t('@comparison production variation @variations.', [ '@comparison' => (empty($this->configuration['negate'])) ? $this->t('Has') : $this->t('Has not'), '@variations' => $variations, ] ); } /**
15.10.2019
condition_plugins_commerce 8.x-1.x-dev ::
src/Plugin/Condition/OrderType.php
return $this->t('The order bundle @comparison @bundles or @last', [ '@comparison' => (empty($this->configuration['negate'])) ? $this->t('is') : $this->t('is not'), '@bundles' => $bundles, '@last' => $last, ] ); } $bundle = reset($this->configuration['bundles']);
return $this->t('The order bundle @comparison @bundle', [ '@comparison' => (empty($this->configuration['negate'])) ? $this->t('is') : $this->t('is not'), '@bundle' => $bundle, ] ); } /**
17.05.2018
condition_query 8.x-1.2 ::
src/Plugin/Condition/RequestParam.php
$params = array_map('trim', explode("\n", $this->configuration['request_param'])); $params = implode(', ', $params); if (!empty($this->configuration['negate'])) { return $this->t('Do not return true on the following query parameters: @params', ['@params' => $params]); } return $this->t('Return true on the following query parameters: @params', ['@params' => $params]); } /**
20.10.2020
context 8.x-4.x-dev ::
src/Plugin/Condition/ViewInclusion.php
$this->configuration['view_inclusion'] = array_filter($form_state->getValue('views_pages')); // Defaults negation to FALSE to match the defaultConfiguration. $this->configuration['negate'] = FALSE; } /** * {@inheritdoc} */ public function summary() {
20.10.2020
context 8.x-4.x-dev ::
src/Plugin/Condition/RequestDomain.php
$domains = array_map('trim', explode("\n", $this->configuration['domains'])); $domains = implode(', ', $domains); if (!empty($this->configuration['negate'])) { return $this->t('Do not return true on the following domains: @domains', ['@domains' => $domains]); } return $this->t('Return true on the following domains: @domains', ['@domains' => $domains]); } /**
20.10.2020
context 8.x-4.x-dev ::
src/Plugin/Condition/RequestPathExclusion.php
parent::submitConfigurationForm($form, $form_state); // Defaults negation to TRUE. $this->configuration['negate'] = TRUE; } /** * {@inheritdoc} */ public function evaluate() {
public function evaluate() { // As a failsafe, ensure it's always set to negate before evaluating. $this->configuration['negate'] = TRUE; // Allow this to pass through gracefully when blank. $pages = mb_strtolower($this->configuration['pages']); if (!$pages) { return FALSE; }
11.03.2020
context_suite 8.x-1.0-beta1 ::
src/Plugin/Condition/RequestPathRegex.php
$pages = array_map('trim', explode("\n", $this->configuration['pages'])); $pages = implode(', ', $pages); if (!empty($this->configuration['negate'])) { return $this->t('Do not return true on the following pages: @pages', ['@pages' => $pages]); } return $this->t('Return true on the following pages: @pages', ['@pages' => $pages]); } /**
11.05.2021
cookie_block 1.0.0 ::
src/Plugin/Condition/CookieCondition.php
*/ public function summary() { if (!empty($this->configuration['negate'])) { return $this->t('The cookie @cookie_id is not @cookie_value.', [ '@cookie_id' => $this->configuration['cookie_id'], '@cookie_value' => $this->configuration['cookie_value'], ]); } return $this->t('The cookie @cookie_id is @cookie_value.', [
12.08.2021
eca 1.0.x-dev ::
src/Plugin/ECA/Condition/ConditionBase.php
*/ public function isNegated(): bool { return $this->configuration['negate'] ?? FALSE; } /** * Reverse the boolean result, if plugin configuration has negation turned on. * * @param bool $result
'#type' => 'checkbox', '#title' => $this->t('Negate the condition'), '#default_value' => $this->configuration['negate'], '#description' => $this->t('Negates the condition. Makes TRUE to FALSE and vice versa.'), '#weight' => $i, ]; /** @var \Drupal\Core\Plugin\Context\ContextDefinition $definition */ foreach ($this->getPluginDefinition()['context_definitions'] ?? [] as $key => $definition) { $i++;
*/ public function submitConfigurationForm(array &$form, FormStateInterface $form_state): void { $this->configuration['negate'] = (bool) $form_state->getValue('negate', FALSE); foreach ($this->getPluginDefinition()['context_definitions'] ?? [] as $key => $definition) { $this->configuration[$key] = $form_state->getValue($key); } if ($form_state->hasValue('context_mapping')) { $this->setContextMapping($form_state->getValue('context_mapping')); }
12.08.2021
eca 1.0.x-dev ::
modules/content/src/Plugin/ECA/Condition/EntityFieldValue.php
$target_value = NULL; $negated = $this->isNegated(); $this->configuration['negate'] = FALSE; foreach ($field_values as $field_value) { $this->targetValue = $field_value; if ($this->evaluate()) { $target_value = $field_value; break; }
$this->targetValue = NULL; $this->configuration['negate'] = $negated; } return $target_value; } /** * Get a list of field values to evaluate against.
12.08.2021
eca 1.0.x-dev ::
modules/form/src/Plugin/ECA/Condition/FormFieldValue.php
$matched_val = NULL; $negated = $this->isNegated(); $this->configuration['negate'] = FALSE; array_walk_recursive($value, function ($v, $k) use (&$first_val, &$matched_val) { // This check includes a considering of integer 0 as unchecked checkbox. // @see \Drupal\Core\Render\Element\Checkboxes::getCheckedCheckboxes() if (is_scalar($v) && ($v !== 0) && trim((string) $v) !== '') { if (!isset($first_val)) { $first_val = $v;
}); $this->expectedValue = NULL; $this->configuration['negate'] = $negated; $value = $matched_val ?? $first_val; } // Restoring the original config entry. $this->configuration['field_name'] = $original_field_name;
05.08.2022
entity_agree 2.0.x-dev ::
src/Plugin/entity_agree/AgreementHandler/RoleApplies.php
'#type' => 'checkbox', '#title' => $this->t('Negate'), '#default_value' => $this->configuration['negate'], ]; $form['conjunction'] = [ '#type' => 'select', '#title' => $this->t('Conjunction'), '#options' => [
return $result xor $this->configuration['negate']; } }
05.08.2022
entity_agree 2.0.x-dev ::
src/Plugin/entity_agree/AgreementHandler/RestrictPages.php
0 => $this->t('Restrict access to the specified pages'), ], '#default_value' => $this->configuration['negate'], ]; return parent::buildConfigurationForm($form, $form_state); } /**
// Attempt to match on internal path. if ($this->pathMatcher->matchPath($path, $this->configuration['pages'])) { return (bool) $this->configuration['negate']; } // Attempt to match on alias. $path_alias = mb_strtolower($this->aliasManager->getAliasByPath($path)); return $this->pathMatcher->matchPath($path_alias, $this->configuration['pages']) == $this->configuration['negate']; } }
23.09.2020
entity_hierarchy 8.x-2.24 ::
modules/entity_hierarchy_microsite/src/Plugin/Condition/ChildOfMicrosite.php
return $this->t('@state true if current page is a child of a microsite for the @field field.', [ '@field' => $options[$this->configuration['field']], '@state' => empty($this->configuration['negate']) ? $this->t('Return') : $this->t('Do not return'), ]); } }
17.10.2020
farm 2.x-dev ::
modules/core/data_stream/modules/notification/src/Plugin/DataStream/NotificationCondition/NumericCondition.php
// Handle negation. if (!empty($this->configuration['negate'])) { if ($condition === '<') { return $this->t('The value is not less than @threshold.', ['@threshold' => $threshold]); } else { return $this->t('The value is not greater than @threshold.', ['@threshold' => $threshold]); }
09.12.2021
feature_toggle 2.0.x-dev ::
src/Plugin/Condition/FeatureToggle.php
$features = reset($features); } if (!empty($this->configuration['negate'])) { return $this->t('One of these features @features are not enabled', ['@features' => $features]); } else { return $this->t('One of these features @features are enabled', ['@features' => $features]); } }