You are here

function panels_common_add_relationship_form in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/common.inc \panels_common_add_relationship_form()
2 calls to panels_common_add_relationship_form()
panels_mini_context_form in panels_mini/panels_mini.admin.inc
Form to edit the context settings of a mini panel.
panels_page_context_form in panels_page/panels_page.admin.inc
The form to edit the context settings of a panel page.

File

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

Code

function panels_common_add_relationship_form($module, &$form, &$form_state, &$form_location, $object) {
  $form_location = array(
    '#prefix' => '<div id="panels-relationships-table">',
    '#suffix' => '</div>',
    '#theme' => 'panels_common_context_item_form',
    '#panel_name' => $object->name,
    '#panels_context_type' => 'relationship',
    '#panels_context_module' => $module,
  );

  // Store the order the choices are in so javascript can manipulate it.
  $form_location['markup'] = array(
    '#value' => '&nbsp;',
  );
  $base_contexts = isset($object->base_contexts) ? $object->base_contexts : array();
  $available_relationships = panels_get_relevant_relationships(panels_context_load_contexts($object, TRUE, $base_contexts));
  panels_common_add_item_table('relationship', $form_location, $available_relationships, $object->relationships);
}