You are here

protected function AvailabilityCalendarsStylesFormValidator::fieldsetStates in Availability Calendars 6.2

Same name and namespace in other branches
  1. 7.2 availability_calendars.styles.inc \AvailabilityCalendarsStylesFormValidator::fieldsetStates()
1 call to AvailabilityCalendarsStylesFormValidator::fieldsetStates()
AvailabilityCalendarsStylesFormValidator::exec in ./availability_calendars.styles.inc
Validates the styles settings. Form errors are set on error.

File

./availability_calendars.styles.inc, line 373

Class

AvailabilityCalendarsStylesFormValidator

Code

protected function fieldsetStates() {
  $this->currentFieldset = 'states';
  if ($this
    ->getStyle('split-day') != '') {

    // We need cell width and height for split days
    if ($this
      ->getStyle('width', 'days') != '') {
      form_set_error('days][width', t('The day cell width is needed to generate styles for split days.'));
    }
    if ($this
      ->getStyle('height', 'days') != '') {
      form_set_error('days][height', t('The day cell height is needed to generate styles for split days.'));
    }
  }
  $states = availability_calendars_get_states();
  foreach ($states as $class => $state) {
    $this
      ->colorField($state['class']);
  }
}