You are here

function rules_get_element_label in Rules 6

Gets the element's label

21 calls to rules_get_element_label()
rules_admin_form_delete in rules_admin/rules_admin.rule_forms.inc
Shows the delete form for elements (conditions, actions, ..)
rules_admin_form_delete_submit in rules_admin/rules_admin.rule_forms.inc
rules_admin_form_edit_action in rules_admin/rules_admin.rule_forms.inc
Returns the edit form for an action
rules_admin_form_edit_action_submit in rules_admin/rules_admin.rule_forms.inc
rules_admin_form_edit_condition in rules_admin/rules_admin.rule_forms.inc
Returns the edit form for a condition

... See full list

1 string reference to 'rules_get_element_label'
rules_admin_elements_get_logical_ops in rules_admin/rules_admin.rule_forms.inc
Returns a list of available logical operations suitable for use with #options

File

rules/rules.module, line 580
Rules engine module

Code

function rules_get_element_label(&$element) {
  foreach (array(
    '#label',
    'label',
  ) as $key) {
    if (isset($element[$key])) {
      return $element[$key];
    }
  }
  if ($info = rules_get_element_info($element)) {
    return isset($info['label']) ? $info['label'] : t('unlabelled');
  }
}