You are here

function node_limit_list_limits_submit in Node Limit 8

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

Save the module weights.

File

old/node_limit.module, line 415

Code

function node_limit_list_limits_submit($form_id, &$form_state) {
  foreach ($form_state['values']['limits'] as $lid => $info) {
    $query = \Drupal::database()
      ->update('node_limit')
      ->fields(array(
      'weight' => $info['weight'],
    ))
      ->condition('lid', $lid)
      ->execute();
  }
  \Drupal::messenger()
    ->addStatus(t('Limits saved!'));
}