diff --git a/template.php b/template.php index 11cf503..e6f7715 100644 --- a/template.php +++ b/template.php @@ -21,8 +21,7 @@ if (theme_get_setting('zen_rebuild_registry')) { * Implements HOOK_theme(). */ function zen_theme(&$existing, $type, $theme, $path) { - // When #341140 is fixed, replace _zen_path() with drupal_get_path(). - include_once './' . _zen_path() . '/zen-internals/template.theme-registry.inc'; + include_once './' . drupal_get_path('theme', 'zen') . '/zen-internals/template.theme-registry.inc'; return _zen_theme($existing, $type, $theme, $path); } @@ -319,7 +318,7 @@ function zen_preprocess(&$vars, $hook) { function zen_preprocess_page(&$vars, $hook) { // If the user is silly and enables Zen as the theme, add some styles. if ($GLOBALS['theme'] == 'zen') { - include_once './' . _zen_path() . '/zen-internals/template.zen.inc'; + include_once './' . drupal_get_path('theme', 'zen') . '/zen-internals/template.zen.inc'; _zen_preprocess_page($vars, $hook); } // Add conditional stylesheets. @@ -404,7 +403,7 @@ function zen_preprocess_page(&$vars, $hook) { function zen_preprocess_maintenance_page(&$vars, $hook) { // If Zen is the maintenance theme, add some styles. if ($GLOBALS['theme'] == 'zen') { - include_once './' . _zen_path() . '/zen-internals/template.zen.inc'; + include_once './' . drupal_get_path('theme', 'zen') . '/zen-internals/template.zen.inc'; _zen_preprocess_page($vars, $hook); } // Add conditional stylesheets. @@ -486,7 +485,7 @@ function zen_preprocess_node(&$vars, $hook) { * The name of the template being rendered ("comment" in this case.) */ function zen_preprocess_comment(&$vars, $hook) { - include_once './' . _zen_path() . '/zen-internals/template.comment.inc'; + include_once './' . drupal_get_path('theme', 'zen') . '/zen-internals/template.comment.inc'; _zen_preprocess_comment($vars, $hook); } @@ -548,7 +547,7 @@ function zen_preprocess_block(&$vars, $hook) { $vars['edit_links_array'] = array(); if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) { - include_once './' . _zen_path() . '/zen-internals/template.block-editing.inc'; + include_once './' . drupal_get_path('theme', 'zen') . '/zen-internals/template.block-editing.inc'; zen_preprocess_block_editing($vars, $hook); $vars['classes_array'][] = 'with-block-editing'; } @@ -654,20 +653,3 @@ if (!function_exists('drupal_html_id')) { return $id; } } /* End of drupal_html_id conditional definition. */ - -/** - * Returns the path to the Zen theme. - * - * drupal_get_filename() is broken; see #341140. When that is fixed in Drupal 6, - * replace _zen_path() with drupal_get_path('theme', 'zen'). - */ -function _zen_path() { - static $path = FALSE; - if (!$path) { - $matches = drupal_system_listing('zen\.info$', 'themes', 'name', 0); - if (!empty($matches['zen']->filename)) { - $path = dirname($matches['zen']->filename); - } - } - return $path; -} diff --git a/zen-internals/TODO.txt b/zen-internals/TODO.txt index b5c91ef..bd665ce 100644 --- a/zen-internals/TODO.txt +++ b/zen-internals/TODO.txt @@ -3,5 +3,3 @@ Zen 6.x-2.0 @TODO - #: Add fix to auto-correct tabs broken by contrib modules - #: Display "edit menu" only when Menu block is displaying menu.module links - * confirm all the variables of every tpl are documented. -- #341140: drupal_get_filename() is broken in Drupal 6. When that is fixed, - replace _zen_path() with drupal_get_path('theme', 'zen'). diff --git a/zen-internals/template.theme-registry.inc b/zen-internals/template.theme-registry.inc index 9127125..c75f7bd 100644 --- a/zen-internals/template.theme-registry.inc +++ b/zen-internals/template.theme-registry.inc @@ -12,7 +12,7 @@ function _zen_theme(&$existing, $type, $theme, $path) { // Compute the conditional stylesheets. if (!module_exists('conditional_styles')) { - include_once './' . _zen_path() . '/zen-internals/template.conditional-styles.inc'; + include_once './' . drupal_get_path('theme', 'zen') . '/zen-internals/template.conditional-styles.inc'; // _conditional_styles_theme() only needs to be run once. if ($theme == 'zen') { _conditional_styles_theme($existing, $type, $theme, $path); diff --git a/zen-internals/template.zen.inc b/zen-internals/template.zen.inc index 390f6c7..614a827 100644 --- a/zen-internals/template.zen.inc +++ b/zen-internals/template.zen.inc @@ -14,7 +14,7 @@ * If the user is silly and enables Zen as the theme, manually add some stylesheets. */ function _zen_preprocess_page(&$vars, $hook) { - $directory = _zen_path() . '/zen-internals/css'; + $directory = drupal_get_path('theme', 'zen') . '/zen-internals/css'; // Add default styles. if (theme_get_setting('zen_layout') == 'zen-columns-fixed') {