You are here

function simplenews_admin_categories_submit in Simplenews 7

Same name and namespace in other branches
  1. 7.2 includes/simplenews.admin.inc \simplenews_admin_categories_submit()

Form submit callback for the simplenews categories.

File

includes/simplenews.admin.inc, line 346
Newsletter admin, subscription admin, simplenews settings

Code

function simplenews_admin_categories_submit($form, &$form_state) {
  foreach ($form_state['values'] as $tid => $category) {
    if (is_numeric($tid) && $form[$tid]['#category']->weight != $category['weight']) {
      $form[$tid]['#category']->weight = $category['weight'];
      simplenews_category_save($form[$tid]['#category']);
    }
  }
  drupal_set_message(t('Your configuration has been saved.'));
}