You are here

function _styleswitcher_style_exists in Style Switcher 7.2

Checks whether a submitted machine name value already exists.

Parameters

string $input: User-submitted value.

Return value

array|false Style array on success or FALSE otherwise. Style is an associative array as returned from styleswitcher_style_load().

See also

styleswitcher_style_load()

1 string reference to '_styleswitcher_style_exists'
styleswitcher_style_form in ./styleswitcher.admin.inc
Page callback: Constructs a form to add/edit a style.

File

./styleswitcher.admin.inc, line 506
Styleswitcher configuration functionality.

Code

function _styleswitcher_style_exists($input) {

  // It does not matter what theme to set in this load call, because all custom
  // styles exist in all themes. Let's set one from the current page just to
  // decrease calculations.
  return styleswitcher_style_load($input, $GLOBALS['theme'], 'custom');
}