You are here

function panels_common_save_context in Panels 6.2

Same name and namespace in other branches
  1. 5.2 includes/common.inc \panels_common_save_context()
2 calls to panels_common_save_context()
panels_mini_context_form_submit in panels_mini/panels_mini.admin.inc
Process submission of the mini panel edit form.
panels_page_context_form_submit in panels_page/panels_page.admin.inc
Process submission of the panel page edit form.

File

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

Code

function panels_common_save_context($type, &$ref, $form_values) {
  $type_info = panels_common_context_info($type);

  // Organize arguments
  $new = array();
  $order = array();
  foreach ($ref as $id => $context) {
    $position = $form_values[$type][$id]['position'];
    $order[$position] = $id;
  }
  ksort($order);
  foreach ($order as $id) {
    $new[] = $ref[$id];
  }
  $ref = $new;
}