You are here

function ctools_save_context in Chaos Tool Suite (ctools) 6

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

File

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

Code

function ctools_save_context($type, &$ref, $form_values) {
  $type_info = ctools_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;
}