eevent_helper.ee2_addon
eevent_helper.ee2_addon copied to clipboard
feature request: prepend, append, show_empty
I have added a couple of parameters to ft.event_helper and also to your ft.time_select add-on, to add display options. Since the start_time and end_time are optional i wanted to prevent some conditionals to check wether the time_select is set to 0.
params: prepend="", append="" show_empty="no"
changed the replace_tag method to include these params:
function replace_tag($data, $params = array(), $tagdata = FALSE)
{
// edit: fetch prepend, append and add to return data
if ($data == '0' && isset($params['show_empty']) && $params['show_empty']=='no') return '';
$prepend = (isset($params['prepend']) ? $params['prepend'] : '');
$append = (isset($params['append']) ? $params['append'] : '');
if(isset($params['format']) && !empty($params['format']))
{
$data = $this->EE->localize->{$this->format_date_fn}($params['format'], $data, FALSE);
}
return $prepend . ($data ? $data : '') . $append;
}