You are here

function advanced_forum_path_to_theme in Advanced Forum 6.2

Same name and namespace in other branches
  1. 6 advanced_forum.module \advanced_forum_path_to_theme()
  2. 7.2 includes/style.inc \advanced_forum_path_to_theme()

Returns the path to actual site theme in use because path_to_theme is flaky.

2 calls to advanced_forum_path_to_theme()
advanced_forum_theme_registry_alter in ./advanced_forum.module
Implementation of hook_theme_registry_alter().
_advanced_forum_add_files in includes/style.inc
Adds extra files needed for styling. This is currently just CSS files but was made generic to allow adding javascript in the future.

File

includes/style.inc, line 266
Functions relating to the style system, not including core hooks and preprocess / theme functions.

Code

function advanced_forum_path_to_theme() {
  global $theme;
  if (!empty($theme)) {

    // Normally, the global theme variable is set, so we use that.
    return drupal_get_path('theme', $theme);
  }

  // For some reason I've never figured out, some users are reporting
  // that the global theme variable is not set when this is called.
  // As a band-aid solution, this will pull the default theme out of the
  // database and use that.
  $default_theme = variable_get('theme_default', 'garland');
  return drupal_get_path('theme', $default_theme);
}