You are here

function esi__block_config_save in ESI: Edge Side Includes 6.2

Form-submit handler for ESI settings in block-config

1 string reference to 'esi__block_config_save'
esi_form_block_admin_configure_alter in ./esi.module
Implementation of hook_form_FORM_ID_alter(). for block_admin_configure Add ESI-configuration options to the block-config pages.

File

./esi.module, line 360
Adds support for ESI (Edge-Side-Include) integration, allowing blocks to be\ delivered by ESI, with support for per-block cache times.

Code

function esi__block_config_save($form, $form_state) {
  require_once drupal_get_path('module', 'esi') . '/esi.inc';
  $module = $form_state['values']['module'];
  $delta = $form_state['values']['delta'];
  $config = array();
  $config['max_age'] = (int) $form_state['values']['esi_config']['max_age'];
  $config['scope'] = (int) $form_state['values']['esi_config']['scope'];

  // Save the settings.
  esi_get_settings($module . '_' . $delta, $config);
}