You are here

function _content_theme_debugger_block_view in Content Theme 6

1 call to _content_theme_debugger_block_view()
content_theme_debugger_block in content_theme_debugger/content_theme_debugger.module
Implementation of hook_block().

File

content_theme_debugger/content_theme_debugger.module, line 83
This module displays a list of modules which override the system default theme sorted by module's call-up.

Code

function _content_theme_debugger_block_view($delta = '') {
  $block = array();
  if ($delta == 'content_theme_debugger') {
    global $custom_theme;
    $content_theme_debugger_blacklist = variable_get('content_theme_debugger_blacklist', "ctools\nog\nviews");
    $blacklist = preg_split("/\r\n|\n|\r|\\s/", $content_theme_debugger_blacklist, -1, PREG_SPLIT_NO_EMPTY);
    $items = array();
    $items[] = t('Default theme: %theme', array(
      '%theme' => content_theme_get_themes(variable_get('theme_default', 'garland')),
    ));
    $custom_theme_original = $custom_theme;
    foreach (module_implements('init') as $module) {
      if (!in_array($module, $blacklist)) {
        $custom_theme = '-test_custom_theme_test-';
        module_invoke($module, 'init');
        if ($custom_theme != '-test_custom_theme_test-') {
          $items[] = t('Theme %theme is set by %module', array(
            '%theme' => content_theme_get_themes($custom_theme),
            '%module' => $module . '_init()',
          ));
        }
      }
    }
    $custom_theme = $custom_theme_original;
    $block['subject'] = t('Content Theme Debugger');
    $block['content'] = theme('item_list', $items);
  }
  return $block;
}