Skip to content

Commit

Permalink
Merge branch 'MDL-71953-behat' of git://github.com/HuongNV13/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Oct 21, 2021
2 parents 6863a92 + 1382607 commit 453db3d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions calendar/classes/external/event_exporter_base.php
Expand Up @@ -101,6 +101,19 @@ public function __construct(event_interface $event, $related = []) {
if ($cm = $event->get_course_module()) {
$data->modulename = $cm->get('modname');
$data->instance = $cm->get('id');
$data->activityname = $cm->get('name');

$component = 'mod_' . $data->modulename;
if (!component_callback_exists($component, 'core_calendar_get_event_action_string')) {
$modulename = get_string('modulename', $data->modulename);
$data->activitystr = get_string('requiresaction', 'calendar', $modulename);
} else {
$data->activitystr = component_callback(
$component,
'core_calendar_get_event_action_string',
[$event->get_type()]
);
}
}

parent::__construct($data, $related);
Expand Down Expand Up @@ -175,6 +188,18 @@ protected static function define_properties() {
'default' => null,
'null' => NULL_ALLOWED
],
'activityname' => [
'type' => PARAM_TEXT,
'optional' => true,
'default' => null,
'null' => NULL_ALLOWED
],
'activitystr' => [
'type' => PARAM_TEXT,
'optional' => true,
'default' => null,
'null' => NULL_ALLOWED
],
'instance' => [
'type' => PARAM_INT,
'optional' => true,
Expand Down

0 comments on commit 453db3d

Please sign in to comment.