You are here

function themekey_ui_pathalias_submit in ThemeKey 6.3

Same name and namespace in other branches
  1. 6.4 themekey_ui_admin.inc \themekey_ui_pathalias_submit()
  2. 6.2 themekey_ui_admin.inc \themekey_ui_pathalias_submit()
  3. 7.3 themekey_ui_admin.inc \themekey_ui_pathalias_submit()
  4. 7 themekey_ui_admin.inc \themekey_ui_pathalias_submit()
  5. 7.2 themekey_ui_admin.inc \themekey_ui_pathalias_submit()

Form submission handler for themekey_ui_pathalias().

See also

themekey_ui_pathalias()

1 string reference to 'themekey_ui_pathalias_submit'
themekey_ui_pathalias in ./themekey_ui_admin.inc
Adds theme select box to url alias form

File

./themekey_ui_admin.inc, line 209

Code

function themekey_ui_pathalias_submit($form, &$form_state) {
  if ((empty($form_state['values']['themekey_ui_theme']) || 'default' == $form_state['values']['themekey_ui_theme']) && $form_state['values']['themekey_rule_id']) {
    themekey_ui_del_path_theme($form_state['values']['themekey_rule_id']);
  }
  elseif (!empty($form_state['values']['themekey_ui_theme']) && 'default' != $form_state['values']['themekey_ui_theme']) {
    themekey_ui_set_path_theme($form_state['values']['dst'], $form_state['values']['themekey_ui_theme'], $form_state['values']['themekey_rule_id']);
  }
  if ($form['src']['#default_value'] == $form_state['values']['src'] && $form['dst']['#default_value'] == $form_state['values']['dst'] && $form['themekey_ui_themes']['themekey_ui_theme']['#default_value'] != $form_state['values']['themekey_ui_theme']) {

    // only theme changed => clear page cache
    // REVIEW this might be a performance issue on large sites
    cache_clear_all('%' . $form_state['values']['dst'], 'cache_page', TRUE);
  }
}