You are here

function ctools_context_add_item_table in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 includes/context-admin.inc \ctools_context_add_item_table()

Add the context table to the page.

4 calls to ctools_context_add_item_table()
ctools_context_add_argument_form in includes/context-admin.inc
Add the argument table plus gadget plus javascript to the form.
ctools_context_add_context_form in includes/context-admin.inc
ctools_context_add_relationship_form in includes/context-admin.inc
ctools_context_add_required_context_form in includes/context-admin.inc

File

includes/context-admin.inc, line 272
includes/common-context.inc Provide API for adding contexts for modules that embed displays.

Code

function ctools_context_add_item_table($type, &$form, $available_contexts, $items) {
  $form[$type] = array(
    '#tree' => TRUE,
  );
  $module = $form['#ctools_context_module'];
  $name = $form['#object_name'];
  if (isset($items) && is_array($items)) {
    foreach ($items as $position => $context) {
      ctools_context_add_item_to_form($module, $type, $name, $form[$type][$position], $position, $context);
    }
  }
  $type_info = ctools_context_info($type);
  $form['description'] = array(
    '#prefix' => '<div class="description">',
    '#suffix' => '</div>',
    '#value' => $type_info['description'],
  );
  ctools_context_add_item_table_buttons($type, $module, $form, $available_contexts);
}