本文整理汇总了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();
}
示例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'));
示例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);
}
示例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));
}
示例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);
}
}
}
}