You are here

function zenophile_create_validate in Zenophile 6

Same name and namespace in other branches
  1. 6.2 zenophile.module \zenophile_create_validate()
  2. 7 zenophile.module \zenophile_create_validate()

Validator for zenophile_create().

File

./zenophile.module, line 108

Code

function zenophile_create_validate($form, &$form_state) {

  // Check that the system name of the theme is valid
  if (preg_match('/[^a-z_]/', $form_state['values']['sysname'])) {
    form_set_error('sysname', t('The <em>System name</em> may only consist of lowercase letters and the underscore character.'));
  }
  if (drupal_get_path('theme', $form_state['values']['sysname'])) {
    form_set_error('sysname', t('A theme with this <em>System name</em> already exists. Cowardly refusing to create another one.'));
  }
}