本文整理汇总了PHP中webservice::delete_service方法的典型用法代码示例。如果您正苦于以下问题:PHP webservice::delete_service方法的具体用法?PHP webservice::delete_service怎么用?PHP webservice::delete_service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webservice
的用法示例。
在下文中一共展示了webservice::delete_service方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: webservice
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$webservicemanager = new webservice();
$renderer = $PAGE->get_renderer('core', 'webservice');
$returnurl = $CFG->wwwroot . "/" . $CFG->admin . "/settings.php?section=externalservices";
$service = $id ? $webservicemanager->get_external_service_by_id($id, MUST_EXIST) : null;
/// DELETE operation
if ($action == 'delete' and confirm_sesskey() and $service and empty($service->component)) {
//Display confirmation Page
if (!$confirm) {
echo $OUTPUT->header();
echo $renderer->admin_remove_service_confirmation($service);
echo $OUTPUT->footer();
die;
}
//The user has confirmed the deletion, delete and redirect
$webservicemanager->delete_service($service->id);
add_to_log(SITEID, 'webservice', 'delete', $returnurl, get_string('deleteservice', 'webservice', $service));
redirect($returnurl);
}
/// EDIT/CREATE/CANCEL operations => at the end redirect to add function page / main service page
$mform = new external_service_form(null, $service);
if ($mform->is_cancelled()) {
redirect($returnurl);
} else {
if ($servicedata = $mform->get_data()) {
$servicedata = (object) $servicedata;
if (!empty($servicedata->requiredcapability) && $servicedata->requiredcapability == "norequiredcapability") {
$servicedata->requiredcapability = "";
}
//create operation
if (empty($servicedata->id)) {