O'Reilly logo

Moodle 3.x Developer's Guide by Ian Wild

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying sections based on location

Recall that the location data is passed into PHP via a YUI callback--geo.php:

 /**  * GPS Format free. Restrict access to topics according to user's  geolocation.  *  * @package format_location  * @copyright 2013 Barry Oosthuizen  * @author Barry Oosthuizen  * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later  */ define('AJAX_SCRIPT', true);  require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php'); require_sesskey(); require_login();  $userlatitude = optional_param('latitude', null, PARAM_FLOAT); $userlongitude = optional_param('longitude', null, PARAM_FLOAT);  $location = new stdClass(); $location->userid = $USER->id; $location->latitude = $userlatitude; $location->longitude ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required