本文整理汇总了PHP中Tsugi\Core\LTIX::postGet方法的典型用法代码示例。如果您正苦于以下问题:PHP LTIX::postGet方法的具体用法?PHP LTIX::postGet怎么用?PHP LTIX::postGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tsugi\Core\LTIX
的用法示例。
在下文中一共展示了LTIX::postGet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lmsDie
// Sanity checks
$LTI = LTIX::requireData();
$p = $CFG->dbprefix;
$OUTPUT->header();
$OUTPUT->bodyStart();
$OUTPUT->flashMessages();
$OUTPUT->welcomeUserCourse();
if (!$USER->instructor) {
echo "<p>This tool must be launched by the instructor</p>";
$OUTPUT->footer();
exit;
}
// See https://canvas.instructure.com/doc/api/file.link_selection_tools.html
// Needed return values
$content_return_types = LTIX::postGet("ext_content_return_types", false);
$content_return_url = LTIX::postGet("ext_content_return_url", false);
if (strlen($content_return_url) < 1) {
lmsDie("Missing ext_content_return_url");
}
if (strpos($content_return_types, "lti_launch_url") === false) {
lmsDie("This tool requires ext_content_return_types=lti_launch_url");
}
// Scan the tools folders for registration settings
$tools = findFiles("register.php", "../");
if (count($tools) < 1) {
lmsDie("No register.php files found...<br/>\n");
}
echo "<ul>\n";
$toolcount = 0;
foreach ($tools as $tool) {
$path = str_replace("../", "", $tool);
示例2: isset
if ($fa_icon) {
echo '<i class="fa ' . $fa_icon . ' fa-3x" style="color: #1894C7; float:right; margin: 2px"></i>';
}
echo '<center>';
echo "<h1>" . htmlent_utf8($title) . "</h1>\n";
echo "<p>" . htmlent_utf8($text) . "</p>\n";
$script = isset($REGISTER_LTI2['script']) ? $REGISTER_LTI2['script'] : "index.php";
$path = $CFG->wwwroot . '/' . str_replace("register.php", $script, $path);
// Title is for the href and text is for display
$json = LTI::getLtiLinkJSON($path, $title, $title, false, $fa_icon);
$retval = json_encode($json);
$parms = array();
$parms["lti_message_type"] = "ContentItemSelection";
$parms["lti_version"] = "LTI-1p0";
$parms["content_items"] = $retval;
$data = LTIX::postGet('data');
if ($data) {
$parms['data'] = $data;
}
$parms = LTIX::signParameters($parms, $result_url, "POST", "Install Tool");
$endform = '<a href="index.php" class="btn btn-warning">Back to Store</a>';
$content = LTI::postLaunchHTML($parms, $result_url, true, false, $endform);
echo $content;
} else {
echo '<div style="border: 2px, solid, red;" class="card">';
if ($fa_icon) {
echo '<a href="index.php?install=' . urlencode($tool) . '">';
echo '<i class="fa ' . $fa_icon . ' fa-2x" style="color: #1894C7; float:right; margin: 2px"></i>';
echo '</a>';
}
echo '<p><strong>' . htmlent_utf8($title) . "</strong></p>";
示例3: caliperSend
/**
* Send a Caliper Body to the correct URL using the key and secret
*
* This is not yet a standard or production - it uses the Canvas
* extension only.
*
*/
public static function caliperSend($caliperBody, $content_type = 'application/json', &$debug_log = false)
{
$caliperURL = LTIX::postGet('custom_sub_canvas_caliper_url');
if (strlen($caliperURL) == 0) {
if (is_array($debug_log)) {
$debug_log[] = array('custom_sub_canvas_caliper_url not found in launch data');
}
return false;
}
$key_key = self::sessionGet('key_key');
$secret = self::sessionGet('secret');
$retval = LTI::sendJSONBody("POST", $caliperBody, $content_type, $caliperURL, $key_key, $secret, $debug_log);
return $retval;
}
示例4: header
//.........这里部分代码省略.........
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php
echo $CFG->servicename;
if (isset($CFG->context_title)) {
echo ' - ' . $CFG->context_title;
}
?>
</title>
<!-- Le styles -->
<link href="<?php
echo $CFG->staticroot;
?>
/bootstrap-3.1.1/css/<?php
if (isset($CFG->bootswatch)) {
echo 'bootswatch/' . $CFG->bootswatch . '/';
}
?>
bootstrap.min.css" rel="stylesheet">
<link href="<?php
echo $CFG->staticroot;
?>
/js/jquery-ui-1.11.4/jquery-ui.min.css" rel="stylesheet">
<link href="<?php
echo $CFG->staticroot;
?>
/font-awesome-4.4.0/css/font-awesome.min.css" rel="stylesheet">
<script src="<?php
echo $CFG->staticroot;
?>
/js/tsugiscripts_head.js"></script>
<style>
body {
padding-top: 10px;
padding-bottom: 10px;
}
.navbar {
margin-bottom: 20px;
}
.container_iframe {
margin-left: 10px;
margin-right: 10px;
}
</style>
<?php
// https://lefkomedia.com/adding-external-link-indicator-with-css/
if ($CFG->google_translate) {
?>
<style>
a[target="_blank"]:after {
font-family: "FontAwesome";
content: " \f08e";
}
.goog-te-banner-frame.skiptranslate {
display: none !important;
}
body {
top: 0px !important;
}
</style>
<?php
}
?>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="<?php
echo $CFG->vendorstatic;
?>
/js/html5shiv/html5shiv.js"></script>
<script src="<?php
echo $CFG->vendorstatic;
?>
/js/respond/respond.min.js"></script>
<![endif]-->
<?php
if (isset($_SESSION['CSRF_TOKEN'])) {
echo '<script type="text/javascript">CSRF_TOKEN = "' . $_SESSION['CSRF_TOKEN'] . '";</script>' . "\n";
} else {
echo '<script type="text/javascript">CSRF_TOKEN = "TODORemoveThis";</script>' . "\n";
}
// Set the containing frame id is we have one
$element_id = LTIX::postGet('ext_lti_element_id', false);
if ($element_id) {
echo '<script type="text/javascript">LTI_PARENT_IFRAME_ID = "' . $element_id . '";</script>' . "\n";
}
if (isset($_SESSION['APP_HEADER'])) {
echo $_SESSION['APP_HEADER'];
}
$HEAD_CONTENT_SENT = true;
}