You are here

function availability_calendar_styles_generate in Availability Calendars 7.4

Same name and namespace in other branches
  1. 7.5 availability_calendar.styles.inc \availability_calendar_styles_generate()
  2. 7.3 availability_calendar.styles.inc \availability_calendar_styles_generate()

Callback to process form submission for the styles form.

3 calls to availability_calendar_styles_generate()
availability_calendar_install in ./availability_calendar.install
Implements hook_install(). @link http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
availability_calendar_update_7301 in ./availability_calendar.install
Regenerate custom styles file.
availability_calendar_update_7302 in ./availability_calendar.install
Regenerate custom styles file and display warning.
3 string references to 'availability_calendar_styles_generate'
availability_calendar_get_styles in ./availability_calendar.styles.inc
Returns the CSS styles defined for the calendars.
availability_calendar_install in ./availability_calendar.install
Implements hook_install(). @link http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...
availability_calendar_styles in ./availability_calendar.styles.inc
Define form callback for the admin/config/availability-calendar/styles page.

File

./availability_calendar.styles.inc, line 66

Code

function availability_calendar_styles_generate() {
  if (variable_get('availability_calendar_styles_generate', 1)) {
    $css_generator = new AvailabilityCalendarCssGenerator(availability_calendar_get_styles());
    $result = $css_generator
      ->exec();
    if ($result) {
      drupal_set_message(t('A custom CSS file for availability calendar fields has been successfully generated.'), 'status', FALSE);
    }
    else {
      drupal_set_message(t('An error occurred while saving the generated CSS file for availability calendar fields.'), 'error', FALSE);
    }
  }
}