General Actions:
Log-in
Wiki:
L3D's Wiki
▼
:
Document Index
»
Space:
XWiki
▼
:
Document Index
»
Page:
GoogleCalendarMacros
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
GoogleCalendarMacros
Wiki source code of
GoogleCalendarMacros
Last modified by
Hal Eden
on 2011/03/04 07:57
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
#** * Displays a public google calendar with all buttons and displays * The size of the display is 800x600 * * 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 t of the calendar then the information will be displayed. * * @param id ID of the google account to display the calendar for *# #macro(googlecal $id) {pre} <iframe src="http://www.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23FFFFFF&src=${id.replaceAll("@","%40")}&color=%232952A3" style=" b order-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>{/pre} #end #** * Displays a public google calendar with all buttons and displays and a custom size * * @param id ID of the google account to display the calendar for * @param width Width of the calendar * @param height Height of the calendar *# #macro(googlecalsize $id $width $height) #if($width=="") #set($width = "800") #end #if($height=="") #set($height = "600") #end {pre} <iframe src="http://www.google.com/calendar/embed?height=${height}&wkst=1&bgcolor=%23FFFFFF&src=${id.replaceAll("@","%40")}&color=%232952A3" sty le=" border-width:0 " width="${width}" height="${height}" frameborder="0" scrolling="no"></iframe> {/pre} #end #** * Displays a private google calendar with all buttons * * @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 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 se this macro *# #macro(googlecalprivate $id $token) {pre} <iframe src="http://www.google.com/calendar/embed?pvttk=${token}&height=600&wkst=1&bgcolor=%23FFFFFF&src=${id.replaceAll("@","%40")}&color=% 232952A3" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe> {/pre}#end #** * Displays a private google calendar with all buttons * * @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 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 se this macro * @param width Width of the calendar * @param height Height of the calendar *# #macro(googlecalprivatesize $id $token $width $height) #if($width=="") #set($width = "800") #end #if($height=="") #set($height = "600") #end {pre} <iframe src="http://www.google.com/calendar/embed?pvttk=${token}&height=${height}&wkst=1&bgcolor=%23FFFFFF&src=${id.replaceAll("@","%40")}&c olor=%232952A3" style=" border-width:0 " width="${width}" height="${height}" frameborder="0" scrolling="no"></iframe> {/pre}#end#** * Displays a public or private google calendar with a wide range of settings * You can check the effect of these settings using the Google Calendar Embed Helper * http://www.google.com/calendar/embedhelper * * @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 * @param width Width of the calendar * @param height Height of the calendar * @param showTitle 0 to not show the title * @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 * @param showPrint 0 to not show the print button * @param showTabs 0 to not show the tabs allowing to switch between MONTH,WEEK,AGENDA mode * @param showCalendars 0 to not show the calendars list drop down button * @param showTz Show a message saying the timezone of the dates/hours * @param mode Default mode to display (empty is Month display, WEEK is Week dispaly, AGENDA is the event display) * @param language Language to display in (en,fr,de,..) * @param bgcolor Background color of the calendar in the form #255455 * @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 * @param border Border in pixels (1,2,3) *# #macro(googlecalcustom $id $token $width $height $showTitle $showNav $showDate $showPrint $showTabs $showCalendars $showTz $mode $language $bgcolor $color $ctz $border) #if($width=="") #set($width = "800") #end #if($height=="") #set($height = "600") #end #if($color!="") #set($color = $color.replaceAll("#","%23")) #else #set($color = "%232952A3") #end #if($bgcolor!="") #set($bgcolor = $color.replaceAll("#","%23")) #else #set($bgcolor = "%232952A3") #end #set($oldtime = $xwiki.getDate().getTime()-(1000*60*60*24*30)) #set($olddate = $datetool.toDate($oldtime)) #set($oldtimestamp = $xwiki.formatDate($olddate, "yyyyMMdd")) #set($futtime = $xwiki.getDate().getTime()+(1000*60*60*24*30)) #set($futdate = $datetool.toDate($futtime)) #set($futtimestamp = $xwiki.formatDate($futdate, "yyyyMMdd")) {pre} <iframe src="//www.google.com/calendar/embed?dates=${oldtimestamp}/${oldtimestamp}&title=Test&showTitle=${showTitle}&showNav=${showNav}&showDate=${showDate}&showPrint=${showPrint}&showTabs=${showTabs}&showCalendars=${showCalendars}&showTz=${showTz}&mode=${mode}&height=${height}&wkst=2&hl=${language}&bgcolor=${bgcolor}&src=${id.replaceAll("@","%40")}&color=${color}&ctz=${ctz}" style=" border:solid ${border}px #777 " width="${width}" height="${height}" frameborder="0" scrolling="no" ></iframe> {/pre} #end
Quick Links
L3D Calendar
Wiki Dashboard
Document Index
Blog
Sandbox