You are here

function markup_view_get_arguments in Markup 6

Retrieves a list of arguments for the view, using a callback function if set.

Parameters

array $element:

array $field:

array $form_state:

Return value

array $args

1 call to markup_view_get_arguments()
markup_view_process in contrib/markup_view/markup_view.module
Process the markup_widget element.

File

contrib/markup_view/markup_view.module, line 256
Defines a field type for displaying a view on the node/edit form.

Code

function markup_view_get_arguments($element, $field, $form_state, $form) {
  $args = array();
  $valid_callback = FALSE;
  if (!empty($element['#argument_callback'])) {
    $callback = $element['#argument_callback'];
    if (function_exists($callback)) {
      $valid_callback = TRUE;
      $args = $callback($element, $field, $form_state, $form);
      if (is_string($args)) {
        $args = explode(',', $args);
      }
    }
  }
  if (!$valid_callback && !empty($field['view_args'])) {
    $args = explode(',', $field['view_args']);
  }
  return $args;
}