$bg_color = $inCore->request('bg_color_'.$id, 'str'); $tx_color = $inCore->request('tx_color_'.$id, 'str'); $pattern = '/^#(([a-fA-F0-9]{3}$)|([a-fA-F0-9]{6}$))/'; if(preg_match($pattern,$bg_color)) { $bg = $bg_color; } if(preg_match($pattern,$tx_color)) { $tx = $tx_color; } if($bg and $tx and $name) { $model->updateCategory($id,$name,$bg,$tx); } unset($bg); unset($bg_color); unset($tx); unset($tx_color); unset($name); } } $inCore->saveComponentConfig('calendar', $cfg); $inCore->redirectBack(); } $msg = cmsUser::sessionGet('calendr_msg'); if ($msg) { echo '<p class="success">'.$msg.'</p>'; cmsUser::sessionDel('calendr_msg'); } ?>