You are here

function _sweaver_theme in Sweaver 7

Same name and namespace in other branches
  1. 6 sweaver.registry.inc \_sweaver_theme()

Theming functions.

1 call to _sweaver_theme()
sweaver_theme in ./sweaver.module
Implements hook_theme().

File

./sweaver.registry.inc, line 47
Registry for Sweaver.

Code

function _sweaver_theme() {
  $skin = variable_get('sweaver_skin', SWEAVER_SKIN);
  $theme_functions = array(
    'sweaver_plugin' => array(
      'template' => $skin,
      'file' => $skin . '.theme.inc',
      'path' => drupal_get_path('module', 'sweaver') . '/skins/' . $skin,
      'render element' => 'form',
    ),
    'sweaver_plugin_config_plugins' => array(
      'template' => 'sweaver-plugin-config-plugins',
      'file' => 'sweaver_plugin.theme.inc',
      'path' => drupal_get_path('module', 'sweaver'),
      'render element' => 'form',
    ),
  );
  $sweaver = Sweaver::get_instance();
  foreach (array_keys($sweaver
    ->get_plugins_registry(TRUE)) as $plugin_name) {
    $sweaver_plugin = $sweaver
      ->get_plugin($plugin_name);

    // Allow drupal to load even if sweaver update process gone wrong
    if (is_object($sweaver_plugin)) {
      $theme_function = $sweaver_plugin
        ->sweaver_theme();
      $theme_functions += $theme_function;
    }
  }
  return $theme_functions;
}