You are here

function finder_optionwidgets_finder_admin_element_rewrite_bits in Finder 7

Same name and namespace in other branches
  1. 6 modules/finder_optionwidgets/finder_optionwidgets.module \finder_optionwidgets_finder_admin_element_rewrite_bits()

Add settings to the form pertaining to rewrites.

1 call to finder_optionwidgets_finder_admin_element_rewrite_bits()
finder_optionwidgets_form_finder_admin_element_edit_alter in modules/finder_optionwidgets/finder_optionwidgets.module
Implements hook_form_FORM_ID_alter().

File

modules/finder_optionwidgets/finder_optionwidgets.module, line 78
The finder optionwidgets module.

Code

function finder_optionwidgets_finder_admin_element_rewrite_bits(&$form, $element) {
  $form['settings']['choices']['rewrite'] = array(
    '#type' => 'fieldset',
    '#title' => t('Rewrite options'),
    '#weight' => 300,
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('Since option widgets work using key/value pairs, we can rewrite the value for display purposes.'),
  );
  $form['settings']['choices']['rewrite']['php'] = finder_php_setting(array(
    '#type' => 'textarea',
    '#default_value' => isset($element->settings['choices']['rewrite']['php']) ? $element->settings['choices']['rewrite']['php'] : '',
    '#title' => t('PHP Code'),
    '#rows' => 6,
    '#description' => t('
        You can use a mixture of text and PHP code to print or return the
        display value of an option.  PHP must be enclosed in PHP tags.'),
  ), array(
    'value' => t('The themed display value of this option.'),
    'key' => t('The themed key value of this option.'),
    'option' => t('Object containing data that finder has about this option.'),
    'finder_element' => t('Object containing data about this finder element.'),
  ));
}