function views_array_key_plus

Adds one to each key of the array.

For example array(0 => 'foo') would be array(1 => 'foo').

2 calls to views_array_key_plus()
views_plugin_display::init in plugins/views_plugin_display.inc
views_ui_rearrange_filter_form_submit in includes/admin.inc
Submit handler for rearranging form.

File

./views.module, line 2739

Code

function views_array_key_plus($array) {
    $keys = array_keys($array);
    rsort($keys);
    foreach ($keys as $key) {
        $array[$key + 1] = $array[$key];
        unset($array[$key]);
    }
    asort($array);
    return $array;
}