You are here

function contextphp_condition_php::options_form in Context PHP 7

Same name and namespace in other branches
  1. 6 plugins/contextphp_condition_php.inc \contextphp_condition_php::options_form()

Options form. Provide additional options for your condition.

Overrides context_condition::options_form

File

plugins/contextphp_condition_php.inc, line 30
contextphp_condition_php.inc Adds php argument condition to Context

Class

contextphp_condition_php
PHP code as a Context condition.

Code

function options_form($context) {
  $defaults = $this
    ->fetch_from_context($context, 'options');
  return array(
    'phpcode' => array(
      '#type' => 'textarea',
      '#title' => t('PHP code'),
      '#description' => t('Enter PHP code that returns TRUE if the condition shall be met. Do not use <?php ?>.'),
      '#default_value' => isset($defaults['phpcode']) ? $defaults['phpcode'] : '',
    ),
  );
}