X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FEvent%2FEventPlugin.php;h=7f95bd79550327fb572152a410021f30a2e13849;hb=bc8e114b375bbe378440f2d33ea2577efade95b6;hp=c1c8ec77c3365da82e24c1aac72f58e82708dfce;hpb=3f9a16dc587b86b8912bc5a00dd1800c6475f73d;p=quix0rs-gnu-social.git diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index c1c8ec77c3..7f95bd7955 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -44,7 +44,7 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ -class EventPlugin extends MicroappPlugin +class EventPlugin extends MicroAppPlugin { /** * Set up our tables (event and rsvp) @@ -67,11 +67,11 @@ class EventPlugin extends MicroappPlugin /** * Map URLs to actions * - * @param Net_URL_Mapper $m path-to-action mapper + * @param URLMapper $m path-to-action mapper * * @return boolean hook value; true means continue processing, false means stop. */ - function onRouterInitialized($m) + function onRouterInitialized(URLMapper $m) { $m->connect('main/event/new', array('action' => 'newevent')); @@ -90,7 +90,7 @@ class EventPlugin extends MicroappPlugin return true; } - function onPluginVersion(&$versions) + function onPluginVersion(array &$versions) { $versions[] = array('name' => 'Event', 'version' => GNUSOCIAL_VERSION, @@ -128,7 +128,7 @@ class EventPlugin extends MicroappPlugin * * @return Notice the resulting notice */ - function saveNoticeFromActivity($activity, $actor, $options=array()) + function saveNoticeFromActivity(Activity $activity, Profile $actor, array $options=array()) { if (count($activity->objects) != 1) { // TRANS: Exception thrown when there are too many activity objects. @@ -182,7 +182,7 @@ class EventPlugin extends MicroappPlugin * * @return ActivityObject */ - function activityObjectFromNotice($notice) + function activityObjectFromNotice(Notice $notice) { $happening = null; @@ -243,12 +243,12 @@ class EventPlugin extends MicroappPlugin * * @return ActivityObject */ - function onEndNoticeAsActivity($notice, &$act) { - switch ($notice->object_type) { + protected function extendActivity(Notice $stored, Activity $act, Profile $scoped=null) { + switch ($stored->object_type) { case RSVP::POSITIVE: case RSVP::NEGATIVE: case RSVP::POSSIBLE: - $act->verb = $notice->object_type; + $act->verb = $stored->object_type; break; } return true; @@ -288,30 +288,30 @@ class EventPlugin extends MicroappPlugin * * @param Notice $notice */ - function deleteRelated($notice) + function deleteRelated(Notice $notice) { switch ($notice->object_type) { case Happening::OBJECT_TYPE: - common_log(LOG_DEBUG, "Deleting event from notice..."); + common_debug("Deleting event from notice..."); $happening = Happening::fromNotice($notice); $happening->delete(); break; case RSVP::POSITIVE: case RSVP::NEGATIVE: case RSVP::POSSIBLE: - common_log(LOG_DEBUG, "Deleting rsvp from notice..."); + common_debug("Deleting rsvp from notice..."); $rsvp = RSVP::fromNotice($notice); - common_log(LOG_DEBUG, "to delete: $rsvp->id"); + common_debug("to delete: $rsvp->id"); $rsvp->delete(); break; default: - common_log(LOG_DEBUG, "Not deleting related, wtf..."); + common_debug("Not deleting related, wtf..."); } } function onEndShowScripts($action) { - $action->script($this->path('event.js')); + $action->script($this->path('js/event.js')); } function onEndShowStyles($action)