You are here

function ctools_access_ruleset_ui::edit_form_context in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php \ctools_access_ruleset_ui::edit_form_context()

File

ctools_access_ruleset/plugins/export_ui/ctools_access_ruleset_ui.class.php, line 5

Class

ctools_access_ruleset_ui

Code

function edit_form_context(&$form, &$form_state) {
  ctools_include('context-admin');
  ctools_context_admin_includes();
  ctools_add_css('ruleset');
  $form['right'] = array(
    '#prefix' => '<div class="ctools-right-container">',
    '#suffix' => '</div>',
  );
  $form['left'] = array(
    '#prefix' => '<div class="ctools-left-container clear-block">',
    '#suffix' => '</div>',
  );

  // Set this up and we can use CTools' Export UI's built in wizard caching,
  // which already has callbacks for the context cache under this name.
  $module = 'ctools_export_ui-' . $this->plugin['name'];
  $name = $this
    ->edit_cache_get_key($form_state['item'], $form_state['form type']);
  ctools_context_add_context_form($module, $form, $form_state, $form['right']['contexts_table'], $form_state['item'], $name);
  ctools_context_add_required_context_form($module, $form, $form_state, $form['left']['required_contexts_table'], $form_state['item'], $name);
  ctools_context_add_relationship_form($module, $form, $form_state, $form['right']['relationships_table'], $form_state['item'], $name);
}