out.append("&pvttk="); if (cal[1] != null) out.append(cal[1]);
if (cal[1] != null || calendars.size() > 1) { out.append("&pvttk="); if (cal[1] != null) out.append(cal[1]); }
    public String execute(Map params, String body, RenderContext renderContext) throws MacroException    {        String mode = getModeParam(params);        String controls = getControlsParam(params);        String title = (String) params.get(TITLE_PARAM);        String eventsPerDay = (String) params.get(EVENTS_PER_DAY_PARAM);        String bgcolor = (String) params.get(BGCOLOR_PARAM);        String width = getWidthParam(params);        int height = getHeightParam(params);        List calendars = getCalendars(body);        StringBuffer out = new StringBuffer();        out.append("<iframe src=\"");        // Append the URL        out.append("http://www.google.com/calendar/embed?");        for (int i = 0; i < calendars.size(); i++)        {            String[] cal = (String[]) calendars.get(i);            if (i > 0)                out.append("&");            out.append("src=").append(GeneralUtil.urlEncode(cal[0]));            out.append("&pvttk=");            if (cal[1] != null)                out.append(cal[1]);        }        if (AGENDA_MODE.equals(mode))            out.append("&mode=AGENDA");        if (title != null)            out.append("&title=").append(GeneralUtil.urlEncode(title));        if (eventsPerDay != null)            out.append("&epr=").append(GeneralUtil.urlEncode(eventsPerDay));        out.append("&height=").append(GeneralUtil.urlEncode(String.valueOf(height - 20)));        if (!ALL_CONTROLS.equals(controls))            out.append("&chrome=").append(GeneralUtil.urlEncode(controls.toUpperCase()));        if (bgcolor != null)            out.append("&bgcolor=").append(GeneralUtil.urlEncode(bgcolor));        out.append("\"");        out.append(" style=\"border-width:0\" frameborder=\"0\"");        out.append(" width=\"").append(width).append("\"");        out.append(" height=\"").append(height).append("\"");        out.append(">");        out.append("</iframe>");        return out.toString();    }