You are here

function ajaxblocks_save_settings in Ajax Blocks 7

Same name and namespace in other branches
  1. 6 ajaxblocks.module \ajaxblocks_save_settings()

Additional submit handler for block settings form. Saves AJAX settings for the block.

1 string reference to 'ajaxblocks_save_settings'
ajaxblocks_form_block_admin_configure_alter in ./ajaxblocks.module
Implements hook_form_FORM_ID_alter(). Adds AJAX settings to the block configure page.

File

./ajaxblocks.module, line 133
Loads dynamic blocks on cached page for anonymous users by performing AJAX request.

Code

function ajaxblocks_save_settings($form, &$form_state) {
  db_merge('ajaxblocks')
    ->key(array(
    'block_id' => $form_state['values']['module'] . '-' . $form_state['values']['delta'],
  ))
    ->fields(array(
    'is_ajax' => (int) $form_state['values']['ajaxblocks_is_ajax'],
    'loader_picture' => (int) $form_state['values']['ajaxblocks_loader_picture'],
    'is_late' => (int) $form_state['values']['ajaxblocks_is_late'],
    'delay' => (int) $form_state['values']['ajaxblocks_delay'],
    'include_noscript' => (int) $form_state['values']['ajaxblocks_include_noscript'],
    'cached_roles' => implode(' ', array_filter($form_state['values']['ajaxblocks_cached_roles'])),
    'uncached_roles' => implode(' ', array_filter($form_state['values']['ajaxblocks_uncached_roles'])),
  ))
    ->execute();
  ajaxblocks_update_cache();
}