You are here

function ga_push_get_methods_option_list in GA Push 8

Same name and namespace in other branches
  1. 7 ga_push.module \ga_push_get_methods_option_list()

Returns all available methods as option list.

7 calls to ga_push_get_methods_option_list()
GAPushSettingsForm::buildForm in src/Form/GAPushSettingsForm.php
Form constructor.
ga_push_get_methods_option_list_ecommerce in ./ga_push.module
Get the options list for ecommerce.
ga_push_get_methods_option_list_event in ./ga_push.module
Get the options list for events.
ga_push_get_methods_option_list_exception in ./ga_push.module
Get the options list for exception.
ga_push_get_methods_option_list_pageview in ./ga_push.module
Get the options list for page views.

... See full list

File

./ga_push.module, line 599
Drupal Module: GA Push.

Code

function ga_push_get_methods_option_list($type = NULL, $default = TRUE) {
  $options = [];
  if ($default) {
    $options['default'] = t('Default');
  }
  $methods = ga_push_get_methods();
  foreach ($methods as $key => $method) {
    if (ga_push_method_available($key, $type)) {
      $options[$key] = $method['name'];
      $options[$key] .= !empty($method['description']) ? ': ' . $method['description'] : '';
      $options[$key] .= ' | ' . $method['side'] . ' (' . $method['tracking_method'] . ' analytics)';
    }
  }
  return $options;
}