public function UserVariable::changeDetails in Business Rules 2.x
Same name and namespace in other branches
- 8 src/Plugin/BusinessRulesVariable/UserVariable.php \Drupal\business_rules\Plugin\BusinessRulesVariable\UserVariable::changeDetails()
Change the variable details box.
Give a chance to each variable plugin to change the variable details row on Available Variables Box.
Parameters
\Drupal\business_rules\Entity\Variable $variable: The variable.
array $row: The row which contains the variable.
Overrides BusinessRulesVariablePlugin::changeDetails
File
- src/
Plugin/ BusinessRulesVariable/ UserVariable.php, line 82
Class
- UserVariable
- A variable representing one user account.
Namespace
Drupal\business_rules\Plugin\BusinessRulesVariableCode
public function changeDetails(Variable $variable, array &$row) {
// Show a link to a modal window which all fields from the Entity Variable.
$content = $this->util
->getVariableFieldsModalInfo($variable);
$keyvalue = $this->util
->getKeyValueExpirable('user_variable');
$keyvalue
->set('variableFields.' . $variable
->id(), $content);
$details_link = Link::createFromRoute(t('Click here to see the entity fields'), 'business_rules.ajax.modal', [
'method' => 'nojs',
'title' => t('Entity fields'),
'collection' => 'user_variable',
'key' => 'variableFields.' . $variable
->id(),
], [
'attributes' => [
'class' => [
'use-ajax',
],
],
])
->toString();
$row['description']['data']['#markup'] .= '<br>' . $details_link;
}