当前位置: 首页>>代码示例>>PHP>>正文


PHP webservice::delete_service方法代码示例

本文整理汇总了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)) {
开发者ID:JP-Git,项目名称:moodle,代码行数:31,代码来源:service.php


注:本文中的webservice::delete_service方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。