123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709 |
- <?php
- /**
- * @file General data related rules integration
- *
- * @addtogroup rules
- * @{
- */
- /**
- * Implements hook_rules_file_info() on behalf of the pseudo data module.
- * @see rules_core_modules()
- */
- function rules_data_file_info() {
- return array('modules/data.eval');
- }
- /**
- * Implements hook_rules_action_info() on behalf of the pseudo data module.
- * @see rules_core_modules()
- */
- function rules_data_action_info() {
- $return['data_set'] = array(
- 'label' => t('Set a data value'),
- 'parameter' => array(
- 'data' => array(
- 'type' => '*',
- 'label' => t('Data'),
- 'description' => t('Specifies the data to be modified using a data selector, e.g. "node:author:name".'),
- 'restriction' => 'selector',
- 'wrapped' => TRUE,
- 'allow null' => TRUE,
- ),
- 'value' => array(
- 'type' => '*',
- 'label' => t('Value'),
- 'description' => t('The new value to set for the specified data.'),
- 'allow null' => TRUE,
- 'optional' => TRUE,
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_data_set',
- );
- $return['data_calc'] = array(
- 'label' => t('Calculate a value'),
- 'parameter' => array(
- 'input_1' => array(
- 'type' => array('decimal', 'date'),
- 'label' => t('Input value 1'),
- 'description' => t('The first input value for the calculation.'),
- ),
- 'op' => array(
- 'type' => 'text',
- 'label' => t('Operator'),
- 'description' => t('The calculation operator.'),
- 'options list' => 'rules_action_data_calc_operator_options',
- 'restriction' => 'input',
- 'default value' => '+',
- ),
- 'input_2' => array(
- 'type' => 'decimal',
- 'label' => t('Input value 2'),
- 'description' => t('The second input value.'),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_data_calc',
- 'provides' => array(
- 'result' => array(
- 'type' => 'unknown',
- 'label' => t('Calculation result'),
- ),
- ),
- );
- $return['list_add'] = array(
- 'label' => t('Add an item to a list'),
- 'parameter' => array(
- 'list' => array(
- 'type' => 'list',
- 'label' => t('List', array(), array('context' => 'data_types')),
- 'description' => t('The data list, to which an item is to be added.'),
- 'restriction' => 'selector',
- 'allow null' => TRUE,
- 'save' => TRUE,
- ),
- 'item' => array(
- 'type' => 'unknown',
- 'label' => t('Item to add'),
- ),
- 'unique' => array(
- 'type' => 'boolean',
- 'label' => t('Enforce uniqueness'),
- 'description' => t('Only add the item to the list if it is not yet contained.'),
- 'optional' => TRUE,
- 'default value' => FALSE,
- ),
- 'pos' => array(
- 'type' => 'text',
- 'label' => t('Insert position'),
- 'optional' => TRUE,
- 'default value' => 'end',
- 'options list' => 'rules_action_data_list_add_positions',
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_data_list_add',
- 'callbacks' => array(
- 'info_alter' => 'rules_data_list_info_alter',
- 'form_alter' => 'rules_data_list_form_alter',
- ),
- );
- $return['list_remove'] = array(
- 'label' => t('Remove an item from a list'),
- 'parameter' => array(
- 'list' => array(
- 'type' => 'list',
- 'label' => t('List', array(), array('context' => 'data_types')),
- 'description' => t('The data list for which an item is to be removed.'),
- 'restriction' => 'selector',
- 'save' => TRUE,
- ),
- 'item' => array(
- 'type' => 'unknown',
- 'label' => t('Item to remove'),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_data_list_remove',
- 'callbacks' => array(
- 'info_alter' => 'rules_data_list_info_alter',
- 'form_alter' => 'rules_data_list_form_alter',
- ),
- );
- $return['variable_add'] = array(
- 'label' => t('Add a variable'),
- 'named parameter' => TRUE,
- 'parameter' => array(
- 'type' => array(
- 'type' => 'text',
- 'label' => t('Type'),
- 'options list' => 'rules_data_action_variable_add_options',
- 'description' => t('Specifies the type of the variable that should be added.'),
- 'restriction' => 'input',
- ),
- 'value' => array(
- 'type' => 'unknown',
- 'label' => t('Value'),
- 'optional' => TRUE,
- 'description' => t('Optionally, specify the initial value of the variable.')
- ),
- ),
- 'provides' => array(
- 'variable_added' => array(
- 'type' => 'unknown',
- 'label' => t('Added variable'),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_variable_add',
- 'callbacks' => array(
- 'form_alter' => 'rules_action_type_form_alter',
- 'validate' => 'rules_action_create_type_validate',
- ),
- );
- if (rules_data_action_data_create_options()) {
- $return['data_create'] = array(
- 'label' => t('Create a data structure'),
- 'named parameter' => TRUE,
- 'parameter' => array(
- 'type' => array(
- 'type' => 'text',
- 'label' => t('Type'),
- 'options list' => 'rules_data_action_data_create_options',
- 'description' => t('Specifies the type of the data structure that should be created.'),
- 'restriction' => 'input',
- ),
- // Further needed parameters depend on the type.
- ),
- 'provides' => array(
- 'data_created' => array(
- 'type' => 'unknown',
- 'label' => t('Created data'),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_data_create',
- 'callbacks' => array(
- 'form_alter' => 'rules_action_type_form_alter',
- 'validate' => 'rules_action_create_type_validate',
- ),
- );
- }
- $return['data_convert'] = array(
- 'label' => t('Convert data type'),
- 'parameter' => array(
- 'type' => array(
- 'type' => 'token',
- 'label' => t('Target type'),
- 'description' => t('The data type to convert a value to.'),
- 'options list' => 'rules_action_data_convert_types_options',
- 'restriction' => 'input',
- ),
- 'value' => array(
- 'type' => array('decimal', 'integer', 'text'),
- 'label' => t('Value to convert'),
- 'default mode' => 'selector',
- ),
- // For to-integer conversion only.
- 'rounding_behavior' => array(
- 'type' => 'token',
- 'label' => t('Rounding behavior'),
- 'description' => t('The rounding behavior the conversion should use.'),
- 'options list' => 'rules_action_data_convert_rounding_behavior_options',
- 'restriction' => 'input',
- 'default value' => 'round',
- 'optional' => TRUE,
- ),
- ),
- 'provides' => array(
- 'conversion_result' => array(
- 'type' => 'unknown',
- 'label' => t('Conversion result'),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_action_data_convert',
- 'named parameter' => TRUE,
- 'callbacks' => array(
- 'form_alter' => 'rules_action_type_form_alter',
- ),
- );
- return $return;
- }
- /**
- * Data conversation action: Options list callback for the target type.
- */
- function rules_action_data_convert_types_options(RulesPlugin $element, $param_name) {
- return array(
- 'decimal' => t('Decimal'),
- 'integer' => t('Integer'),
- 'text' => t('Text'),
- );
- }
- /**
- * Data conversation action: Options list callback for rounding behavior.
- */
- function rules_action_data_convert_rounding_behavior_options(RulesPlugin $element, $param_name) {
- return array(
- 'down' => t('Always down (9.5 -> 9)'),
- 'round' => t('Round, half up (9.5 -> 10)'),
- 'up' => t('Always up (9.5 -> 10)'),
- );
- }
- /**
- * Customize access check for data set action.
- */
- function rules_action_data_set_access(RulesAbstractPlugin $element) {
- if (isset($element->settings['data:select']) && $wrapper = $element->applyDataSelector($element->settings['data:select'])) {
- return $wrapper instanceof EntityMetadataWrapper && $wrapper->access('edit');
- }
- }
- /**
- * Custom validation callback for the data set action.
- */
- function rules_action_data_set_validate(RulesAbstractPlugin $element) {
- $element->settings += array('data:select' => NULL);
- $info = $element->applyDataSelector($element->settings['data:select'])->info();
- if (strpos($element->settings['data:select'], ':') !== FALSE && empty($info['setter callback'])) {
- throw new RulesIntegrityException(t("The selected data property doesn't support writing."), array($element, 'parameter', 'data'));
- }
- }
- /**
- * Form alter callback for the data_set action.
- */
- function rules_action_data_set_form_alter(&$form, &$form_state, $options, RulesAbstractPlugin $element) {
- if (!empty($options['init']) && !isset($form_state['rules_element_step'])) {
- $form['negate']['#access'] = FALSE;
- unset($form['parameter']['value']);
- unset($form['parameter']['language']);
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Continue'),
- '#limit_validation_errors' => array(array('parameter', 'data')),
- '#submit' => array('rules_form_submit_rebuild'),
- );
- $form_state['rules_element_step'] = 'data_value';
- // Clear the parameter mode for the value parameter, so its gets the proper
- // default value based upon the type of the the selected data on rebuild.
- unset($form_state['parameter_mode']['value']);
- }
- else {
- // Change the data parameter to be not editable.
- $form['parameter']['data']['settings']['#access'] = FALSE;
- // TODO: improve display
- $form['parameter']['data']['info'] = array(
- '#prefix' => '<p>',
- '#markup' => t('<strong>Selected data:</strong> %selector', array('%selector' => $element->settings['data:select'])),
- '#suffix' => '</p>',
- );
- }
- }
- /**
- * Form alter callback for the data calculation action.
- */
- function rules_action_data_calc_form_alter(&$form, &$form_state, $options, RulesAbstractPlugin $element) {
- $form['reload'] = array(
- '#weight' => 5,
- '#type' => 'submit',
- '#name' => 'reload',
- '#value' => t('Reload form'),
- '#limit_validation_errors' => array(array('parameter', 'input_1')),
- '#submit' => array('rules_form_submit_rebuild'),
- '#ajax' => rules_ui_form_default_ajax(),
- );
- }
- /**
- * Custom validate callback for entity create, add variable and data create
- * action.
- */
- function rules_action_create_type_validate($element) {
- if (!isset($element->settings['type'])) {
- throw new RulesIntegrityException(t('Invalid type specified.'), array($element, 'parameter', 'type'));
- }
- }
- /**
- * Form alter callback for the list add and remove actions.
- *
- * Use multiple steps to configure the action to update the item configuration
- * form once we know the data type.
- *
- * @see rules_data_list_info_alter()
- */
- function rules_data_list_form_alter(&$form, &$form_state, $options, RulesAbstractPlugin $element) {
- if (!empty($options['init']) && !isset($form_state['rules_element_step'])) {
- unset($form['parameter']['item'], $form['parameter']['pos']);
- $form_state['rules_element_step'] = 1;
- $form['negate']['#access'] = FALSE;
- $form['parameter']['unique']['#access'] = FALSE;
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Continue'),
- '#limit_validation_errors' => array(array('parameter', 'list')),
- '#submit' => array('rules_form_submit_rebuild'),
- );
- }
- else {
- // Change the list parameter to be not editable any more.
- $form['parameter']['list']['settings']['#access'] = FALSE;
- $form['parameter']['list']['info'] = array(
- '#prefix' => '<p>',
- '#markup' => t('<strong>Selected list:</strong> %selector', array('%selector' => $element->settings['list:select'])),
- '#suffix' => '</p>',
- );
- }
- }
- /**
- * Form alter callback for actions relying on the entity type or the data type.
- */
- function rules_action_type_form_alter(&$form, &$form_state, $options, RulesAbstractPlugin $element) {
- $first_step = empty($element->settings['type']);
- $form['reload'] = array(
- '#weight' => 5,
- '#type' => 'submit',
- '#name' => 'reload',
- '#value' => $first_step ? t('Continue') : t('Reload form'),
- '#limit_validation_errors' => array(array('parameter', 'type')),
- '#submit' => array('rules_action_type_form_submit_rebuild'),
- '#ajax' => rules_ui_form_default_ajax(),
- );
- // Use ajax and trigger as the reload button.
- $form['parameter']['type']['settings']['type']['#ajax'] = $form['reload']['#ajax'] + array(
- 'event' => 'change',
- 'trigger_as' => array('name' => 'reload'),
- );
- if ($first_step) {
- // In the first step show only the type select.
- foreach (element_children($form['parameter']) as $key) {
- if ($key != 'type') {
- unset($form['parameter'][$key]);
- }
- }
- unset($form['submit']);
- unset($form['provides']);
- // Disable #ajax for the first step as it has troubles with lazy-loaded JS.
- // @todo: Re-enable once JS lazy-loading is fixed in core.
- unset($form['parameter']['type']['settings']['type']['#ajax']);
- unset($form['reload']['#ajax']);
- }
- else {
- // Hide the reload button in case js is enabled and it's not the first step.
- $form['reload']['#attributes'] = array('class' => array('rules-hide-js'));
- }
- }
- /**
- * FAPI submit callback for reloading the type form for entities or data types.
- */
- function rules_action_type_form_submit_rebuild($form, &$form_state) {
- rules_form_submit_rebuild($form, $form_state);
- // Clear the parameter modes for the parameters, so they get the proper
- // default values based upon the data types on rebuild.
- $form_state['parameter_mode'] = array();
- }
- /**
- * Options list callback for possible insertion positions.
- */
- function rules_action_data_list_add_positions() {
- return array(
- 'end' => t('Append the item to the end.'),
- 'start' => t('Prepend the item to the front.'),
- );
- }
- /**
- * Options list callback for variable add action.
- */
- function rules_data_action_variable_add_options() {
- return RulesPluginUI::getOptions('data');
- }
- /**
- * Options list callback for the data calculation action.
- */
- function rules_action_data_calc_operator_options(RulesPlugin $element, $param_name) {
- $options = array(
- '+' => '( + )',
- '-' => '( - )',
- '*' => '( * )',
- '/' => '( / )',
- );
- // Only show +/- in case a date has been selected.
- if (($info = $element->getArgumentInfo('input_1')) && $info['type'] == 'date') {
- unset($options['*']);
- unset($options['/']);
- }
- return $options;
- }
- /**
- * Options list callback for data create action.
- */
- function rules_data_action_data_create_options() {
- $cache = rules_get_cache();
- $data_info = $cache['data_info'];
- $entity_info = entity_get_info();
- // Remove entities.
- $data_info = array_diff_key($data_info, $entity_info);
- $options = array();
- foreach ($data_info as $type => $properties) {
- if (isset($properties['creation callback'])) {
- // Add data types with creation callback only.
- $options[$type] = $properties['label'];
- }
- }
- natcasesort($options);
- return $options;
- }
- /**
- * Implements hook_rules_condition_info() on behalf of the pseudo data module.
- * @see rules_core_modules()
- */
- function rules_data_condition_info() {
- return array(
- 'data_is' => array(
- 'label' => t('Data comparison'),
- 'parameter' => array(
- 'data' => array(
- 'type' => '*',
- 'label' => t('Data to compare'),
- 'description' => t('The data to be compared, specified by using a data selector, e.g. "node:author:name".'),
- 'allow null' => TRUE,
- ),
- 'op' => array(
- 'type' => 'text',
- 'label' => t('Operator'),
- 'description' => t('The comparison operator.'),
- 'optional' => TRUE,
- 'default value' => '==',
- 'options list' => 'rules_condition_data_is_operator_options',
- 'restriction' => 'input',
- ),
- 'value' => array(
- 'type' => '*',
- 'label' => t('Data value'),
- 'description' => t('The value to compare the data with.'),
- 'allow null' => TRUE,
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_condition_data_is',
- ),
- 'data_is_empty' => array(
- 'label' => t('Data value is empty'),
- 'parameter' => array(
- 'data' => array(
- 'type' => '*',
- 'label' => t('Data to check'),
- 'description' => t('The data to be checked to be empty, specified by using a data selector, e.g. "node:author:name".'),
- 'allow null' => TRUE,
- 'wrapped' => TRUE,
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_condition_data_is_empty',
- ),
- 'list_contains' => array(
- 'label' => t('List contains item'),
- 'parameter' => array(
- 'list' => array(
- 'type' => 'list',
- 'label' => t('List', array(), array('context' => 'data_types')),
- 'restriction' => 'selector',
- ),
- 'item' => array(
- 'type' => 'unknown',
- 'label' => t('Item'),
- 'description' => t('The item to check for.'),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_condition_data_list_contains',
- 'callbacks' => array(
- 'info_alter' => 'rules_data_list_info_alter',
- 'form_alter' => 'rules_data_list_form_alter',
- ),
- ),
- 'text_matches' => array(
- 'label' => t('Text comparison'),
- 'parameter' => array(
- 'text' => array(
- 'type' => 'text',
- 'label' => t('Text'),
- 'restriction' => 'selector',
- ),
- 'match' => array(
- 'type' => 'text',
- 'label' => t('Matching text'),
- ),
- 'operation' => array(
- 'type' => 'text',
- 'label' => t('Comparison operation'),
- 'options list' => 'rules_data_text_comparison_operation_list',
- 'restriction' => 'input',
- 'default value' => 'contains',
- 'optional' => TRUE,
- 'description' => t('In case the comparison operation @regex is selected, the matching pattern will be interpreted as a <a href="@regex-wikipedia">regular expression</a>. Tip: <a href="@RegExr">RegExr: Online Regular Expression Testing Tool</a> is helpful for learning, writing, and testing Regular Expressions.', array('@regex-wikipedia' => 'http://en.wikipedia.org/wiki/Regular_expression', '@RegExr' => 'http://gskinner.com/RegExr/', '@regex' => t('regular expression'))),
- ),
- ),
- 'group' => t('Data'),
- 'base' => 'rules_data_text_comparison',
- ),
- );
- }
- /**
- * If the bundle is compared, add the metadata assertion so other elements
- * can make use of properties specific to the bundle.
- */
- function rules_condition_data_is_assertions($element) {
- // Assert the bundle of entities, if its compared.
- if ($wrapper = $element->applyDataSelector($element->settings['data:select'])) {
- $info = $wrapper->info();
- if (isset($info['parent']) && $info['parent'] instanceof EntityDrupalWrapper) {
- $entity_info = $info['parent']->entityInfo();
- if (isset($entity_info['entity keys']['bundle']) && $entity_info['entity keys']['bundle'] == $info['name']) {
- // Assert that the entity is of bundle $value.
- $value = is_array($element->settings['value']) ? $element->settings['value'] : array($element->settings['value']);
- // Chop of the last part of the selector.
- $parts = explode(':', $element->settings['data:select'], -1);
- return array(implode(':', $parts) => array('bundle' => $value));
- }
- }
- }
- }
- /**
- * Form alter callback for the condition data_is.
- *
- * Use multiple steps to configure the condition as the needed type of the value
- * depends on the selected data.
- */
- function rules_condition_data_is_form_alter(&$form, &$form_state, $options, RulesAbstractPlugin $element) {
- if (!empty($options['init']) && !isset($form_state['rules_element_step'])) {
- unset($form['parameter']['op'], $form['parameter']['value']);
- $form['negate']['#access'] = FALSE;
- $form_state['rules_element_step'] = 'data_value';
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Continue'),
- '#limit_validation_errors' => array(array('parameter', 'data'), array('parameter', 'op')),
- '#submit' => array('rules_form_submit_rebuild'),
- );
- // Clear the parameter mode for the value parameter, so its gets the proper
- // default value based upon the type of the the selected data on rebuild.
- unset($form_state['parameter_mode']['value']);
- }
- else {
- // Change the data parameter to be not editable.
- $form['parameter']['data']['settings']['#access'] = FALSE;
- // TODO: improve display
- $form['parameter']['data']['info'] = array(
- '#prefix' => '<p>',
- '#markup' => t('<strong>Selected data:</strong> %selector', array('%selector' => $element->settings['data:select'])),
- '#suffix' => '</p>',
- );
- // Limit the operations to what makes sense for the selected data type.
- $info = $element->pluginParameterInfo();
- $data_info = $info['value'];
- if ($element->settings['op'] == 'IN') {
- $data_info['type'] = entity_property_list_extract_type($data_info['type']);
- }
- if (!RulesData::typesMatch($data_info, array('type' => array('decimal', 'date')))) {
- $options =& $form['parameter']['op']['settings']['op']['#options'];
- unset($options['<'], $options['>']);
- }
- // Remove 'contains' if it is not selected, as it is deprecated by the
- // text comparison condition.
- if ($element->settings['op'] != 'contains') {
- unset($form['parameter']['op']['settings']['op']['#options']['contains']);
- }
- // Auto-refresh the form if the operation is changed, so the input form
- // changes in case "is one of" requires a list value.
- $form['parameter']['op']['settings']['op']['#ajax'] = rules_ui_form_default_ajax() + array(
- 'trigger_as' => array('name' => 'reload'),
- );
- // Provide a reload button for non-JS users.
- $form['reload'] = array(
- '#type' => 'submit',
- '#value' => t('Reload form'),
- '#limit_validation_errors' => array(array('parameter', 'data'), array('parameter', 'op')),
- '#submit' => array('rules_form_submit_rebuild'),
- '#ajax' => rules_ui_form_default_ajax(),
- '#weight' => 5,
- );
- // Hide the reload button in case JS is enabled.
- $form['reload']['#attributes'] = array('class' => array('rules-hide-js'));
- }
- }
- /**
- * Provides configuration help for the data_is condition.
- */
- function rules_condition_data_is_help() {
- return array('#markup' => t('Compare two data values of the same type with each other.'));
- }
- /**
- * Options list callback for condition data_is.
- */
- function rules_condition_data_is_operator_options() {
- return array(
- '==' => t('equals'),
- 'IN' => t('is one of'),
- '<' => t('is lower than'),
- '>' => t('is greater than'),
- // Note: This is deprecated by the text comparison condition.
- 'contains' => t('contains'),
- );
- }
- /**
- * Options list callback for condition text_matches.
- */
- function rules_data_text_comparison_operation_list() {
- return array(
- 'contains' => t('contains'),
- 'starts' => t('starts with'),
- 'ends' => t('ends with'),
- 'regex' => t('regular expression'),
- );
- }
- /**
- * Returns the options list as specified by the selected property of the first parameter.
- *
- * @see rules_data_list_info_alter()
- * @see rules_action_data_set_info_alter()
- * @see rules_condition_data_is_info_alter()
- */
- function rules_data_selector_options_list(RulesAbstractPlugin $element) {
- $name = rules_array_key($element->pluginParameterInfo());
- // If the selected data property has an option list, make use of it.
- if (isset($element->settings[$name . ':select']) && $wrapper = $element->applyDataSelector($element->settings[$name . ':select'])) {
- return $wrapper->optionsList($element instanceof RulesActionInterface ? 'edit' : 'view');
- }
- }
- /**
- * @}
- */
|