diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-30 03:38:22 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-01-30 03:38:22 +0000 |
commit | 196aaa7d51b5ea9ac6422b93937b9070d5832272 (patch) | |
tree | eb947ef65e621185ee910f1878d2e580f4c6efc4 /modules/system/system.api.php | |
parent | 12ed4706557d978b0f43c3b8ab8cf454ebb590ac (diff) | |
download | brdo-196aaa7d51b5ea9ac6422b93937b9070d5832272.tar.gz brdo-196aaa7d51b5ea9ac6422b93937b9070d5832272.tar.bz2 |
#553944 follow-up by David_Rothstein: Allow modules to override per-page custom themes.
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r-- | modules/system/system.api.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 78cc24e2a..eefafdd74 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1188,6 +1188,31 @@ function hook_theme_registry_alter(&$theme_registry) { } /** + * Return the machine-readable name of the theme to use for the current page. + * + * This hook can be used to dynamically set the theme for the current page + * request. It overrides the default theme as well as any per-page or + * per-section theme set by the theme callback function in hook_menu(). This + * should be used by modules which need to override the theme based on dynamic + * conditions. + * + * Since only one theme can be used at a time, the last (i.e., highest + * weighted) module which returns a valid theme name from this hook will + * prevail. + * + * @return + * The machine-readable name of the theme that should be used for the current + * page request. The value returned from this function will only have an + * effect if it corresponds to a currently-active theme on the site. + */ +function hook_custom_theme() { + // Allow the user to request a particular theme via a query parameter. + if (isset($_GET['theme'])) { + return $_GET['theme']; + } +} + +/** * Register XML-RPC callbacks. * * This hook lets a module register callback functions to be called when |