You are here

public function sweaver_plugin_themeclasses::sweaver_get_styles in Sweaver 7

Same name and namespace in other branches
  1. 6 plugins/sweaver_plugin_themeclasses/sweaver_plugin_themeclasses.inc \sweaver_plugin_themeclasses::sweaver_get_styles()

Get styles from the group. We look for a key called 'class'.

1 call to sweaver_plugin_themeclasses::sweaver_get_styles()
sweaver_plugin_themeclasses::sweaver_form in plugins/sweaver_plugin_themeclasses/sweaver_plugin_themeclasses.inc
Frontend form.

File

plugins/sweaver_plugin_themeclasses/sweaver_plugin_themeclasses.inc, line 118
Theme classes plugin.

Class

sweaver_plugin_themeclasses

Code

public function sweaver_get_styles($theme_info, &$styles) {
  foreach ($theme_info as $key => $value) {
    if (is_array($value) && isset($value['class'])) {
      $label = isset($value['label']) ? $value['label'] : $value['class'];
      $styles[] = '<div class="sweaver-switch-to-style " id="spt-' . $value['class'] . '"><a href="javascript:Drupal.Sweaver.ThemeClasses(\'spt-' . $value['class'] . '\', \'spt-' . strip_tags($value['label']) . '\')">' . strip_tags($value['label']) . '</a></div>';
    }
    if (is_array($value)) {
      $this
        ->sweaver_get_styles($theme_info[$key], $styles);
    }
  }
}