You are here

function node_limit_list_limits_submit in Node Limit 6

Same name and namespace in other branches
  1. 8 old/node_limit.module \node_limit_list_limits_submit()
  2. 7 node_limit.module \node_limit_list_limits_submit()

Save the module weights.

File

./node_limit.module, line 272
Module to restrict the number of nodes a user or role may create.

Code

function node_limit_list_limits_submit($form_id, &$form_state) {
  $sql = "UPDATE {node_limit} SET `weight`='%d' WHERE `lid`='%d'";
  foreach ($form_state['values']['limits'] as $lid => $info) {
    db_query($sql, $info['weight'], $lid);
  }
  drupal_set_message(t('Limits saved!'));
}