You are here

function styleswitcher_styles_settings in Style Switcher 7.2

Same name and namespace in other branches
  1. 8.2 styleswitcher.module \styleswitcher_styles_settings()
  2. 6.2 styleswitcher.module \styleswitcher_styles_settings()
  3. 3.0.x styleswitcher.module \styleswitcher_styles_settings()

Returns a list of styles with theme-specific settings.

Parameters

string $theme: Name of the theme to get styles settings for.

Return value

array Array which keys are styles machine names and each element is a corresponding array with settings: weight, status and is_default. All settings are optional. See styleswitcher_style_load() for their descriptions.

See also

styleswitcher_style_load()

1 call to styleswitcher_styles_settings()
styleswitcher_style_load_multiple in ./styleswitcher.module
Returns a list of styles.
6 string references to 'styleswitcher_styles_settings'
styleswitcher_config_theme_submit in ./styleswitcher.admin.inc
Form submission handler for styleswitcher_config_theme().
styleswitcher_style_form_submit in ./styleswitcher.admin.inc
Form submission handler for styleswitcher_style_form().
styleswitcher_themes_disabled in ./styleswitcher.module
Implements hook_themes_disabled().
styleswitcher_uninstall in ./styleswitcher.install
Implements hook_uninstall().
styleswitcher_update_7204 in ./styleswitcher.install
Split styles storage into separate variables for settings and properties.

... See full list

File

./styleswitcher.module, line 451
Module's hooks implementations and helper functions.

Code

function styleswitcher_styles_settings($theme) {
  $settings = variable_get('styleswitcher_styles_settings', array());
  if (empty($settings[$theme])) {
    $settings[$theme] = array();
    styleswitcher_theme_styles($theme);

    // Disable the blank style if theme has its own default one.
    if (styleswitcher_theme_default_style_key($theme)) {
      $settings[$theme]['custom/default']['status'] = FALSE;
    }
  }
  return $settings[$theme];
}