You are here

function rules_admin_element_help in Rules 6

Shows the element help

3 calls to rules_admin_element_help()
rules_admin_form_edit_action in rules_admin/rules_admin.rule_forms.inc
Returns the edit form for an action
rules_admin_form_edit_condition in rules_admin/rules_admin.rule_forms.inc
Returns the edit form for a condition
rules_admin_form_edit_rule in rules_admin/rules_admin.rule_forms.inc
Returns the form for editing a rule

File

rules_admin/rules_admin.inc, line 24

Code

function rules_admin_element_help(&$form, $element) {
  $info = rules_retrieve_element_info($element);
  if (isset($info['help']) || isset($element['help'])) {
    $help = isset($element['help']) ? $element['help'] : $info['help'];
  }
  else {
    if (isset($element['#type']) && in_array($element['#type'], array(
      'action',
      'condition',
    ))) {
      rules_include('rules_forms');
      $help = rules_element_invoke($element, 'help', array());
    }
  }
  if (isset($help) && $help) {
    $form['help'] = array(
      '#type' => 'fieldset',
      '#title' => t('Description'),
      '#description' => $help,
    );
  }
}