You are here

function entityreference_prepopulate_providers_info in Entityreference prepopulate 7

Return array of providers.

2 calls to entityreference_prepopulate_providers_info()
EntityReferencePrepopulateInstanceBehavior::settingsForm in plugins/behavior/EntityReferencePrepopulateInstanceBehavior.class.php
Generate a settings form for this handler.
entityreference_prepopulate_get_values in ./entityreference_prepopulate.module
Wrapper function to get context (e.g. from URL or OG-context).

File

./entityreference_prepopulate.module, line 475
Prepopulate entity reference values from URL.

Code

function entityreference_prepopulate_providers_info() {
  $description = t('Determine if values that should be prepopulated should "listen" to the OG-context.');
  if ($disabled = !module_exists('og_context')) {
    $description .= '<br / >' . t('Organic groups integration: Enable OG-context module.');
  }
  $providers = array(
    'url' => array(
      'title' => t('URL'),
      'description' => t('Prepopulate from URL'),
      'callback' => 'entityreference_prepopulate_get_values_from_url',
    ),
    'og_context' => array(
      'title' => t('OG Context'),
      'description' => $description,
      'disabled' => $disabled,
      'callback' => 'entityreference_prepopulate_get_values_from_og_context',
    ),
  );
  $providers = array_merge($providers, module_invoke_all('entityreference_prepopulate_providers_info'));

  // Allow other module to change the providers list.
  drupal_alter('entityreference_prepopulate_providers_info', $providers);
  return $providers;
}