You are here

function flag_admin_listing_submit in Flag 6.2

Same name and namespace in other branches
  1. 7.3 includes/flag.admin.inc \flag_admin_listing_submit()
  2. 7.2 includes/flag.admin.inc \flag_admin_listing_submit()

Submit handler for the flag_admin_listing form. Save flag weight ordering.

File

includes/flag.admin.inc, line 52
Contains administrative pages for creating, editing, and deleting flags.

Code

function flag_admin_listing_submit($form, &$form_state) {
  foreach ($form['#flags'] as $flag) {
    if ($flag->weight != $form_state['values']['flags'][$flag->name]['weight']) {
      $flag->weight = $form_state['values']['flags'][$flag->name]['weight'];
      $flag
        ->save();
    }
  }
}