本文整理汇总了PHP中core_plugin_manager::is_remote_plugin_installable方法的典型用法代码示例。如果您正苦于以下问题:PHP core_plugin_manager::is_remote_plugin_installable方法的具体用法?PHP core_plugin_manager::is_remote_plugin_installable怎么用?PHP core_plugin_manager::is_remote_plugin_installable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_plugin_manager
的用法示例。
在下文中一共展示了core_plugin_manager::is_remote_plugin_installable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugin_available_update_info
/**
* Helper method to render the information about the available plugin update
*
* @param core_plugin_manager $pluginman plugin manager instance
* @param \core\update\info $updateinfo information about the available update for the plugin
*/
protected function plugin_available_update_info(core_plugin_manager $pluginman, \core\update\info $updateinfo)
{
$boxclasses = 'pluginupdateinfo';
$info = array();
if (isset($updateinfo->release)) {
$info[] = html_writer::div(get_string('updateavailable_release', 'core_plugin', $updateinfo->release), 'info release');
}
if (isset($updateinfo->maturity)) {
$info[] = html_writer::div(get_string('maturity' . $updateinfo->maturity, 'core_admin'), 'info maturity');
$boxclasses .= ' maturity' . $updateinfo->maturity;
}
if (isset($updateinfo->download)) {
$info[] = html_writer::div(html_writer::link($updateinfo->download, get_string('download')), 'info download');
}
if (isset($updateinfo->url)) {
$info[] = html_writer::div(html_writer::link($updateinfo->url, get_string('updateavailable_moreinfo', 'core_plugin')), 'info more');
}
$box = html_writer::start_div($boxclasses);
$box .= html_writer::div(get_string('updateavailable', 'core_plugin', $updateinfo->version), 'version');
$box .= html_writer::div(implode(html_writer::span(' ', 'separator'), $info), 'infos');
if ($pluginman->is_remote_plugin_installable($updateinfo->component, $updateinfo->version, $reason)) {
$box .= $this->output->single_button(new moodle_url($this->page->url, array('installupdate' => $updateinfo->component, 'installupdateversion' => $updateinfo->version)), get_string('updateavailableinstall', 'core_admin'), 'post', array('class' => 'singlebutton updateavailableinstall'));
} else {
$reasonhelp = $this->info_remote_plugin_not_installable($reason);
if ($reasonhelp) {
$box .= html_writer::div($reasonhelp, 'reasonhelp updateavailableinstall');
}
}
$box .= html_writer::end_div();
return $box;
}