You are here

function advanced_forum_path_to_theme in Advanced Forum 7.2

Same name and namespace in other branches
  1. 6.2 includes/style.inc \advanced_forum_path_to_theme()
  2. 6 advanced_forum.module \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_find_style_templates in includes/style.inc
Find style template.
_advanced_forum_add_files in includes/style.inc
Adds extra files needed for styling.

File

includes/style.inc, line 377
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);
}