Skip to content

Instantly share code, notes, and snippets.

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
@jleyva
jleyva / moodle.org.css
Last active August 29, 2015 14:03
Moodle.org Mobile CSS URL
body {
color: #595959;
background: #f98012;
}
a {
color: #0070a8;
}
h1 {
color: #f98012;
}
body {
color: #666666; /*default*/
background: #4bcaff;
}
a {
color: #0088cc; /*default*/
}
h1 {
color: #4bcaff;
}
<?php
/// SETUP - NEED TO BE CHANGED
$token = '689f261a74ff51d54b01c4da8921ca83';
$domainname = 'http://localhost/moodlebugs';
$functionname = 'mod_forum_get_forum_discussions';
// REST RETURNED VALUES FORMAT
$restformat = 'json'; //Also possible in Moodle 2.2 and later: 'json'
var requires = [
"root/externallib/text!root/plugins/notifications/notifications.html",
"root/externallib/text!root/plugins/notifications/notification.html",
"root/externallib/text!root/plugins/notifications/notifications_enable.html",
"root/externallib/text!root/plugins/notifications/notification_alert.html",
"root/externallib/text!root/plugins/notifications/notifications_full.html"
];
define(requires, function (notifsTpl, notifTpl, notifsEnableTpl, notifAlert, notifFullTpl) {
MM.fs.getDirectory = function(path, createIfNotFound, successCallback, errorCallBack, dirEntry) {
MM.fs.loadFS(function() {
path = path.replace('file:///', '');
var baseRoot = MM.fs.fileSystemRoot;
if (dirEntry) {
baseRoot = dirEntry;
}
<?php
// This file is NOT a part of Moodle - http://moodle.org/
//
// This client for Moodle 2 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
/**
@jleyva
jleyva / message_airnotifier.php
Last active August 29, 2015 14:06
Message airnotifier send_message callback
<?php
public function send_message($eventdata) {
global $CFG;
require_once($CFG->libdir . '/filelib.php');
if (!empty($CFG->noemailever)) {
// Hidden setting for development sites, set in config.php if needed.
debugging('$CFG->noemailever active, no airnotifier message sent.', DEBUG_MINIMAL);
return true;
}
@jleyva
jleyva / index.php
Created September 15, 2014 12:04
MDL-47163
<?php
/**
* Notification REST service for testing Airnotifier V2
*/
$body = file_get_contents('php://input');
$data = json_decode($body);
if (!$data) {
@jleyva
jleyva / test.php
Created October 3, 2014 09:04
function test_custom_parameter()
public function test_custom_parameter() {
global $DB, $SITE, $USER;
$custom1 = 'a=one;b=two;three=3';
$custom2 = "a=one\nb=two\nthree=3";
$this->resetAfterTest(true);
$ltigenerator = $this->getDataGenerator()->get_plugin_generator('mod_lti');