PHP Classes

PHP Google Calendar Add Event: Create 'Add to my google calendar' link for a page

Recommend this page to a friend!
  Info   View files Example   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2020-12-17 (11 months ago) RSS 2.0 feedNot enough user ratingsTotal: 171 This week: 2All time: 8,699 This week: 246Up
Version License PHP version Categories
gcalendar 1.0.0Freely Distributable5HTML, PHP 5, Time and Date
Description Author

This package can be used to create 'Add to my google calendar' link for a page.

It can take several parameters to configure the details of a given event, so it can generate HTML for a link on a page that when the user clicks on it will be added to his Google Calendar.

Currently it takes parameters to define event details like:

- Event name
- Event start date and time zone
- Event duration
- Event location
- Event description
- Event guest email addresses

Innovation Award
PHP Programming Innovation award winner
December 2020
Winner


Prize: One official elePHPant Plush Mascott
Google Calendar is a popular task scheduling application used by many people.

This package provides a simple way to add a scheduled task to Google Calendar by generating a link with all the parameters of the task.

So when the user clicks on that link, the browser goes to a page of Google Calendar to add the task to his calendar.

This way it becomes simple for a site to add tasks to other people calendars on Google Calendar.

Manuel Lemos
Picture of Stefan Kientzler
  Performance   Level  
Name: Stefan Kientzler is available for providing paid consulting. Contact Stefan Kientzler .
Classes: 16 packages by
Country: Germany Germany
Age: 54
All time rank: 114575 in Germany Germany
Week rank: 9 Up1 in Germany Germany Up
Innovation award
Innovation award
Nominee: 9x

Winner: 6x

Details

Create 'Add to my google calendar' Link to your Homepage

Latest Stable Version License Donate Minimum PHP Version Scrutinizer Code Quality

Overview

This class can generate the HREF value to provide a Add to my google calendar link to your page.

Following Data for the event to create is supported: - Subject

- `setSubject()`  
  • Start Date/Time - `setStart()`
  • End Date/Time or Duration(if not set, default duration of 30 min is used) - `setEnd()` or `setDuration()`
  • Timezone (if not set, system settings used) - `setTimezone()`
  • All day Event - `setTimezone()`
  • Detailed Description (optional) - `setDetails()`
  • Location - `setLocation()`
  • Additional Guest(s) - `addGuest()`

Usage

  1. Create an instance of the GCalAddEventLink class
  2. Set the required information for the event to be generated
  3. Pass the generated HREF to an <a> element on your page

See AddEventExample.php

Logging

This package can use any PSR-3 compliant logger. The logger is initialized with a NullLogger-object by default. The logger of your choice have to be passed to the constructor of the GCalAddEventLink class.

If you are not working with a PSR-3 compatible logger so far, this is a good opportunity to deal with this recommendation and may work with it in the future.

There are several more or less extensive PSR-3 packages available on the Internet.

You can also take a look at the 'XLogger' package and the associated blog 'PSR-3 logging in a PHP application' as an introduction to this topic.

History

2020-12-15 Version 1.00

* initial Version

  Files folder image Files  
File Role Description
Files folder imagePsr (1 directory)
Files folder imageSKien (1 directory)
Accessible without login Plain text file AddEventExample.php Example Example script
Accessible without login Plain text file autoloader.php Aux. Auxiliary script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpstan.neon Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  Psr  
File Role Description
Files folder imageLog (8 files)

  Files folder image Files  /  Psr  /  Log  
File Role Description
  Plain text file AbstractLogger.php Class Class source
  Plain text file InvalidArgumentException.php Class Class source
  Plain text file LoggerAwareInterface.php Class Class source
  Plain text file LoggerAwareTrait.php Class Class source
  Plain text file LoggerInterface.php Class Class source
  Plain text file LoggerTrait.php Class Class source
  Plain text file LogLevel.php Class Class source
  Plain text file NullLogger.php Class Class source

  Files folder image Files  /  SKien  
File Role Description
Files folder imageGCalendar (1 file)

  Files folder image Files  /  SKien  /  GCalendar  
File Role Description
  Plain text file GCalAddEventLink.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:171
This week:2
All time:8,699
This week:246Up
User Comments (1)
Very easy and functional.
8 months ago (martin butt)
80%StarStarStarStarStar
 
For more information send a message to info at phpclasses dot org.