本文整理汇总了PHP中core_plugin_manager::get_uninstall_url方法的典型用法代码示例。如果您正苦于以下问题:PHP core_plugin_manager::get_uninstall_url方法的具体用法?PHP core_plugin_manager::get_uninstall_url怎么用?PHP core_plugin_manager::get_uninstall_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_plugin_manager
的用法示例。
在下文中一共展示了core_plugin_manager::get_uninstall_url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plugins_control_panel
//.........这里部分代码省略.........
$table->head = array(get_string('displayname', 'core_plugin'), get_string('version', 'core_plugin'), get_string('availability', 'core_plugin'), get_string('actions', 'core_plugin'), get_string('notes', 'core_plugin'));
$table->headspan = array(1, 1, 1, 2, 1);
$table->colclasses = array('pluginname', 'version', 'availability', 'settings', 'uninstall', 'notes');
foreach ($plugininfo as $type => $plugins) {
$heading = $pluginman->plugintype_name_plural($type);
$pluginclass = core_plugin_manager::resolve_plugininfo_class($type);
if ($manageurl = $pluginclass::get_manage_url()) {
$heading .= $this->output->action_icon($manageurl, new pix_icon('i/settings', get_string('settings', 'core_plugin')));
}
$header = new html_table_cell(html_writer::tag('span', $heading, array('id' => 'plugin_type_cell_' . $type)));
$header->header = true;
$header->colspan = array_sum($table->headspan);
$header = new html_table_row(array($header));
$header->attributes['class'] = 'plugintypeheader type-' . $type;
$table->data[] = $header;
if (empty($plugins)) {
$msg = new html_table_cell(get_string('noneinstalled', 'core_plugin'));
$msg->colspan = array_sum($table->headspan);
$row = new html_table_row(array($msg));
$row->attributes['class'] .= 'msg msg-noneinstalled';
$table->data[] = $row;
continue;
}
foreach ($plugins as $name => $plugin) {
$row = new html_table_row();
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name)) {
$icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
} else {
$icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
}
$status = $plugin->get_status();
$row->attributes['class'] .= ' status-' . $status;
$pluginname = html_writer::tag('div', $icon . $plugin->displayname, array('class' => 'displayname')) . html_writer::tag('div', $plugin->component, array('class' => 'componentname'));
$pluginname = new html_table_cell($pluginname);
$version = html_writer::div($plugin->versiondb, 'versionnumber');
if ((string) $plugin->release !== '') {
$version = html_writer::div($plugin->release, 'release') . $version;
}
$version = new html_table_cell($version);
$isenabled = $plugin->is_enabled();
if (is_null($isenabled)) {
$availability = new html_table_cell('');
} else {
if ($isenabled) {
$row->attributes['class'] .= ' enabled';
$availability = new html_table_cell(get_string('pluginenabled', 'core_plugin'));
} else {
$row->attributes['class'] .= ' disabled';
$availability = new html_table_cell(get_string('plugindisabled', 'core_plugin'));
}
}
$settingsurl = $plugin->get_settings_url();
if (!is_null($settingsurl)) {
$settings = html_writer::link($settingsurl, get_string('settings', 'core_plugin'), array('class' => 'settings'));
} else {
$settings = '';
}
$settings = new html_table_cell($settings);
if ($uninstallurl = $pluginman->get_uninstall_url($plugin->component, 'overview')) {
$uninstall = html_writer::link($uninstallurl, get_string('uninstall', 'core_plugin'));
} else {
$uninstall = '';
}
$uninstall = new html_table_cell($uninstall);
if ($plugin->is_standard()) {
$row->attributes['class'] .= ' standard';
$source = '';
} else {
$row->attributes['class'] .= ' extension';
$source = html_writer::div(get_string('sourceext', 'core_plugin'), 'source label label-info');
}
if ($status === core_plugin_manager::PLUGIN_STATUS_MISSING) {
$msg = html_writer::div(get_string('status_missing', 'core_plugin'), 'statusmsg label label-important');
} else {
if ($status === core_plugin_manager::PLUGIN_STATUS_NEW) {
$msg = html_writer::div(get_string('status_new', 'core_plugin'), 'statusmsg label label-success');
} else {
$msg = '';
}
}
$requriedby = $pluginman->other_plugins_that_require($plugin->component);
if ($requriedby) {
$requiredby = html_writer::tag('div', get_string('requiredby', 'core_plugin', implode(', ', $requriedby)), array('class' => 'requiredby'));
} else {
$requiredby = '';
}
$updateinfo = '';
if (is_array($plugin->available_updates())) {
foreach ($plugin->available_updates() as $availableupdate) {
$updateinfo .= $this->plugin_available_update_info($pluginman, $availableupdate);
}
}
$notes = new html_table_cell($source . $msg . $requiredby . $updateinfo);
$row->cells = array($pluginname, $version, $availability, $settings, $uninstall, $notes);
$table->data[] = $row;
}
}
return html_writer::table($table);
}