Commit e3bd0f73 authored by Marina Glancy's avatar Marina Glancy
Browse files

MDL-29717 core_webservice: Display deprecated badge in API docs

parent 5500d143
......@@ -59,6 +59,7 @@ $string['deleteservice'] = 'Delete the service: {$a->name} (id: {$a->id})';
$string['deleteserviceconfirm'] = 'Deleting a service will also delete the tokens related to this service. Do you really want to delete external service "{$a}"?';
$string['deletetoken'] = 'Delete token';
$string['deletetokenconfirm'] = 'Do you really want to delete this web service token for <strong>{$a->user}</strong> on the service <strong>{$a->service}</strong>?';
$string['deprecated'] = 'Deprecated';
$string['disabledwarning'] = 'All web service protocols are disabled. The "Enable web services" setting can be found in Advanced features.';
$string['doc'] = 'Documentation';
$string['docaccessrefused'] = 'You are not allowed to see the documentation for this token';
......
......@@ -658,16 +658,21 @@ EOF;
//(opened if printableformat = true)
foreach ($functions as $functionname => $description) {
$tags = '';
if (!empty($description->deprecated)) {
$tags .= ' ' . html_writer::span(get_string('deprecated', 'core_webservice'), 'badge badge-warning');
}
if (empty($printableformat)) {
$documentationhtml .= print_collapsible_region_start('',
'aera_' . $functionname,
html_writer::start_tag('strong', array())
. $functionname . html_writer::end_tag('strong'),
. $functionname . html_writer::end_tag('strong') . $tags,
false,
!$printableformat,
true);
} else {
$documentationhtml .= html_writer::tag('strong', $functionname);
$documentationhtml .= html_writer::tag('strong', $functionname) . $tags;
$documentationhtml .= $br;
}
......
Supports Markdown
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