/** * Formats the information that needs to go in the 'Requires' column. * @param plugininfo_base $plugin the plugin we are rendering the row for. * @param plugin_manager $pluginman provides data on all the plugins. * @param string $version * @return string HTML code */ protected function required_column(plugininfo_base $plugin, plugin_manager $pluginman, $version) { $requires = array(); if (!empty($plugin->versionrequires)) { $required = get_string('moodleversion', 'core_plugin', $plugin->versionrequires); if ($plugin->versionrequires > $version) { $required = label::important($required); } $requires[] = html::li($required); } foreach ($plugin->get_other_required_plugins() as $component => $requiredversion) { $ok = true; $otherplugin = $pluginman->get_plugin_info($component); if (is_null($otherplugin)) { $ok = false; } else { if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) { $ok = false; } } if ($requiredversion != ANY_VERSION) { $required = get_string('otherpluginversion', 'core_plugin', array('component' => $component, 'version' => $requiredversion)); } else { $required = get_string('otherplugin', 'core_plugin', array('component' => $component, 'version' => $requiredversion)); } if (!$ok) { $required = label::important($required); } $requires[] = html::li($required); } if (!$requires) { return ''; } return html::ul('unstyled', $requires); }