You are here

public function views_content_plugin_display_ctools_context::get_argument_input in Chaos Tool Suite (ctools) 7

Adjust the array of argument input to match the current list of arguments available for this display. This ensures that changing the arguments doesn't cause the argument input field to just break.

1 call to views_content_plugin_display_ctools_context::get_argument_input()
views_content_plugin_display_ctools_context::options_form in views_content/plugins/views/views_content_plugin_display_ctools_context.inc
Provide the default form for setting options.

File

views_content/plugins/views/views_content_plugin_display_ctools_context.inc, line 247
Contains the block display plugin.

Class

views_content_plugin_display_ctools_context
The plugin that handles a block.

Code

public function get_argument_input() {
  $arguments = $this
    ->get_option('argument_input');
  $handlers = $this
    ->get_handlers('argument');

  // We use a separate output so as to seamlessly discard info for
  // arguments that no longer exist.
  $output = array();
  foreach ($handlers as $id => $handler) {
    if (empty($arguments[$id])) {
      $output[$id] = array(
        'type' => 'none',
        'context' => 'any',
        'context_optional' => FALSE,
        'name' => $handler
          ->ui_name(),
      );
    }
    else {
      $output[$id] = $arguments[$id];
      $output[$id]['name'] = $handler
        ->ui_name();
    }
  }
  return $output;
}