You are here

private function AdsenseMainSettings::adsenseIdSettingsClientIdMods in Google AdSense integration 8

Search for the available Publisher ID modules.

Return value

array array of selectable Publisher ID functions

1 call to AdsenseMainSettings::adsenseIdSettingsClientIdMods()
AdsenseMainSettings::buildForm in src/Form/AdsenseMainSettings.php
Form constructor.

File

src/Form/AdsenseMainSettings.php, line 160

Class

AdsenseMainSettings
Form for the adsense module general settings.

Namespace

Drupal\adsense\Form

Code

private function adsenseIdSettingsClientIdMods() {

  // @todo ModuleHandler::getImplementations.
  $ret['adsense_basic'] = 'Always use the site Publisher ID.';
  $funcs = get_defined_functions();
  foreach ($funcs['user'] as $func) {
    if (preg_match('!_adsense$!', $func)) {
      $settings = $func('settings');
      $ret[$func] = $settings['name'];
      if (!empty($settings['desc'])) {
        $ret[$func] .= "<div style='margin-left: 2.5em;' class='description'>{$settings['desc']}</div>";
      }
    }
  }
  return $ret;
}