function ctools_save_context

File

includes/context-admin.inc, line 812

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;
}