You are here

function front_page_admin_arrange_form_submit in Front Page 7.2

Same name and namespace in other branches
  1. 6.2 front_page.admin.inc \front_page_admin_arrange_form_submit()

Submit hook for front_page_admin_arrange_form.

File

./front_page.admin.inc, line 256
Admin page callbacks for the front page module.

Code

function front_page_admin_arrange_form_submit($form, &$form_state) {
  $front_page_data = front_page_get_all();
  foreach ($form_state['values']['roles'] as $rid => $role) {
    if (isset($role['mode']) && !$role['mode'] || !isset($front_page_data[$rid])) {
      $data = _front_page_get_by_rid_with_default($rid);
      $data['mode'] = '';
      $data['data'] = '';
      $data['filter_format'] = '';
      $data['weight'] = $role['weight'];
      variable_set("front_page_role_{$rid}", $data);
    }
    else {
      $data = _front_page_get_by_rid_with_default($rid);
      $data['weight'] = $role['weight'];
      variable_set("front_page_role_{$rid}", $data);
    }
  }
}