[drupal] handle sensor form submission
This commit is contained in:
parent
1b26bf0e8c
commit
9d9befbee0
|
@ -891,9 +891,20 @@ function _logger_sensors_form() {
|
||||||
'#value' => t('Update'),
|
'#value' => t('Update'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$form['#submit'][] = '_logger_sensors_submit';
|
||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _logger_sensors_submit($form, &$form_state) {
|
||||||
|
foreach ($form_state['values']['list'] as $sensor => $chart) {
|
||||||
|
if ($chart)
|
||||||
|
db_query("UPDATE {logger_meters} SET chart = %d WHERE meter = '%s'", 1, $sensor);
|
||||||
|
else
|
||||||
|
db_query("UPDATE {logger_meters} SET chart = %d WHERE meter = '%s'", 0, $sensor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_form_alter().
|
* Implementation of hook_form_alter().
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue