You are here

protected function AvailabilityCalendarStylesFormValidator::fieldsetStates in Availability Calendars 7.4

Same name and namespace in other branches
  1. 7.5 availability_calendar.styles.inc \AvailabilityCalendarStylesFormValidator::fieldsetStates()
  2. 7.3 availability_calendar.styles.inc \AvailabilityCalendarStylesFormValidator::fieldsetStates()
1 call to AvailabilityCalendarStylesFormValidator::fieldsetStates()
AvailabilityCalendarStylesFormValidator::exec in ./availability_calendar.styles.inc
Validates the styles settings. Form errors are set on error.

File

./availability_calendar.styles.inc, line 403

Class

AvailabilityCalendarStylesFormValidator

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_calendar_get_states();
  foreach ($states as $sid => $state) {
    $this
      ->colorField($state['css_class']);
  }
}