You are here

function domain_conf_api in Domain Access 6.2

Same name and namespace in other branches
  1. 5 domain_conf/domain_conf.module \domain_conf_api()
  2. 7.3 domain_conf/domain_conf.module \domain_conf_api()
  3. 7.2 domain_conf/domain_conf.module \domain_conf_api()

Retrieves elements from hook_domainconf() and formats them as needed.

Parameters

$all: Should the function return all hook implementations or just those marked with the domain_settings flag. Defaults to FALSE. Used to determine if we are loading configuration options specific to the Domain Access module.

Return value

An array of form elements according to the FormsAPI or an empty array.

3 calls to domain_conf_api()
domain_conf_default in domain_conf/domain_conf.admin.inc
Special configuration options for the main domain.
domain_conf_domainlinks in domain_conf/domain_conf.module
Implement hook_domainlinks()
domain_conf_form in domain_conf/domain_conf.admin.inc
Custom form to generate domain-specific site settings.

File

domain_conf/domain_conf.module, line 567
Domain manager configuration options.

Code

function domain_conf_api($all = FALSE, $settings = array()) {
  global $_domain;
  $options = array();
  $extra = module_invoke_all('domainconf', $_domain);
  if (!empty($extra)) {
    foreach ($extra as $key => $value) {
      foreach (element_children($value) as $element) {
        if (isset($value[$element]['#default_value']) && isset($settings[$element])) {
          $value[$element]['#default_value'] = $settings[$element];
        }
      }
      if ($value['#domain_setting'] == TRUE || $all == TRUE) {

        // Discard the #domain_setting flag; it is not needed.
        unset($value['#domain_setting']);

        // Set the $options array.
        $options[$key] = $value;
      }
    }
  }
  return $options;
}