You are here

function delta_add_override_validate in Delta 6

Same name and namespace in other branches
  1. 7 delta.module \delta_add_override_validate()
1 string reference to 'delta_add_override_validate'
delta_manage_override_form in ./delta.module

File

./delta.module, line 738
The Delta Theme API is an advanced manipulation of the Theme Settings API to allow for customization/configuration of theme settings based on node types, context, or groups of paths.

Code

function delta_add_override_validate($form, &$form_state) {

  // only valid when we are truly submitting the form, not for AHAH
  if ($form_state['clicked_button']['#id'] == 'edit-submit') {
    $delta = $form_state['values']['delta_override'];
    if (!$delta['name']) {
      form_set_error('name', t('You must create a valid <strong>Override Title</strong> for this override.'));
    }
    if (!$delta['system_name']) {
      form_set_error('system_name', t('You must create a valid <strong>System Name</strong> for this override.'));
    }
    if (!$delta['theme']) {
      form_set_error('theme', t('You need to select a theme for this override to apply to.'));
    }
  }
}