Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

define('CURRENT_PAGE',-1);
define('ACTIVE',       0);

/**
 * Returns the current active theme. Use this instead of the global variable.
 *
 * @param $get
 *  When set to CURRENT_PAGE, this will always return the theme used for the
 *  rendered page. When set to ACTIVE, it will return the internally active
 *  theme. For example, if the site has a different admin theme, setting this
 *  to ACTIVE will return the site wide active theme while CURRENT_PAGE will
 *  return the admin theme used to display the page. When inside the theme
 *  settings api form, the internal focus will be on the theme specific form
 *  so ACTIVE will point to the theme associated with that form.
 */
function hex_active_theme($get = ACTIVE) {
  switch ($get) {
    case ACTIVE       : return $GLOBALS['theme_key'];
    case CURRENT_PAGE : return $GLOBALS['theme'];
  }
}
?>