Révision 76e2e7c3
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/rules/modules/data.rules.inc | ||
---|---|---|
555 | 555 |
'form_alter' => 'rules_data_list_form_alter', |
556 | 556 |
), |
557 | 557 |
), |
558 |
'list_count_is' => array( |
|
559 |
'label' => t('List count comparison'), |
|
560 |
'parameter' => array( |
|
561 |
'list' => array( |
|
562 |
'type' => 'list', |
|
563 |
'label' => t('List to check'), |
|
564 |
'description' => t('A multi value data element to have its count compared, specified by using a data selector, eg node:author:roles.'), |
|
565 |
), |
|
566 |
'op' => array( |
|
567 |
'type' => 'text', |
|
568 |
'label' => t('Operator'), |
|
569 |
'description' => t('The comparison operator.'), |
|
570 |
'optional' => TRUE, |
|
571 |
'default value' => '==', |
|
572 |
'options list' => 'rules_condition_data_list_count_is_operator_options', |
|
573 |
'restriction' => 'input', |
|
574 |
), |
|
575 |
'value' => array( |
|
576 |
'type' => 'integer', |
|
577 |
'label' => t('Count'), |
|
578 |
'description' => t('The count to compare the data count with.'), |
|
579 |
), |
|
580 |
), |
|
581 |
'group' => t('Data'), |
|
582 |
'base' => 'rules_condition_data_list_count_is', |
|
583 |
), |
|
558 | 584 |
'text_matches' => array( |
559 | 585 |
'label' => t('Text comparison'), |
560 | 586 |
'parameter' => array( |
... | ... | |
719 | 745 |
} |
720 | 746 |
} |
721 | 747 |
|
748 |
/** |
|
749 |
* Options list callback for condition list_count_is. |
|
750 |
*/ |
|
751 |
function rules_condition_data_list_count_is_operator_options() { |
|
752 |
return array( |
|
753 |
'==' => t('equals'), |
|
754 |
'<' => t('is lower than'), |
|
755 |
'>' => t('is greater than'), |
|
756 |
); |
|
757 |
} |
|
758 |
|
|
722 | 759 |
/** |
723 | 760 |
* @} |
724 | 761 |
*/ |
Formats disponibles : Unified diff
Weekly update of contrib modules