You are here

function _media_23video_set_settings in Media 23video 7

Update default values on form elements.

Parameters

string $type: Formatter type. Can be the "video" or "image".

array $settings: An array with values for formatter settings.

Return value

array Updated form elements.

2 calls to _media_23video_set_settings()
media_23video_file_formatter_image_settings in ./media_23video.module
Implements hook_file_formatter_FORMATTER_settings().
media_23video_file_formatter_video_settings in ./media_23video.module
Implements hook_file_formatter_FORMATTER_settings().

File

./media_23video.module, line 247
23Video service for Media.

Code

function _media_23video_set_settings($type, array $settings) {
  $elements = array();
  foreach (_media_23video_settings_form($type) as $name => $element) {
    if (isset($settings[$name])) {
      $element['#default_value'] = $settings[$name];
    }
    $elements[$name] = $element;
  }
  return $elements;
}