Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
002ae78
commit beb7b37
Showing
3 changed files
with
65 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,63 @@ | ||
Google Client library for use with ProcessWire CMS/CMF | ||
# Google Client API and Markup Google Calendar modules | ||
|
||
## Requirements | ||
|
||
- ProcessWire 3.0.10 or newer | ||
- PHP 5.4 or newer | ||
- Composer | ||
|
||
## Google Client API module | ||
|
||
This module is also created as a demonstration for installation of modules via Composer. | ||
In this case, this module requires installation via Composer since it has external | ||
dependencies, though we'll be adding support for other installation methods soon. | ||
|
||
### Installation | ||
|
||
In your ProcessWire installation root execute the following command from the terminal: | ||
|
||
```````` | ||
composer require processwire/google-client-api | ||
```````` | ||
|
||
Login to your ProcessWire admin and go to: Modules > Refresh. Click "Install" next to | ||
the Google Client API module (which should appear on the "Site" tab). | ||
|
||
The module now needs to be connected with a Google account. Full instructions on how | ||
to do this will be posted shortly at https://processwire.com/blog/. | ||
|
||
---------------------- | ||
|
||
# Markup Google Calendar module for ProcessWire | ||
|
||
Renders a calendar with data from google. This module demonstrates use of | ||
and requires the GoogleClientAPI module, which must be installed and configured | ||
prior to using this module. | ||
|
||
See the "_mgc-event.php" file which is what handles the output markup. You should | ||
copy this file to /site/templates/_mgc-event.php and modify it as you see fit. | ||
If you do not copy to your /site/templates/ directory then it will use the | ||
default one in the module directory. | ||
|
||
Please note that all render methods cache output by default for 1 hour. You can | ||
change this by adjusting the $cacheExpire property of the module. | ||
|
||
## Usage | ||
|
||
````````````````` | ||
$cal = $modules->get('MarkupGoogleCalendar'); | ||
$cal->calendarID = 'your-calendar-id'; // Your Google Calendar ID (default=primary) | ||
$cal->cacheExpire = 3600; // how many seconds to cache output (default=3600) | ||
$cal->maxResults = 100; // maximum number of results to render (default=100) | ||
// use any one of the following | ||
echo $cal->renderMonth(); // render events for this month | ||
echo $cal->renderMonth($month, $year); // render events for given month | ||
echo $cal->renderDay(); // render events for today | ||
echo $cal->renderDay($day, $month, $year); // render events for given day | ||
echo $cal->renderUpcoming(10); // render next 10 upcoming events | ||
echo $cal->renderRange($timeMin, $timeMax); // render events between given min/max dates/times | ||
`````````````````` | ||
|
||
More details and options can be found in the phpdoc comments for each | ||
of the above mentioned methods. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
} | ||
], | ||
"require": { | ||
"hari/pw-module": "dev-master", | ||
"hari/pw-module": "~1.0", | ||
"google/apiclient": "^2.0.0@RC" | ||
} | ||
} |