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>"; echo '<p>' . htmlent_utf8($text) . "</p>\n"; echo '<center><a href="index.php?install=' . urlencode($tool) . '" class="btn btn-default" role="button">Details</a></center>'; echo "</div>\n"; }