header("Location:dict.php?act=errata"); break; case 'not_error': mark_dict_error_ok($_GET['error_id'], $_POST['comm']); header("Location:dict.php?act=errata"); break; case 'add_restr': add_dict_restriction($_POST); header("Location:dict.php?act=gram_restr"); break; case 'del_restr': del_dict_restriction($_GET['id']); header("Location:dict.php?act=gram_restr"); break; case 'update_restr': calculate_gram_restrictions(); header("Location:dict.php?act=gram_restr"); break; case 'save': // update after selectpicker (lemma_edit.tpl) // now we have to implode the arrays if (!empty($_POST['form_gram'])) { foreach ($_POST['form_gram'] as &$grams) { $grams = implode(', ', $grams); } } if (!empty($_POST['lemma_gram'])) { $_POST['lemma_gram'] = implode(', ', $_POST['lemma_gram']); } $lemma_id = dict_save($_POST); header("Location:dict.php?act=edit&saved&id={$lemma_id}");
function del_dict_restriction($id) { check_permission(PERM_DICT); sql_begin(); sql_pe("DELETE FROM gram_restrictions WHERE restr_id=? LIMIT 1", array($id)); calculate_gram_restrictions(); sql_commit(); }