You are here

function panels_common_add_item_table in Panels 5.2

Same name and namespace in other branches
  1. 6.2 includes/common-context.inc \panels_common_add_item_table()

Add the context table to the page.

4 calls to panels_common_add_item_table()
panels_common_add_argument_form in includes/common.inc
Add the argument table plus gadget plus javascript to the form.
panels_common_add_context_form in includes/common.inc
panels_common_add_relationship_form in includes/common.inc
panels_common_add_required_context_form in includes/common.inc

File

includes/common.inc, line 718
Functions used by more than one panels client module.

Code

function panels_common_add_item_table($type, &$form, $available_contexts, $items) {
  $form[$type] = array(
    '#tree' => TRUE,
  );
  if (isset($items) && is_array($items)) {
    foreach ($items as $position => $context) {
      panels_common_add_item_to_form($type, $form[$type][$position], $position, $context);
    }
  }
  $type_info = panels_common_context_info($type);
  $form['description'] = array(
    '#prefix' => '<div class="description">',
    '#suffix' => '</div>',
    '#value' => $type_info['description'],
  );
  panels_common_add_item_table_buttons($type, $form, $available_contexts);
}