You are here

function _qtip_fetch_default_settings in qTip (Stylish jQuery Tooltips) 7.2

Helper function to fetch default settings.

2 calls to _qtip_fetch_default_settings()
qtip_init in ./qtip.module
Implements hook_init().
qtip_settings_form in includes/forms/qtip.settings.inc
Callback function for admin/config/user-interface/qtip

File

./qtip.module, line 897

Code

function _qtip_fetch_default_settings($settings = NULL) {
  if (!$settings) {

    // Fetch all settings
    return array(
      /* CDN */
      'qtip_cdn' => variable_get('qtip_cdn', 'jsdelivr'),
      'qtip_cdn_version' => variable_get('qtip_cdn_version', QTIP_RECOMMENDED_CDN_VERSION),
      'qtip_cdn_features' => variable_get('qtip_cdn_features', 'all'),
      'qtip_cdn_compression' => variable_get('qtip_cdn_compression', 'min'),
      'qtip_cdn_imagesloaded' => variable_get('qtip_cdn_imagesloaded', 0),
      /* Additional options */
      'qtip_pages_visibility' => variable_get('qtip_pages_visibility', QTIP_PAGES_VISIBILITY_NOTLISTED),
      'qtip_pages_list' => variable_get('qtip_pages_list', ''),
      /* jQuery library options */
      'qtip_jquery_cdn' => variable_get('qtip_jquery_cdn', 'google'),
      'qtip_jquery_version' => variable_get('qtip_jquery_version', QTIP_MINIMUM_JQUERY_VERSION),
      /* Miscellaneous options */
      'qtip_default_instance' => variable_get('qtip_default_instance', 'default'),
      /* Debug options */
      'qtip_debug_leave_tooltip_elements' => variable_get('qtip_debug_leave_tooltip_elements', 0),
    );
  }
  if (is_array($settings)) {
    $sets = array();
    foreach ($settings as $setting) {
      $sets[$setting] = variable_get($setting);
    }
    return $sets;
  }

  // Since value set for $settings
  return variable_get($settings);
}