You are here

function context_ui_settings in Context 6.3

Same name and namespace in other branches
  1. 7.3 context_ui/context_ui.module \context_ui_settings()

Settings form.

1 string reference to 'context_ui_settings'
context_ui_menu in context_ui/context_ui.module
Implementation of hook_menu().

File

context_ui/context_ui.module, line 240

Code

function context_ui_settings(&$form_state) {
  $form = array();
  foreach (context_conditions() as $condition => $info) {
    if ($plugin = context_get_plugin('condition', $condition)) {
      $settings_form = $plugin
        ->settings_form();
      if ($settings_form) {
        $form['conditions'][$reaction] = $settings_form;
        $form['conditions'][$reaction]['#tree'] = FALSE;
        $form['conditions'][$reaction]['#type'] = 'fieldset';
        $form['conditions'][$reaction]['#title'] = $info['title'];
      }
    }
  }
  foreach (context_reactions() as $reaction => $info) {
    if ($plugin = context_get_plugin('reaction', $reaction)) {
      $settings_form = $plugin
        ->settings_form();
      if ($settings_form) {
        $form['reactions'][$reaction] = $settings_form;
        $form['reactions'][$reaction]['#tree'] = FALSE;
        $form['reactions'][$reaction]['#type'] = 'fieldset';
        $form['reactions'][$reaction]['#title'] = $info['title'];
      }
    }
  }
  $form = system_settings_form($form);
  $form['#submit'][] = 'context_ui_settings_submit';
  return $form;
}