I'm modifying the admin side of this plug-in a little. I've hit a small snag.
I'm modifying get_calendar_colors().
So far I've got it to not show colors as available if they are already in use by another calendar entry and I'm limiting the number of colors shown to 14.
function get_calendar_colors( $ftcal_color = null ) {
$full_colors = $this->get_full_colors();
$color = ( isset( $ftcal_color ) ) ? $ftcal_color : '668cd9';
$style = "background-color: #" . $color . "; border-color: #" . $color . ";";
$cc = '<div id="ftcalendar-color-picker">';
$cc .= '<input type="hidden" value="' . $color .'" id="ftcal-color" name="ftcal-color" />';
$cc .= "<div id='calendar-label-color' style='width: 175px; clear: both; " . $style . "'><div style='" . $style . "'>calendar</div></div>";
$cc .= "<ul>";
$count = 0; // tug
$colorsUsed = get_option('ftcalendar_meta'); // tug
$full_colors = array_diff($full_colors, $colorsUsed); // tug
foreach ( (array)$full_colors as $bg_color => $border_color ) {
$cc .= '<li class="calcolor-li"><a class="calcolor-square" style="background-color: #' . $bg_color .'; border: 1px solid #' . $border_color . ';"> </a></li>';
$count++; // tug
if($count == 14){ // tug
break; // tug
} // tug
}
$cc .= "</ul>";
$cc .= '</div>';
return $cc;
}
Since the plug-in uses Wp's core file to do the processing, I'm not sure where or how to refire the function in order to update the colors available once a new calendar is created successfully.
I'm not sure if anything is being set on success that I can listen for just to simply refresh the page.
Granted this doesn't have anything to do with this plug-in specifically but, worth a shot.