function alinks_edit_form_submit in Alinks 6
Same name and namespace in other branches
- 7 alinks.module \alinks_edit_form_submit()
Process the edit alinks form
File
- ./
alinks.module, line 456
Code
function alinks_edit_form_submit($form, &$form_state) {
foreach ($form_state['values']['edit_alink'] as $id => $alink) {
if ($alink['delete']) {
db_query("DELETE FROM {alinks} WHERE id = %d", $id);
}
else {
db_query("UPDATE {alinks} SET alink_start_boundary = %d, alink_text = '%s', alink_end_boundary = %d, alink_case_insensitive = %d, alink_url = '%s', url_title = '%s', alink_external = %d, alink_class = '%s', alink_weight = %d WHERE id = %d", $alink['start_boundary_edit'], $alink['word_edit'], $alink['end_boundary_edit'], $alink['case_insensitive_edit'], $alink['url_edit'], $alink['url_title_edit'], $alink['external_edit'], $alink['class_edit'], $alink['weight_edit'], $id);
}
}
drupal_set_message('Alinks succesfuly updated');
}