function views_ui_get_form_progress

Get the user's current progress through the form stack.

Parameters

view $view: The current view.

Return value

FALSE if the user is not currently in a multiple-form stack. Otherwise, an associative array with the following keys:

  • current: The number of the current form on the stack.
  • total: The total number of forms originally on the stack.
1 call to views_ui_get_form_progress()
views_ui_standard_display_dropdown in includes/admin.inc
Add a <select> dropdown for a given section.

File

includes/admin.inc, line 2864

Code

function views_ui_get_form_progress($view) {
    $progress = FALSE;
    if (!empty($view->stack)) {
        // The forms on the stack have integer keys that don't change as the forms
        // are completed, so we can see which ones are still left.
        $keys = array_keys($view->stack);
        // Add 1 to the array keys for the benefit of humans, who start counting
        // from 1 and not 0.
        $current = reset($keys) + 1;
        $total = end($keys) + 1;
        if ($total > 1) {
            $progress = array();
            $progress['current'] = $current;
            $progress['total'] = $total;
        }
    }
    return $progress;
}