Skip to content

Commit

Permalink
MDL-62535 tool_dataprivacy: Registry shows deprecated interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
abgreeve committed Aug 20, 2018
1 parent 4c6781f commit 4905daf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions admin/tool/dataprivacy/classes/metadata_registry.php
Expand Up @@ -76,6 +76,16 @@ public function get_registry_metadata() {
if (isset($contributedplugins[$plugintype][$shortname])) {
$internaldata['external'] = true;
}

// Check if the interface is deprecated.
if (!$manager->is_empty_subsystem($component)) {
$classname = $manager->get_provider_classname_for_component($component);
$componentclass = new $classname();
if ($componentclass instanceof \core_privacy\local\deprecated) {
$internaldata['deprecated'] = true;
}
}

return $internaldata;
}, $leaves['plugins']);
$fullyrichtree[$branch]['plugin_type_raw'] = $plugintype;
Expand Down
2 changes: 2 additions & 0 deletions admin/tool/dataprivacy/lang/en/tool_dataprivacy.php
Expand Up @@ -85,6 +85,8 @@
$string['defaultssaved'] = 'Defaults saved';
$string['deny'] = 'Deny';
$string['denyrequest'] = 'Deny request';
$string['deprecated'] = 'Deprecated';
$string['deprecatedexplanation'] = 'This plugin is using an old version of one of the privacy interfaces and should be updated.';
$string['download'] = 'Download';
$string['dporolemapping'] = 'Privacy officer role mapping';
$string['dporolemapping_desc'] = 'The privacy officer can manage data requests. The capability tool/dataprivacy:managedatarequests must be allowed for a role to be listed as a privacy officer role mapping option.';
Expand Down
3 changes: 3 additions & 0 deletions admin/tool/dataprivacy/templates/component_status.mustache
Expand Up @@ -61,6 +61,9 @@
{{#external}}
<span class="badge badge-pill badge-notice">{{#str}}external, tool_dataprivacy{{/str}}</span>
{{/external}}
{{#deprecated}}
<span class="badge badge-pill badge-warning">{{#str}}deprecated, tool_dataprivacy{{/str}}</span>
{{/deprecated}}
</div>

{{#compliant}}
Expand Down
Expand Up @@ -45,6 +45,8 @@
<dd>{{#str}}requiresattentionexplanation, tool_dataprivacy{{/str}}</dd>
<dt><span class="badge badge-pill badge-notice">{{#str}}external, tool_dataprivacy{{/str}}</span></dt>
<dd>{{#str}}externalexplanation, tool_dataprivacy{{/str}}</dd>
<dt><span class="badge badge-pill badge-warning">{{#str}}deprecated, tool_dataprivacy{{/str}}</span></dt>
<dd>{{#str}}deprecatedexplanation, tool_dataprivacy{{/str}}</dd>
</dl>
<hr />
<div class="clearfix"><a class="tool_dataprivacy-expand-all pull-right" href="#" data-visibility-state='visible'>{{#str}}visible, tool_dataprivacy{{/str}}</a></div>
Expand Down

0 comments on commit 4905daf

Please sign in to comment.