You are here

function _omega_tools_validate_theme_name in Omega Tools 7.3

@todo

1 string reference to '_omega_tools_validate_theme_name'
omega_tools_subtheme_add in includes/omega_tools.admin.inc
@todo

File

./omega_tools.module, line 571

Code

function _omega_tools_validate_theme_name($element, &$form_state) {
  system_rebuild_theme_data();
  if (!preg_match('/^[a-z][a-z0-9_]*$/', $element['#value'])) {
    form_error($element, t('The theme name is invalid. It may only contain lowercase numbers, letters and underscores and must start with a letter.'));
  }
  else {
    if (_omega_tools_theme_exists($element['#value'])) {
      form_error($element, t('A theme with that name already exists. The machine-readable name must be unique.'));
    }
  }
}