You are here

function _views_update_argument_map in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/views.install \_views_update_argument_map()

Builds an argument map for each Views display.

Parameters

array $displays: A list of Views displays.

Return value

array The argument map keyed by display id.

1 call to _views_update_argument_map()
views_update_8002 in core/modules/views/views.install
Updates %1 and !1 tokens to argument tokens.

File

core/modules/views/views.install, line 294
Contains install and update functions for Views.

Code

function _views_update_argument_map($displays) {
  $argument_map = [];
  foreach ($displays as $display_id => $display) {
    $argument_map[$display_id] = [];
    if (isset($display['display_options']['arguments'])) {
      foreach (array_keys($display['display_options']['arguments']) as $number => $name) {
        $argument_map[$display_id][$number + 1] = $name;
      }
    }
    elseif (isset($displays['default']['display_options']['arguments'])) {
      foreach (array_keys($displays['default']['display_options']['arguments']) as $number => $name) {
        $argument_map[$display_id][$number + 1] = $name;
      }
    }
  }
  return $argument_map;
}