You are here

function mediafront_views_get_options in MediaFront 7.2

Returns the options to be used within views.

Parameters

type $handler:

7 calls to mediafront_views_get_options()
mediafront_form_views_ui_config_item_form_alter in views/mediafront.views.inc
Allow them to say which field they would like to use for certain MediaFront player fields.
mediafront_get_playlist_from_view in ./mediafront.module
Returns a playlist provided a view.
mediafront_views_features_export_options in includes/mediafront.features.inc
Implementation of hook_features_export_options().
mediafront_views_features_export_render in includes/mediafront.features.inc
Implementation of hook_features_export_render().
mediafront_views_features_revert in includes/mediafront.features.inc
Implementation of hook_features_revert().

... See full list

File

./mediafront.module, line 162

Code

function mediafront_views_get_options($handler = NULL) {

  // Get the variable first...
  $options = variable_get('mediafront_views_options', array());

  // Iterate through the defaults and see if there are any settings not provided.
  foreach (mediafront_views_default_options() as $view => $fields_options) {
    if (!isset($options[$view])) {
      $options[$view] = $fields_options;
    }
    else {

      // Now iterate through the fields and see if a field setting isn't provided.
      foreach ($fields_options as $field_name => $field_options) {
        if (!isset($options[$view][$field_name])) {
          $options[$view][$field_name] = $field_options;
        }
      }
    }
  }

  // If there are no options, then just return them.
  if (!$handler || empty($handler->options['mediafront'])) {
    return $options;
  }
  else {
    if ($options && !empty($options[$handler->view->name][$handler->field])) {
      return $options[$handler->view->name][$handler->field];
    }
    else {
      return $handler->options['mediafront'];
    }
  }
}