You are here

function rules_condition_custom_php_form in Rules 6

Execute custom php code condition configuration form.

Related topics

File

rules/modules/php.rules_forms.inc, line 78
Rules configuration forms for the php module

Code

function rules_condition_custom_php_form($settings, &$form, $form_state) {
  $form['settings']['code'] = array(
    '#type' => 'textarea',
    '#title' => t('PHP Code'),
    '#default_value' => isset($settings['code']) ? $settings['code'] : '',
    '#description' => t("The code that should be executed. Don't include <?php ?> delimiters.") . ' ' . t('Be sure to always return a boolean value, e.g.: !code', array(
      '!code' => '<pre>return $author->name != "bot";</pre>',
    )),
    '#required' => TRUE,
  );
  $form['input_help']['rules_input_evaluator_php']['#collapsed'] = FALSE;
}