You are here

function views_content_plugin_display_panel_pane::get_argument_input in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 views_content/plugins/views/views_content_plugin_display_panel_pane.inc \views_content_plugin_display_panel_pane::get_argument_input()

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_panel_pane::get_argument_input()
views_content_plugin_display_panel_pane::options_form in views_content/plugins/views/views_content_plugin_display_panel_pane.inc
Provide the default form for setting options.

File

views_content/plugins/views/views_content_plugin_display_panel_pane.inc, line 342

Class

views_content_plugin_display_panel_pane
The plugin that handles a panel_pane.

Code

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,
        'panel' => 0,
        'fixed' => '',
        'name' => $handler
          ->ui_name(),
      );
    }
    else {
      $output[$id] = $arguments[$id];
      $output[$id]['name'] = $handler
        ->ui_name();
    }
  }
  return $output;
}