sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
140 stars 67 forks source link

Update category_submit.php #20

Closed sabas closed 11 years ago

sabas commented 11 years ago

Updated the regular expression to reflect new color picker. The hidden field contained the color with the hash (#000000), the picker instead produced color without the hash.

sproctor commented 11 years ago

I fixed this slightly differently. I'm not totally happy with the results either way. Someone can still manually enter a color with the "#" and we'll now mess it up. The final color needs the "#", I assume, so it's either store it in the DB or add it later. If at some point in the future we want to suppose some other scheme (images or the like), this is a good way to differentiate elements that have a color.

sabas commented 11 years ago

What about changing the regex function, instead of returning 1 it returns the color in a standardized way, so if there's the hash it returns as is, if not it adds it?