You are here

function _freelinking_failover_form in Freelinking 6.3

Same name and namespace in other branches
  1. 7.3 freelinking.forms.inc \_freelinking_failover_form()
1 call to _freelinking_failover_form()
freelinking_settings in ./freelinking.forms.inc
Build admin/settings page.

File

./freelinking.forms.inc, line 65
Freelinking 3

Code

function _freelinking_failover_form(&$form, $plugin_name, $plugin, $setting_name) {
  if (isset($plugin['failover']) && is_array($plugin['failover'])) {
    foreach ($plugin['failover'] as $option) {
      $options[$option] = t('Use plugin !plugin', array(
        '!plugin' => $option,
      ));
    }
    $options = array_merge($options, array(
      'error' => t('Error Message'),
      'none' => t('Do Nothing'),
    ));
    $form[$plugin_name]['settings'][$setting_name] = array(
      '#title' => t('Plugin Fallback Action'),
      '#type' => 'select',
      '#options' => $options,
      '#default_value' => variable_get($setting_name, 'none'),
    );
  }
  elseif (isset($plugin['failover'])) {
    $form[$plugin_name]['settings'][$setting_name] = array(
      '#title' => t('Plugin Fallback Action'),
      '#type' => 'textfield',
      '#value' => variable_get($setting_name, $plugin['failover']),
      '#size' => 20,
      '#disabled' => TRUE,
    );
  }
}