/**
* Event plugin
*
- * @category Sample
+ * @category Event
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @copyright 2011 StatusNet, Inc.
case 'CancelrsvpAction':
case 'ShoweventAction':
case 'ShowrsvpAction':
+ case 'TimelistAction':
include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
return false;
case 'EventListItem':
case 'EventForm':
case 'RSVPForm':
case 'CancelRSVPForm':
+ case 'EventTimeList':
include_once $dir . '/'.strtolower($cls).'.php';
break;
case 'Happening':
$m->connect('rsvp/:id',
array('action' => 'showrsvp'),
array('id' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'));
+ $m->connect('main/event/updatetimes',
+ array('action' => 'timelist'));
return true;
}
function saveNoticeFromActivity($activity, $actor, $options=array())
{
if (count($activity->objects) != 1) {
- throw new Exception(_('Too many activity objects.'));
+ // TRANS: Exception thrown when there are too many activity objects.
+ throw new Exception(_m('Too many activity objects.'));
}
$happeningObj = $activity->objects[0];
switch ($activity->verb) {
case ActivityVerb::POST:
+ // FIXME: get startTime, endTime, location and URL
$notice = Happening::saveNew($actor,
- $start_time,
- $end_time,
- $happeningObj->title,
- null,
- $happeningObj->summary,
- $options);
+ $start_time,
+ $end_time,
+ $happeningObj->title,
+ null,
+ $happeningObj->summary,
+ null,
+ $options);
break;
case RSVP::POSITIVE:
case RSVP::NEGATIVE:
array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
common_date_iso8601($happening->end_time));
+ // FIXME: add location
+ // FIXME: add URL
+
// XXX: probably need other stuff here
return $obj;
function onEndShowScripts($action)
{
- $action->inlineScript('$(document).ready(function() { $("#event-startdate").datepicker(); $("#event-enddate").datepicker(); });');
+ $action->script($this->path('event.js'));
}
function onEndShowStyles($action)