1 19 package org.lucane.applications.calendar.web; 20 21 import java.io.IOException ; 22 import java.io.Writer ; 23 import java.text.DateFormat ; 24 import java.util.Date ; 25 import java.util.Locale ; 26 27 import org.lucane.common.concepts.UserConcept; 28 import org.lucane.webconnector.WebApp; 29 import org.lucane.webconnector.widgets.Widget; 30 import org.lucane.webconnector.security.LucanePrincipal; 31 32 public class CalendarHeaderWidget implements Widget 33 { 34 private WebApp app; 35 private boolean my; 36 private String user; 37 38 public CalendarHeaderWidget(WebApp app, boolean my, String user) 39 { 40 this.app = app; 41 this.my = my; 42 this.user = user; 43 } 44 45 public void render(Writer out) throws IOException 46 { 47 out.write("<div id='calendar_header'>\n"); 48 49 if(my) 50 { 51 out.write("<a class='calendar_button' HREF='new_event.jsp'>"); 52 out.write("<img SRC='images/new.png' alt='' />"); 53 out.write(app.tr("btn.newEvent")); 54 out.write("</a>\n"); 55 } 56 else 57 { 58 out.write("<a class='calendar_button' HREF='index.jsp'>"); 59 out.write("<img SRC='images/other.png' alt='' />"); 60 out.write(user); 61 out.write("</a>\n"); 62 } 63 64 out.write("<a class='calendar_button' HREF='month.jsp?username=" + user + "'>"); 65 out.write("<img SRC='images/jumpTo.png' alt='' />"); 66 out.write(app.tr("btn.thisMonth")); 67 out.write("</a>\n"); 68 69 out.write("<a class='calendar_button' HREF='week.jsp?username=" + user + "'>"); 70 out.write("<img SRC='images/jumpTo.png' alt='' />"); 71 out.write(app.tr("btn.thisWeek")); 72 out.write("</a>\n"); 73 74 out.write("<a class='calendar_button' HREF='day.jsp?username=" + user + "'>"); 75 out.write("<img SRC='images/jumpTo.png' alt='' />"); 76 out.write(app.tr("btn.today")); 77 out.write("</a>\n"); 78 79 if(my) 80 { 81 out.write("<a class='calendar_button' HREF='other_calendars.jsp'>"); 82 out.write("<img SRC='images/other.png' alt='' />"); 83 out.write(app.tr("btn.otherCalendars")); 84 out.write("</a>\n"); 85 } 86 87 out.write("</div>\n"); 88 } 89 } | Popular Tags |