You are here

function panels_sections_admin_settings_form_submit in Panels Sections 6

Same name and namespace in other branches
  1. 6.2 panels_sections.module \panels_sections_admin_settings_form_submit()

File

./panels_sections.module, line 206
Allows you to define panels_sections of your site and apply s to those panels_sections.

Code

function panels_sections_admin_settings_form_submit($form, &$form_state) {
  switch ($form_state['values']['op']) {
    case t('Save section'):
      db_query("UPDATE {panels_sections_data} SET name = '%s', status = %d, visibility = %d, panels_page = '%s', path = '%s', weight = %d WHERE sid = %d", $form_state['values']['name'], $form_state['values']['status'], $form_state['values']['visibility'], $form_state['values']['panels_page'], $form_state['values']['path'], $form_state['values']['weight'], $form_state['values']['sid']);
      drupal_set_message(t('The panels_sections configuration has been saved.'));
      cache_clear_all();
      menu_rebuild();
      drupal_goto('admin/panels/panels_sections');
      break;
    case t('Add section'):
      db_query("INSERT INTO {panels_sections_data} (name, status, visibility, path, panels_page, weight) VALUES ('%s', %d, %d, '%s', '%s', %d)", $form_state['values']['name'], $form_state['values']['status'], $form_state['values']['visibility'], $form_state['values']['path'], $form_state['values']['panels_page'], $form_state['values']['weight']);
      drupal_set_message(t('The panels_sections configuration has been saved.'));
      cache_clear_all();
      menu_rebuild();
      drupal_goto('admin/panels/panels_sections');
      break;
  }
}