Wiki source code of GoogleCalendarMacros

Last modified by Hal Eden on 2010/08/20 11:53

Hide last authors
Hal Eden 1.1 1
2 #**
3 * Displays a public google calendar with all buttons and displays
4 * The size of the display is 800x600
5 * * This macro displays the public part of the calendar specified. However if the visiting user is logged in in Google Calendar and has rights to the private par
6 t of the calendar then the information will be displayed.
7 *
8 * @param id ID of the google account to display the calendar for
9 *#
10 #macro(googlecal $id)
11 {pre}
12 <iframe src="http://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=${id.replaceAll("@","%40")}&amp;color=%232952A3" style=" b
13 order-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>{/pre}
14 #end
15
16 #** * Displays a public google calendar with all buttons and displays and a custom size
17 *
18 * @param id ID of the google account to display the calendar for
19 * @param width Width of the calendar
20 * @param height Height of the calendar
21 *#
22 #macro(googlecalsize $id $width $height)
23 #if($width=="")
24 #set($width = "800")
25 #end
26 #if($height=="")
27 #set($height = "600")
28 #end
29 {pre}
30 <iframe src="http://www.google.com/calendar/embed?height=${height}&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=${id.replaceAll("@","%40")}&amp;color=%232952A3" sty
31 le=" border-width:0 " width="${width}" height="${height}" frameborder="0" scrolling="no"></iframe>
32 {/pre}
33 #end
34
35
36 #**
37 * Displays a private google calendar with all buttons
38 *
39 * @param id ID of the google account to display the calendar for * @param token Private token giving access to the Calendar. This token is 32 chars long and can be retrieved in the "Agenda Details" when accessing your "Priva
40 te URL" of your calendar. You should use this parameter with care as it will display all your calendar events to anybody that can access the page in which you u
41 se this macro
42 *#
43 #macro(googlecalprivate $id $token)
44 {pre}
45 <iframe src="http://www.google.com/calendar/embed?pvttk=${token}&amp;height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=${id.replaceAll("@","%40")}&amp;color=%
46 232952A3" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
47 {/pre}#end
48
49 #**
50 * Displays a private google calendar with all buttons *
51 * @param id ID of the google account to display the calendar for
52 * @param token Private token giving access to the Calendar. This token is 32 chars long and can be retrieved in the "Agenda Details" when accessing your "Priva
53 te URL" of your calendar. You should use this parameter with care as it will display all your calendar events to anybody that can access the page in which you u
54 se this macro
55 * @param width Width of the calendar
56 * @param height Height of the calendar
57 *#
58 #macro(googlecalprivatesize $id $token $width $height)
59 #if($width=="")
60 #set($width = "800")
61 #end
62 #if($height=="")
63 #set($height = "600")
64 #end
65 {pre}
66 <iframe src="http://www.google.com/calendar/embed?pvttk=${token}&amp;height=${height}&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=${id.replaceAll("@","%40")}&amp;c
67 olor=%232952A3" style=" border-width:0 " width="${width}" height="${height}" frameborder="0" scrolling="no"></iframe>
68 {/pre}#end#**
69 * Displays a public or private google calendar with a wide range of settings
70 * You can check the effect of these settings using the Google Calendar Embed Helper
71 * http://www.google.com/calendar/embedhelper
72 * * @param id ID of the google account to display the calendar for * @param token Private token giving access to the Calendar. This token is 32 chars long and can be retrieved in the "Agenda Details" when accessing your "Private URL" of your calendar. You should use this parameter with care as it will display all your calendar events to anybody that can access the page in which you use this macro
73 * @param width Width of the calendar
74 * @param height Height of the calendar
75 * @param showTitle 0 to not show the title
76 * @param showNav 0 to not show the navigation buttons allowing to switch to previous/next week or month * @param showDate 0 to not show the current period displayed
77 * @param showPrint 0 to not show the print button
78 * @param showTabs 0 to not show the tabs allowing to switch between MONTH,WEEK,AGENDA mode
79 * @param showCalendars 0 to not show the calendars list drop down button
80 * @param showTz Show a message saying the timezone of the dates/hours
81 * @param mode Default mode to display (empty is Month display, WEEK is Week dispaly, AGENDA is the event display)
82 * @param language Language to display in (en,fr,de,..)
83 * @param bgcolor Background color of the calendar in the form #255455
84 * @param color Color of the events in the form #234567 * @param ctz Timezone in which to display the calendar. Leave empty for default calendar Timezone
85 * @param border Border in pixels (1,2,3)
86 *#
87 #macro(googlecalcustom $id $token $width $height $showTitle $showNav $showDate $showPrint $showTabs $showCalendars $showTz $mode $language $bgcolor $color $ctz $border)
88 #if($width=="")
89 #set($width = "800")
90 #end
91 #if($height=="")
92 #set($height = "600")
93 #end
94 #if($color!="")
95 #set($color = $color.replaceAll("#","%23"))
96 #else
97 #set($color = "%232952A3")
98 #end
99 #if($bgcolor!="")
100 #set($bgcolor = $color.replaceAll("#","%23"))
101 #else
102 #set($bgcolor = "%232952A3")
103 #end
104 {pre}
105 <iframe src="//www.google.com/calendar/embed?title=Test&amp;showTitle=${showTitle}&amp;showNav=${showNav}&amp;showDate=${showDate}&amp;showPrint=${showPrint}&amp;showTabs=${showTabs}&amp;showCalendars=${showCalendars}&amp;showTz=${showTz}&amp;mode=${mode}&amp;height=${height}&amp;wkst=2&amp;hl=${language}&amp;bgcolor=${bgcolor}&amp;src=${id.replaceAll("@","%40")}&amp;color=${color}&amp;ctz=${ctz}" style=" border:solid ${border}px #777 " width="${width}" height="${height}" frameborder="0" scrolling="no"></iframe>
106 {/pre}
107 #end