Exemplo n.º 1
0
     lmsDie("Missing required name, short_name, and description in " . $tool);
 }
 $title = $REGISTER_LTI2['name'];
 $text = $REGISTER_LTI2['description'];
 $fa_icon = isset($REGISTER_LTI2['FontAwesome']) ? $REGISTER_LTI2['FontAwesome'] : false;
 if ($install) {
     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">';