MDL-48107 tool_monitor: added total subs to the delete rule string

Also made some minor language string changes.
This commit is contained in:
Mark Nelson
2014-11-08 00:26:56 -08:00
parent 17cc9fcd84
commit cbc4ecc7f9
2 changed files with 11 additions and 6 deletions
+5 -4
View File
@@ -82,7 +82,8 @@ $string['norules'] = 'There are no event monitoring rules.';
$string['pluginname'] = 'Event monitor';
$string['processevents'] = 'Process events';
$string['rulename'] = 'Rule name';
$string['ruleareyousure'] = 'Are you sure you want to delete rule "{$a}"?';
$string['ruleareyousure'] = 'Are you sure you want to delete the rule "{$a}"?';
$string['ruleareyousureextra'] = 'There are {$a} subscription(s) to this rule that will also be deleted.';
$string['rulecopysuccess'] = 'Rule successfully duplicated';
$string['ruledeletesuccess'] = 'Rule successfully deleted';
$string['rulehelp'] = 'Rule details';
@@ -91,9 +92,9 @@ $string['rulenopermissions'] = 'You do not have permissions to "{$a} a rule"';
$string['rulescansubscribe'] = 'Rules you can subscribe to';
$string['selectacourse'] = 'Select a course';
$string['selectcourse'] = 'Visit this report at course level to get a list of possible modules';
$string['subareyousure'] = 'Are you sure you want to delete this subscription for the rule "{$a}"?';
$string['subcreatesuccess'] = "Subscription successfully created";
$string['subdeletesuccess'] = "Subscription successfully removed";
$string['subareyousure'] = 'Are you sure you want to delete the subscription to the rule "{$a}"?';
$string['subcreatesuccess'] = 'Subscription successfully created';
$string['subdeletesuccess'] = 'Subscription successfully removed';
$string['subhelp'] = 'Subscription details';
$string['subhelp_help'] = 'This subscription listens for when the event \'{$a->eventname}\' has been triggered in \'{$a->moduleinstance}\' {$a->frequency} time(s) in {$a->minutes} minute(s).';
$string['subscribeto'] = 'Subscribe to rule "{$a}"';
+6 -2
View File
@@ -94,8 +94,12 @@ if (!empty($action) && $ruleid) {
$rule->delete_rule();
echo $OUTPUT->notification(get_string('ruledeletesuccess', 'tool_monitor'), 'notifysuccess');
} else {
echo $OUTPUT->confirm(get_string('ruleareyousure', 'tool_monitor', $rule->get_name($context)),
$confirmurl, $cancelurl);
$strconfirm = get_string('ruleareyousure', 'tool_monitor', $rule->get_name($context));
if ($numberofsubs = $DB->count_records('tool_monitor_subscriptions', array('ruleid' => $ruleid))) {
$strconfirm .= '<br />';
$strconfirm .= get_string('ruleareyousureextra', 'tool_monitor', $numberofsubs);
}
echo $OUTPUT->confirm($strconfirm, $confirmurl, $cancelurl);
echo $OUTPUT->footer();
exit();
}