You are here

function swftools_onepixelout_admin_submit in SWF Tools 6.3

Custom form handler to encode colors properly when using color picker module.

1 string reference to 'swftools_onepixelout_admin_submit'
swftools_onepixelout_admin_form in onepixelout/swftools_onepixelout.admin.inc
@file Configuration settings for OnePixelOut.

File

onepixelout/swftools_onepixelout.admin.inc, line 91
Configuration settings for OnePixelOut.

Code

function swftools_onepixelout_admin_submit($form, &$form_state) {

  // Make sure colors are coded properly
  if (function_exists('colorpicker_2_or_later')) {
    foreach (array_keys($form_state['values']) as $key) {
      $form_state['values'][$key] = preg_replace(array(
        '/^#\\s*$/',
        '/^#/',
      ), array(
        '',
        '0x',
      ), $form_state['values'][$key]);
    }
  }
}