function agenda_admin_configure_submit in Agenda 7.2
Same name and namespace in other branches
- 6.2 agenda.admin.php \agenda_admin_configure_submit()
- 6 agenda.admin.php \agenda_admin_configure_submit()
- 7 agenda.admin.php \agenda_admin_configure_submit()
Save all the settings into our agenda settings table
File
- ./
agenda.admin.php, line 335 - Administration interface for the agenda module
Code
function agenda_admin_configure_submit($form, $form_state) {
// Check if we're creating a new block, in which case the delta is 0
$delta = $form['agenda_bid']['#value'];
if ($delta == 0) {
$delta = db_query('SELECT COALESCE(MAX(bid)+1,1) AS count FROM {agenda}')
->fetchField();
}
// Save the settings
foreach ($form_state['values'] as $key => $value) {
if (!isset($form[$key]['#agenda_setting'])) {
continue;
}
$setting = substr($key, 7);
agenda_variable_set($delta, $setting, $value);
}
drupal_set_message('Block settings were saved successfully');
drupal_goto('admin/config/services/agenda');
}