Skip to content

Commit

Permalink
Renewed old get_plugin_list
Browse files Browse the repository at this point in the history
  • Loading branch information
kordan committed Nov 8, 2024
1 parent b214dca commit 23d0a18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions adminlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function search($query) {

$found = false;

foreach (core_component::get_plugin_list($this->subtype) as $name => $unused) {
foreach (\core_component::get_plugin_list($this->subtype) as $name => $unused) {
if (strpos(strtolower(get_string('pluginname', $this->subtype.'_'.$name)), $query) !== false) {
$found = true;
break;
Expand Down Expand Up @@ -123,7 +123,7 @@ public function __construct($subtype) {
* @return array The list of plugins
*/
public function get_sorted_plugins_list() {
$names = core_component::get_plugin_list($this->subtype);
$names = \core_component::get_plugin_list($this->subtype);

$result = [];

Expand Down
2 changes: 1 addition & 1 deletion classes/output/action_bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public function draw_reports_action_bar(): string {
$canaccessownreports = has_capability('mod/surveypro:accessownreports', $this->context);
$canalwaysseeowner = has_capability('mod/surveypro:alwaysseeowner', $this->context);

if ($surveyproreportlist = get_plugin_list('surveyproreport')) {
if ($surveyproreportlist = \core_component::get_plugin_list('surveyproreport')) {
foreach ($surveyproreportlist as $reportname => $reportpath) {
$classname = 'surveyproreport_'.$reportname.'\report';
$reportman = new $classname($this->cm, $this->context, $this->surveypro);
Expand Down
2 changes: 1 addition & 1 deletion classes/view_cover.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function display_cover() {
}

// Begin of: report section.
$surveyproreportlist = get_plugin_list('surveyproreport');
$surveyproreportlist = \core_component::get_plugin_list('surveyproreport');
$paramurl = ['s' => $this->cm->instance, 'area' => 'reports', 'section' => 'apply'];

foreach ($surveyproreportlist as $reportname => $pluginpath) {
Expand Down
10 changes: 5 additions & 5 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ function surveypro_get_first_allowed_report() {
$return = '';
$context = \context_module::instance($cm->id);
$surveypro = $DB->get_record('surveypro', ['id' => $cm->instance], '*', MUST_EXIST);
if ($surveyproreportlist = get_plugin_list('surveyproreport')) {
if ($surveyproreportlist = \core_component::get_plugin_list('surveyproreport')) {
foreach ($surveyproreportlist as $reportname => $reportpath) {
$classname = 'surveyproreport_'.$reportname.'\report';
$reportman = new $classname($cm, $context, $surveypro);
Expand Down Expand Up @@ -1151,9 +1151,9 @@ function surveypro_get_plugin_list($plugintype=null, $includetype=false, $count=

if ($plugintype == SURVEYPRO_TYPEFIELD || is_null($plugintype)) {
if ($count) {
$plugincount += count(get_plugin_list('surveypro'.SURVEYPRO_TYPEFIELD));
$plugincount += count(\core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFIELD));
} else {
$fieldplugins = core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFIELD);
$fieldplugins = \core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFIELD);
if (!empty($includetype)) {
foreach ($fieldplugins as $k => $v) {
if (!get_config('surveyprofield_'.$k, 'disabled')) {
Expand All @@ -1176,9 +1176,9 @@ function surveypro_get_plugin_list($plugintype=null, $includetype=false, $count=
}
if ($plugintype == SURVEYPRO_TYPEFORMAT || is_null($plugintype)) {
if ($count) {
$plugincount += count(core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFORMAT));
$plugincount += count(\core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFORMAT));
} else {
$formatplugins = core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFORMAT);
$formatplugins = \core_component::get_plugin_list('surveypro'.SURVEYPRO_TYPEFORMAT);
if (!empty($includetype)) {
foreach ($formatplugins as $k => $v) {
if (!get_config('surveyproformat_'.$k, 'disabled')) {
Expand Down

0 comments on commit 23d0a18

Please sign in to comment.