You are here

function scald_atom_providers_opt in Scald: Media Management made easy 7

Get the list of module options registered for atom providers.

This function returns an associative array with the following format.

array( 'type-slug1' => array( 'module-name1' => array( 'data-param1' => 'data_value1', 'data-param2' => 'data_value2', ), 'module-name2' => array( 'label' => 'label2', ), ) );

Return value

array The Scald Atom Provider Options array.

2 calls to scald_atom_providers_opt()
scald_atom_add_form_source_submit in includes/scald.pages.inc
Handles the source step form submission.
scald_atom_add_page in includes/scald.pages.inc
Atom add page callback.

File

./scald.module, line 327
The Scald Core, which handles all Scald Registries and dispatch.

Code

function scald_atom_providers_opt($reset = FALSE) {
  $types =& drupal_static(__FUNCTION__, NULL, $reset);
  if (!isset($types)) {
    $types = array();
    $providers = scald_atom_providers();

    // Collect provider options for registered providers only.
    $hook = 'scald_atom_providers_opt';
    foreach ($providers as $type => $module_items) {
      foreach ($module_items as $module => $label) {
        if (module_hook($module, $hook)) {
          foreach (module_invoke($module, $hook) as $type => $item) {
            $types[$type][$module] = $item;
          }
        }
        $types[$type][$module]['label'] = $label;
      }
    }

    // Invoke options alters. Do not alter the label here.
    drupal_alter($hook, $types);
  }
  return $types;
}