You are here

function og_panels_table_submit in Organic groups 6

Same name and namespace in other branches
  1. 5.8 og_panels.module \og_panels_table_submit()
  2. 5 og_panels.module \og_panels_table_submit()
  3. 5.3 og_panels.module \og_panels_table_submit()
  4. 5.7 og_panels.module \og_panels_table_submit()

File

modules/og_panels/og_panels.module, line 241

Code

function og_panels_table_submit($form_id, $form_values) {
  db_query("UPDATE {og_panels} SET default_page = 0 WHERE nid = %d", $form_values['group_node']->nid);
  foreach ($form_values['displays'] as $did => $settings) {
    $default = $did == $form_values['default_page'] ? TRUE : FALSE;
    $sql = "UPDATE {og_panels} SET weight = %d, default_page = %d WHERE did = %d";
    db_query($sql, $settings['weight'], $default, $did);
  }
  drupal_set_message(t('Updated panels configuration.'));
}