function mmenu_admin_settings_form_submit in Mobile sliding menu 7.2
Same name and namespace in other branches
- 7.3 mmenu.admin.inc \mmenu_admin_settings_form_submit()
- 7 mmenu.admin.inc \mmenu_admin_settings_form_submit()
Form submission handler for mmenu_admin_settings_form().
File
- ./
mmenu.admin.inc, line 930 - Mmenu administration menu items.
Code
function mmenu_admin_settings_form_submit($form_id, &$form_state) {
$values = $form_state['values'];
switch ($values['op']) {
case t('Save'):
$blocks = array();
// Updates the blocks.
foreach ($values['blocks'] as $k => $block) {
if (!empty($block['module_delta'])) {
$v = explode('|', $block['module_delta']);
$blocks[$k] = $block;
$blocks[$k] += array(
'module' => $v[0],
'delta' => $v[1],
);
}
}
// Updates the effects of options.
if (isset($values['options']['effects'])) {
foreach ($values['options']['effects'] as $k => $v) {
if (!$v) {
unset($values['options']['effects'][$k]);
}
}
}
$mmenu = array(
'enabled' => $values['general']['enabled'],
'title' => $values['general']['title'],
'name' => $values['general']['name'],
'blocks' => $blocks,
'options' => mmenu_convert_settings('options', $values['options']),
'configurations' => mmenu_convert_settings('configurations', $values['configurations']),
);
variable_set('mmenu_item_' . $values['general']['name'], $mmenu);
// Clears mmenus cache.
cache_clear_all('mmenus', 'cache');
drupal_set_message(t('The settings have been saved.'));
break;
case t('Reset'):
// Deletes the mmenu settings from database.
variable_del('mmenu_item_' . $values['general']['name']);
// Clears mmenus cache.
cache_clear_all('mmenus', 'cache');
drupal_set_message(t('The settings have been reset.'));
break;
}
}