Skip to content

Commit

Permalink
README updates, add @harikt PR #1, and some other adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancramerdesign committed Mar 11, 2016
1 parent 002ae78 commit beb7b37
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 12 deletions.
11 changes: 1 addition & 10 deletions GoogleClientAPI.module
Expand Up @@ -30,14 +30,6 @@ class GoogleClientAPI extends WireData implements Module, ConfigurableModule {

const debug = false;

/**
* Name for log file
*
* @var string
*
*/
protected $logName = 'google-client';

/**
* Construct by setup of default config values
*
Expand Down Expand Up @@ -246,8 +238,7 @@ class GoogleClientAPI extends WireData implements Module, ConfigurableModule {
if(!$client) throw new WireException("The GoogleClientAPI module is not yet configured");
$service = new \Google_Service_Calendar($client);
} catch(\Exception $e) {
$this->log($e->getMessage());
$this->error($e->getMessage());
$this->error($e->getMessage(), Notice::log);
return false;
}

Expand Down
64 changes: 63 additions & 1 deletion README.md
@@ -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.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"hari/pw-module": "dev-master",
"hari/pw-module": "~1.0",
"google/apiclient": "^2.0.0@RC"
}
}

0 comments on commit beb7b37

Please sign in to comment.