eevent_helper.ee2_addon icon indicating copy to clipboard operation
eevent_helper.ee2_addon copied to clipboard

feature request: prepend, append, show_empty

Open GDmac opened this issue 12 years ago • 0 comments

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;
    }

GDmac avatar Nov 25 '13 14:11 GDmac