echo $self; ?> '; return false;"/> </p> </form> <?php exit; } $sql = "SELECT * FROM ads WHERE course_key=" . "'" . mysql_real_escape_string($context->getCourseKey()) . "' " . "ORDER BY created_at DESC"; $result = mysql_query($sql); $num_rows = mysql_num_rows($result); if ($message) { echo '<p style="color:red;">' . $message . "</p>\n"; } if (mysql_num_rows($result) == 0) { echo "<p>No Ads available for '" . $context->getCourseName() . "'"; echo ' (<a title="New Ad" href="' . $selfp . 'action=add">Create New Ad</a>)' . "\n"; } else { ?> <table style="width: 100%"> <tr><th style="width: 70%"> <?php $title = $context->getResourceTitle(); if ($title === false) { echo 'Title'; } else { echo $title; } ?> (<a title="New Ad" href="<?php
* * @file * @ingroup Extensions * @version 0.1 * @author Charles Severance based on for from Antoni Bertran and Jose Diago */ $going2MW = false; // BLTI integration require_once 'IMSBasicLTI/ims-blti/blti.php'; if (!is_basic_lti_request()) { return; } //Let's get the user's data $context = new BLTI("secret", false, false); if ($context->valid) { $agentCourse = $context->getCourseName(); $agentUserName = $context->getUserShortName(); $agentEmail = $context->getUserEmail(); $agentFullName = $context->getUserName(); $going2MW = true; session_start(); $_SESSION['BLTIclassroom'] = $agentCourse; } else { echo 'Error validating: ' . $context->message; } $context = null; if ($going2MW) { $myURI = $_SERVER['REQUEST_URI']; $newURI = str_replace("extensions/Redirect2CourseBLTI.php", "index.php", $myURI); $newParameters = "title=Category:{$agentCourse}&BLTIusername={$agentUserName}&BLTIemail={$agentEmail}&BLTIfullname={$agentFullName}&BLTI=yes"; $newURI = $newURI . "?" . $newParameters;