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


PHP lti_delete_type函数代码示例

本文整理汇总了PHP中lti_delete_type函数的典型用法代码示例。如果您正苦于以下问题:PHP lti_delete_type函数的具体用法?PHP lti_delete_type怎么用?PHP lti_delete_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了lti_delete_type函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: if

} else if ($form->is_cancelled()) {
    $script = "
        <html>
            <script type=\"text/javascript\">
                window.close();
            </script>
        </html>
    ";

    echo $script;
    die;
}

// Delete action is called via ajax.
if ($action == 'delete') {
    lti_delete_type($typeid);
    die;
}

echo $OUTPUT->header();

echo $OUTPUT->heading(get_string('toolsetup', 'lti'));

if ($action == 'add') {
    $form->display();
} else if ($action == 'edit') {
    $type = lti_get_type_type_config($typeid);
    $form->set_data($type);
    $form->display();
}
开发者ID:jtibbetts,项目名称:moodle,代码行数:30,代码来源:instructor_edit_tool_type.php

示例2: redirect

        redirect($redirect);
    }

} else if (isset($data->cancel)) {
    redirect($redirect);

} else if ($action == 'accept') {
    lti_set_state_for_type($id, LTI_TOOL_STATE_CONFIGURED);
    redirect($redirect);

} else if ($action == 'reject') {
    lti_set_state_for_type($id, LTI_TOOL_STATE_REJECTED);
    redirect($redirect);

} else if ($action == 'delete') {
    lti_delete_type($id);
    redirect($redirect);
}

// print header stuff
$PAGE->set_focuscontrol($focus);
if (empty($SITE->fullname)) {
    $PAGE->set_title($settingspage->visiblename);
    $PAGE->set_heading($settingspage->visiblename);

    $PAGE->navbar->add(get_string('lti_administration', 'lti'), $CFG->wwwroot.'/admin/settings.php?section=modsettinglti');

    echo $OUTPUT->header();

    echo $OUTPUT->box(get_string('configintrosite', 'admin'));
开发者ID:nicusX,项目名称:moodle,代码行数:30,代码来源:typessettings.php

示例3: delete_tool_type

 /**
  * Delete a tool type.
  *
  * @param int $id The id of the tool type to be deleted
  * @return array deleted tool type
  * @since Moodle 3.1
  * @throws moodle_exception
  */
 public static function delete_tool_type($id)
 {
     $params = self::validate_parameters(self::delete_tool_type_parameters(), array('id' => $id));
     $id = $params['id'];
     $context = context_system::instance();
     self::validate_context($context);
     require_capability('moodle/site:config', $context);
     $type = lti_get_type($id);
     if (!empty($type)) {
         lti_delete_type($id);
         // If this is the last type for this proxy then remove the proxy
         // as well so that it isn't orphaned.
         $types = lti_get_lti_types_from_proxy_id($type->toolproxyid);
         if (empty($types)) {
             lti_delete_tool_proxy($type->toolproxyid);
         }
     }
     return array('id' => $id);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:27,代码来源:external.php

示例4: lti_delete_tool_proxy

/**
 * Delete a Tool Proxy
 *
 * @param int $id   Tool Proxy id
 */
function lti_delete_tool_proxy($id)
{
    global $DB;
    $DB->delete_records('lti_tool_settings', array('toolproxyid' => $id));
    $tools = $DB->get_records('lti_types', array('toolproxyid' => $id));
    foreach ($tools as $tool) {
        lti_delete_type($tool->id);
    }
    $DB->delete_records('lti_tool_proxies', array('id' => $id));
}
开发者ID:reconnectmedia,项目名称:moodle,代码行数:15,代码来源:locallib.php

示例5: pearsondirect_handle_code_change

function pearsondirect_handle_code_change($courseconfig, $newcode, $newparams)
{
    global $DB, $CFG;
    require_once $CFG->dirroot . '/mod/lti/locallib.php';
    require_once $CFG->dirroot . '/course/lib.php';
    $types = $DB->get_records('lti_types', array('course' => $courseconfig->course));
    if ($types) {
        foreach ($types as $type) {
            if (!strncmp($type->tooldomain, 'pearson:', strlen('pearson:'))) {
                lti_delete_type($type->id);
            }
        }
    }
    $coursemodules = $DB->get_records('course_modules', array('course' => $courseconfig->course, 'module' => pearsondirect_get_lti_module()));
    if ($coursemodules) {
        foreach ($coursemodules as $cm) {
            if (!strncmp($cm->idnumber, 'pearson:', strlen('pearson:'))) {
                course_delete_module($cm->id);
            }
        }
    }
}
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:22,代码来源:locallib.php


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