[eluser]Kenneth Allen[/eluser]
The existing Calendar class in CI is pretty good, but I am missing one feature — how to specify a link to appear in every non-content date cell which has the current date embedded.
I have hacked the calendar class to embed the link as follows:
Code:
$kenSpecial = anchor(site_url('group/availableStandard/'.$year.'-'.$month.'-'.$day), 'Standard').' '.$day;
and then on the str_replace() call for cells with no content I insert $kenSpecial rather than $day.
That worked, but it restricts the class to this one special use (OK for the moment). I would prefer to pass in the URL with [current_date] for implicit substitution, or place it in the template for this use and still be able to use [current_date]. In fact, I think I am going to test the template approach and if that works use it, as the change to the Calendar class will then be more generic (just use a different template)
If anyone have a better idea aside from changing line 227 in Calendar class from
Code:
$out .= str_replace('{day}', $day, $temp);
to
Code:
$out .= str_replace('{day}', $day, str_replace('[currrent_date]', $year.'-'$month.'-'$day$temp);
please let me know.