Commit 121e9027 authored by Moises Burgos's avatar Moises Burgos
Browse files

Add new parameters to the get_activity_body function (Bug #1328729)



Change-Id: I178d811545ba527d3629491633042513a5b1c03d
Signed-off-by: default avatarMoises Burgos <moises.burgos@totaralms.com>
parent 821dcfee
......@@ -1352,7 +1352,7 @@ class ActivityTypeArtefactCommentFeedback extends ActivityTypePlugin implements
return 'comment';
}
public static function get_activity_body($activity) {
public static function get_activity_body($activity, $streamtype, $viewer, $owner, $group, $institution) {
$helperinfo = new stdClass();
$subactivity = $activity->subactivity[0];
......
......@@ -80,7 +80,7 @@ class PluginBlocktypeActivitystream extends SystemBlocktype {
$classname = get_activity_type_classname($activity->activitytype);
$result = new stdClass();
// Activity details.
$result->body = $classname::get_activity_body($activity);
$result->body = $classname::get_activity_body($activity, $streamtype, $viewer, $owner, $group, $institution);
$result->ctime = relative_date(get_string('strftimerecentfullrelative', 'interaction.forum'),
get_string('strftimerecentfull'), $activity->subactivity[0]->ctime);
// Primary user (icon and name link).
......
......@@ -956,7 +956,17 @@ abstract class ActivityType {
*
*/
interface ActivityStreamable {
public static function get_activity_body($activity);
/**
* Get the content of the activity.
*
* @param object $activity
* @param string $streamtype
* @param int $viewer
* @param int $owner
* @param int $group
* @param int $institution
*/
public static function get_activity_body($activity, $streamtype, $viewer, $owner, $group, $institution);
}
/**
......@@ -1745,7 +1755,7 @@ class ActivityTypeViewAccess extends ActivityType implements ActivityStreamable
return get_string_from_language($user->lang, 'newviewaccessmessagenoowner', 'activity', $this->title);
}
public static function get_activity_body($activity) {
public static function get_activity_body($activity, $streamtype, $viewer, $owner, $group, $institution) {
$helperinfo = new stdClass();
$helperinfo->activity = $activity;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment