--- /dev/null
+# Generated by "grunt ignorefiles"
+*/**/yui/src/*/meta/
+*/**/build/
+node_modules/
+vendor/
+auth/cas/CAS/
+auth/fc/fcFPP.php
+enrol/lti/ims-blti/
+filter/algebra/AlgParser.pm
+filter/tex/mimetex.*
+lib/editor/atto/yui/src/rangy/js/*.*
+lib/editor/tinymce/plugins/pdw/tinymce/
+lib/editor/tinymce/plugins/spellchecker/rpc.php
+lib/editor/tinymce/tiny_mce/
+lib/adodb/
+lib/alfresco/
+lib/bennu/
+lib/evalmath/
+lib/lessphp/
+lib/phpexcel/
+lib/pear/Net/
+lib/google/
+lib/htmlpurifier/
+lib/jabber/
+lib/minify/
+lib/flowplayer/
+lib/password_compat/
+lib/pear/Auth/RADIUS.php
+lib/pear/Crypt/CHAP.php
+lib/pear/HTML/Common.php
+lib/pear/HTML/QuickForm.php
+lib/pear/HTML/QuickForm/
+lib/pear/PEAR.php
+lib/phpmailer/
+lib/simplepie/
+lib/tcpdf/
+lib/typo3/
+lib/yuilib/
+lib/yuilib/gallery/
+lib/jquery/
+lib/html2text/
+lib/markdown/
+lib/recaptchalib.php
+lib/xhprof/
+lib/xmlize.php
+lib/horde/
+lib/requirejs/
+lib/amd/src/loglevel.js
+lib/mustache/
+lib/amd/src/mustache.js
+lib/graphlib.php
+lib/spout/
+mod/assign/feedback/editpdf/fpdi/
+repository/s3/S3.php
+theme/bootstrapbase/less/bootstrap/
+theme/bootstrapbase/javascript/html5shiv.js
+theme/bootstrapbase/amd/src/bootstrap.js
\ No newline at end of file
--- /dev/null
+{
+ 'env': {
+ 'browser': true,
+ 'amd': true
+ },
+ 'globals': {
+ 'M': true,
+ 'Y': true
+ },
+ 'rules': {
+ // See http://eslint.org/docs/rules/ for all rules and explanations of all
+ // rules. Commented out rules with 'DEFINE POLICY' are rules Dan P has flagged
+ // for discussion and possible enable soon.
+ // === Possible Errors ===
+ // DEFINE POLICY: 'comma-dangle': ['off', 'always'],
+ 'no-cond-assign': 'error',
+ 'no-console': 'error',
+ 'no-constant-condition': 'error',
+ 'no-control-regex': 'error',
+ 'no-debugger': 'error',
+ 'no-dupe-args': 'error',
+ 'no-dupe-keys': 'error',
+ 'no-duplicate-case': 'error',
+ // Disabled for YUI rollups, enabled by grunt for AMD: 'no-empty': 'error',
+ 'no-empty-character-class': 'error',
+ 'no-ex-assign': 'error',
+ 'no-extra-boolean-cast': 'error',
+ 'no-extra-parens': 'off',
+ 'no-extra-semi': 'error',
+ 'no-func-assign': 'error',
+ 'no-inner-declarations': 'error',
+ 'no-invalid-regexp': 'error',
+ 'no-irregular-whitespace': 'error',
+ 'no-negated-in-lhs': 'error',
+ 'no-obj-calls': 'error',
+ 'no-prototype-builtins': 'off',
+ 'no-regex-spaces': 'error',
+ 'no-sparse-arrays': 'error',
+ 'no-unexpected-multiline': 'error',
+ 'no-unreachable': 'warn',
+ 'no-unsafe-finally': 'error',
+ 'use-isnan': 'error',
+ 'valid-jsdoc': ['warn', { 'requireReturn': false, 'requireParamDescription': false, 'requireReturnDescription': false }],
+ 'valid-typeof': 'error',
+
+ // === Best Practices ===
+ // (these mostly match our jshint config)
+ 'curly': 'error',
+ 'dot-notation': 'warn',
+ 'no-alert': 'warn',
+ 'no-caller': 'error',
+ 'no-case-declarations': 'error',
+ 'no-empty-pattern': 'error',
+ 'no-empty-function': 'warn',
+ //DEFINE POLICY: 'no-eq-null': 'warn',
+ 'no-eval': 'error',
+ //DEFINE POLICY: 'no-extra-bind': 'warn',
+ 'no-fallthrough': 'error',
+ //DEFINE POLICY: 'no-implicit-globals': 'warn',
+ 'no-implied-eval': 'error',
+ 'no-invalid-this': 'error',
+ 'no-iterator': 'error',
+ 'no-labels': 'error',
+ 'no-loop-func': 'error',
+ 'no-multi-spaces': 'warn',
+ 'no-multi-str': 'error',
+ 'no-native-reassign': 'warn',
+ 'no-new-func': 'error',
+ 'no-new-wrappers': 'error',
+ // DEFINE POLICY: no-octal: "error"
+ // DEFINE POLICY: no-octal-escape: "error"
+ 'no-proto': 'error',
+ 'no-redeclare': 'warn',
+ 'no-return-assign': 'error',
+ 'no-script-url': 'error',
+ 'no-self-assign': 'error',
+ 'no-self-compare': 'error',
+ 'no-unmodified-loop-condition': 'error',
+ // Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-expressions': 'error',
+ 'no-unused-labels': 'error',
+ //DEFINE POLICY: 'no-useless-call': 'error',
+ 'no-useless-escape': 'warn',
+ //DEFINE POLICY: 'no-with': 'error',
+ 'wrap-iife': ['error', 'any'],
+
+ // === Variables ===
+ 'no-delete-var': 'error',
+ // Disabled for YUI rollups, enabled by grunt for AMD: 'no-undef': 'off',
+ //DEFINE POLICY: 'no-undef-init': 'error',
+ // Disabled for YUI rollups, enabled by grunt for AMD: 'no-unused-vars': 'error',
+
+ // === Stylistic Issues ===
+ 'array-bracket-spacing': 'warn',
+ 'block-spacing': 'warn',
+ 'brace-style': ['warn', '1tbs'],
+ 'camelcase': 'warn',
+ 'comma-spacing': ['warn', { 'before': false, 'after': true }],
+ 'comma-style': ['warn', 'last'],
+ 'computed-property-spacing': 'error',
+ 'consistent-this': 'off',
+ 'eol-last': 'off',
+ 'func-names': 'off',
+ 'func-style': 'off',
+ // indent currently not doing well with our wrapping style, so disabled.
+ 'indent': ['off', 4, { 'SwitchCase': 1 }],
+ 'key-spacing': ['warn', { 'beforeColon': false, 'afterColon': true, 'mode': minimum }],
+ 'keyword-spacing': 'warn',
+ 'linebreak-style': ['error', 'unix'],
+ 'lines-around-comment': 'off',
+ 'max-len': ['error', 132],
+ 'max-lines': 'off',
+ // DEFINE POLICY: turn on some of these max values?
+ 'max-depth': 'off',
+ 'max-nested-callbacks': 'off',
+ 'max-params': 'off',
+ 'max-statements': 'off',
+ 'max-statements-per-line': 'off',
+ 'new-cap': ['warn', { 'properties': false }],
+ 'new-parens': 'warn',
+ 'newline-after-var': 'off',
+ 'newline-before-return': 'off',
+ // REVIST POLICY: 'newline-per-chained-call': 'warn',
+ 'no-array-constructor': 'off',
+ 'no-bitwise': 'error',
+ 'no-continue': 'off',
+ 'no-inline-comments': 'off',
+ 'no-lonely-if': 'off',
+ 'no-mixed-operators': 'off',
+ 'no-mixed-spaces-and-tabs': 'error',
+ 'no-multiple-empty-lines': 'warn',
+ 'no-negated-condition': 'off',
+ 'no-nested-ternary': 'warn',
+ 'no-new-object': 'off',
+ 'no-plusplus': 'off',
+ 'no-spaced-func': 'warn',
+ 'no-ternary': 'off',
+ 'no-trailing-spaces': 'error',
+ 'no-underscore-dangle': 'off',
+ // DEFINE POLICY: 'no-unneeded-ternary': 'off',
+ 'no-whitespace-before-property': 'warn',
+ // DEFINE POLICY: 'object-curly-newline': 'off,
+ // DEFINE POLICY: 'object-curly-spacing': 'off',
+ // DEFINE POLICY: 'object-property-newline': 'off',
+ 'one-var': 'off',
+ // DEFINE POLICY: 'one-var-declaration-per-line': 'off',
+ 'operator-assignment': 'off',
+ 'operator-linebreak': 'off',
+ 'padded-blocks': 'off',
+ // DEFINE POLICY: 'quote-props': 'off',
+ 'quotes': 'off',
+ 'require-jsdoc': 'warn',
+ 'semi': 'error',
+ 'semi-spacing': ['warn', {'before': false, 'after': true}],
+ 'sort-vars': 'off',
+ 'space-before-blocks': 'warn',
+ 'space-before-function-paren': ['warn', 'never'],
+ 'space-in-parens': 'warn',
+ 'space-infix-ops': 'warn',
+ 'space-unary-ops': 'warn',
+ 'spaced-comment': 'warn',
+ 'unicode-bom': 'error',
+ 'wrap-regex': 'off',
+ }
+}
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/* jshint node: true, browser: false */
+/* eslint-env node */
/**
* @copyright 2014 Andrew Nicols
module.exports = function(grunt) {
var path = require('path'),
tasks = {},
- cwd = process.env.PWD || process.cwd();
+ cwd = process.env.PWD || process.cwd(),
+ async = require('async'),
+ DOMParser = require('xmldom').DOMParser,
+ xpath = require('xpath');
// Windows users can't run grunt in a subdirectory, so allow them to set
// the root by passing --root=path/to/dir.
var root = grunt.option('root');
if (grunt.file.exists(__dirname, root)) {
cwd = path.join(__dirname, root);
- grunt.log.ok('Setting root to '+cwd);
+ grunt.log.ok('Setting root to ' + cwd);
} else {
- grunt.fail.fatal('Setting root to '+root+' failed - path does not exist');
+ grunt.fail.fatal('Setting root to ' + root + ' failed - path does not exist');
}
}
* @param {String} srcPath the matched src path
* @return {String} The rewritten destination path.
*/
- var uglify_rename = function (destPath, srcPath) {
+ var uglifyRename = function(destPath, srcPath) {
destPath = srcPath.replace('src', 'build');
destPath = destPath.replace('.js', '.min.js');
destPath = path.resolve(cwd, destPath);
return destPath;
};
+ /**
+ * Find thirdpartylibs.xml and generate an array of paths contained within
+ * them (used to generate ignore files and so on).
+ *
+ * @return {array} The list of thirdparty paths.
+ */
+ var getThirdPartyPathsFromXML = function() {
+ var thirdpartyfiles = grunt.file.expand('*/**/thirdpartylibs.xml');
+ var libs = ['node_modules/', 'vendor/'];
+
+ thirdpartyfiles.forEach(function(file) {
+ var dirname = path.dirname(file);
+
+ var doc = new DOMParser().parseFromString(grunt.file.read(file));
+ var nodes = xpath.select("/libraries/library/location/text()", doc);
+
+ nodes.forEach(function(node) {
+ var lib = path.join(dirname, node.toString());
+ if (grunt.file.isDir(lib)) {
+ // Ensure trailing slash on dirs.
+ lib = lib.replace(/\/?$/, '/');
+ }
+
+ // Look for duplicate paths before adding to array.
+ if (libs.indexOf(lib) === -1) {
+ libs.push(lib);
+ }
+ });
+ });
+ return libs;
+ };
+
+
// Project configuration.
grunt.initConfig({
jshint: {
options: {jshintrc: '.jshintrc'},
amd: { src: amdSrc }
},
+ eslint: {
+ // Even though warnings dont stop the build we don't display warnings by default because
+ // at this moment we've got too many core warnings.
+ options: { quiet: !grunt.option('show-lint-warnings') },
+ // Check AMD files. We add some stricter rules which we can't apply to the default configuration due
+ // to YUI rollups.
+ amd: {
+ src: amdSrc,
+ options: {
+ rules: {'no-undef': 'error', 'no-unused-vars': 'error', 'no-empty': 'error', 'no-unused-expressions': 'error'}
+ }
+ },
+ // Check YUI module source files.
+ yui: {
+ src: ['**/yui/src/**/*.js', '!*/**/yui/src/*/meta/*.js'],
+ }
+ },
uglify: {
amd: {
files: [{
expand: true,
src: amdSrc,
- rename: uglify_rename
+ rename: uglifyRename
}]
}
},
},
yui: {
files: ['**/yui/src/**/*.js'],
- tasks: ['shifter']
+ tasks: ['yui']
},
},
shifter: {
}
});
+ /**
+ * Generate ignore files (utilising thirdpartylibs.xml data)
+ */
+ tasks.ignorefiles = function() {
+ // An array of paths to third party directories.
+ var thirdPartyPaths = getThirdPartyPathsFromXML();
+ // Generate .eslintignore.
+ var eslintIgnores = ['# Generated by "grunt ignorefiles"', '*/**/yui/src/*/meta/', '*/**/build/'].concat(thirdPartyPaths);
+ grunt.file.write('.eslintignore', eslintIgnores.join('\n'));
+ };
+
/**
* Shifter task. Is configured with a path to a specific file or a directory,
* in the case of a specific file it will work out the right module to be built.
* so be careful to to call done().
*/
tasks.shifter = function() {
- var async = require('async'),
- done = this.async(),
+ var done = this.async(),
options = grunt.config('shifter.options');
// Run the shifter processes one at a time to avoid confusing output.
- async.eachSeries(options.paths, function (src, filedone) {
+ async.eachSeries(options.paths, function(src, filedone) {
var args = [];
- args.push( path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
+ args.push(path.normalize(__dirname + '/node_modules/shifter/bin/shifter'));
// Always ignore the node_modules directory.
args.push('--excludes', 'node_modules');
cmd: "node",
args: args,
opts: {cwd: src, stdio: 'inherit', env: process.env}
- }, function (error, result, code) {
+ }, function(error, result, code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
tasks.startup = function() {
// Are we in a YUI directory?
if (path.basename(path.resolve(cwd, '../../')) == 'yui') {
- grunt.task.run('shifter');
+ grunt.task.run('yui');
// Are we in an AMD directory?
} else if (inAMD) {
grunt.task.run('amd');
var onChange = grunt.util._.debounce(function() {
var files = Object.keys(changedFiles);
grunt.config('jshint.amd.src', files);
- grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglify_rename }]);
+ grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglifyRename }]);
grunt.config('shifter.options.paths', files);
changedFiles = Object.create(null);
}, 200);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
+ grunt.loadNpmTasks('grunt-eslint');
// Register JS tasks.
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
- grunt.registerTask('amd', ['jshint', 'uglify']);
- grunt.registerTask('js', ['amd', 'shifter']);
+ grunt.registerTask('ignorefiles', 'Generate ignore files for linters', tasks.ignorefiles);
+ grunt.registerTask('yui', ['eslint:yui', 'shifter']);
+ grunt.registerTask('amd', ['eslint:amd', 'jshint', 'uglify']);
+ grunt.registerTask('js', ['amd', 'yui']);
// Register CSS taks.
grunt.registerTask('css', ['less:bootstrapbase']);
define('CLI_SCRIPT', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/cronlib.php');
define('CLI_SCRIPT', 1);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
define('CLI_SCRIPT', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
require_once($CFG->libdir.'/cronlib.php');
// distro specific customisation
-$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php';
+$distrolibfile = __DIR__.'/../../install/distrolib.php';
$distro = null;
if (file_exists($distrolibfile)) {
require_once($distrolibfile);
}
// Nothing to do if config.php exists
-$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
+$configfile = __DIR__.'/../../config.php';
if (file_exists($configfile)) {
require($configfile);
require_once($CFG->libdir.'/clilib.php');
global $CFG;
$CFG = new stdClass();
$CFG->lang = 'en';
-$CFG->dirroot = dirname(dirname(dirname(__FILE__)));
+$CFG->dirroot = dirname(dirname(__DIR__));
$CFG->libdir = "$CFG->dirroot/lib";
$CFG->wwwroot = "http://localhost";
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->debugdisplay = true;
$CFG->debugdeveloper = true;
-$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
+$parts = explode('/', str_replace('\\', '/', dirname(__DIR__)));
$CFG->admin = array_pop($parts);
//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
'chmod' => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions
'lang' => $CFG->lang,
'wwwroot' => '',
- 'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
+ 'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(__DIR__))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro
'dbtype' => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection
'dbhost' => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost
'dbname' => 'moodle',
}
// Nothing to do if config.php does not exist
-$configfile = dirname(dirname(dirname(__FILE__))).'/config.php';
+$configfile = __DIR__.'/../../config.php';
if (!file_exists($configfile)) {
fwrite(STDERR, 'config.php does not exist, can not continue'); // do not localize
fwrite(STDERR, "\n");
define('CLI_SCRIPT', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
if ($DB->get_dbfamily() !== 'mysql') {
define('CLI_SCRIPT', true);
-require(dirname(__FILE__).'/../../config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir . '/clilib.php');
if ($DB->get_dbfamily() !== 'mysql') {
define('CLI_SCRIPT', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
if ($DB->get_dbfamily() !== 'mysql') {
define('CLI_SCRIPT', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
list($options, $unrecognized) = cli_get_params(array('help' => false), array('h' => 'help'));
define('CLI_SCRIPT', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php'); // cli only functions
define('CLI_SCRIPT', true);
define('CACHE_DISABLE_ALL', true);
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/adminlib.php'); // various admin-only functions
require_once($CFG->libdir.'/upgradelib.php'); // general upgrade/install related functions
require_once($CFG->libdir.'/clilib.php'); // cli only functions
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
$action = optional_param('action', '', PARAM_ALPHA);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
*/
// Security check.
-if (!file_exists(dirname(__FILE__).'/mailout-debugger.enable')) {
+if (!file_exists(__DIR__.'/mailout-debugger.enable')) {
mdie("Disabled.");
}
$tmpdir=sys_get_temp_dir(); // default
* @copyright 2011 Lancaster University Network Services Limited
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/message/lib.php');
require_once($CFG->libdir.'/adminlib.php');
// Allows the admin to control user logins from remote moodles.
-require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
+require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir . '/adminlib.php');
$step = optional_param('step', 'verify', PARAM_ALPHA);
// Allows the admin to configure mnet stuff
- require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+ require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/mnet/lib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require(dirname(dirname(dirname(__FILE__))).'/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/admin/mnet/profilefields_form.php');
$mnet = get_mnet_environment();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/admin/mnet/services_form.php');
$mnet = get_mnet_environment();
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package mnet
*/
-require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+require(__DIR__.'/../../config.php');
require_once $CFG->dirroot.'/mnet/xmlrpc/client.php';
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
<?php
// Allows the admin to configure services for remote hosts
- require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
+ require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(__FILE__)).'/config.php');
+require_once(__DIR__ . '/../config.php');
// The authorization code generated by the authorization server.
$code = required_param('code', PARAM_RAW);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/filelib.php');
<?php
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/portfoliolib.php');
require_once($CFG->libdir . '/portfolio/forms.php');
require_once($CFG->libdir . '/adminlib.php');
//error_reporting(0);
//ini_set('display_errors',0);
-require_once(dirname(dirname(__FILE__)).'/config.php');
+require_once(__DIR__ . '/../config.php');
$tmp = explode('@',$_ENV['RECIPIENT']);
$address = $tmp[0];
*/
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/tablelib.php');
*/
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->libdir . '/tablelib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/adminlib.php');
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
-require_once(dirname(dirname(__FILE__)) . '/config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/adminlib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require(dirname(dirname(__FILE__)) . '/config.php');
+require(__DIR__ . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('resetemoticons');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir . '/adminlib.php');
$mode = required_param('mode', PARAM_ALPHANUMEXT);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
$contextid = required_param('contextid', PARAM_INT);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ALPHA);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../config.php');
+require_once(__DIR__ . '/../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/roles/lib.php');
$formcourseformats[$courseformat] = new lang_string('pluginname', "format_$courseformat");
}
$temp->add(new admin_setting_configselect('moodlecourse/format', new lang_string('format'), new lang_string('coursehelpformat'),
- 'weeks',$formcourseformats));
+ 'topics', $formcourseformats));
$temp->add(new admin_setting_configtext('moodlecourse/maxsections', new lang_string('maxnumberweeks'),
new lang_string('maxnumberweeks_desc'), 52));
$temp->add(new admin_settings_num_course_sections('moodlecourse/numsections', new lang_string('numberweeks'),
- new lang_string('coursehelpnumberweeks'), 10));
+ new lang_string('coursehelpnumberweeks'), 4));
$choices = array();
$choices['0'] = new lang_string('hiddensectionscollapsed');
define('NO_OUTPUT_BUFFERING', true);
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/upgradableassignmentstable.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/adminlib.php');
require_once($CFG->dirroot . '/'.$CFG->admin.'/tool/assignmentupgrade/locallib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/capability/locallib.php');
require_once($CFG->libdir.'/adminlib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require(__DIR__ . '/../../../config.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/filter_form.php');
require_once($CFG->libdir.'/adminlib.php');
define('NO_OUTPUT_BUFFERING', true); // progress bar is used here
-require(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
+require(__DIR__ . '/../../../config.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/tool/customlang/locallib.php');
require_once($CFG->libdir.'/adminlib.php');
define('CLI_SCRIPT', true);
define('NO_OUTPUT_BUFFERING', true);
-require(dirname(__FILE__) . '/../../../../config.php');
+require(__DIR__ . '/../../../../config.php');
require_once($CFG->libdir. '/clilib.php');
// CLI options.
define('CLI_SCRIPT', true);
define('NO_OUTPUT_BUFFERING', true);
-require(dirname(__FILE__) . '/../../../../config.php');
+require(__DIR__ . '/../../../../config.php');
require_once($CFG->libdir. '/clilib.php');
// CLI options.
* @copyright 2009 Nicolas Connault
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
// This index page was previously in use, for now we redirect to the make test
// course page - but we might reinstate this page in the future.
.path-admin-tool-health dl.notice dd {
background-color: #e5db36;
}
-.path-admin-tool-health dt.solution,
-.path-admin-tool-health dd.solution,
+.path-admin-tool-health dl dt.solution,
+.path-admin-tool-health dl dd.solution,
.path-admin-tool-health div#healthnoproblemsfound {
- background-color: #5BB83E !important;
+ background-color: #5BB83E;
}
.path-admin-tool-health dl.healthissues dt,
.path-admin-tool-health dl.healthissues dd {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('tool_installaddon_index');
define('AJAX_SCRIPT', true);
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_login();
* Find a node in the dialogue.
*
* @param {String} selector
+ * @return {JQuery} The node
* @method _find
*/
ActionSelector.prototype._find = function(selector) {
for (var i in self._actions) {
choices.push(self._actions[i]);
}
- var content = {'message': self._message, 'choices' : choices,
- 'confirm' : self._confirm, 'cancel' : self._cancel};
+ var content = {'message': self._message, 'choices': choices,
+ 'confirm': self._confirm, 'cancel': self._cancel};
return Templates.render('tool_lp/action_selector', content);
};
*
* @param {Number} itemid
* @param {String} itemtype
+ * @param {Number} pagectxid
*/
var competencies = function(itemid, itemtype, pagectxid) {
this.itemid = itemid;
}
]);
} else {
- return null;
+ return;
}
requests[0].fail(notification.exception);
{ key: message, component: 'tool_lp', param: competency.shortname },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Unlink the competency X from the course?
if (localthis.itemtype == 'course') {
// Course completion rule handling.
- $('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e){
+ $('[data-region="coursecompetenciespage"]').on('change', 'select[data-field="ruleoutcome"]', function(e) {
var requests = [];
var pagerender = 'tool_lp/course_competencies_page';
var pageregion = 'coursecompetenciespage';
* Get the string for an outcome.
*
* @param {Number} id The outcome code.
- * @return {Promise Resolved with the string.
+ * @return {Promise} Resolved with the string.
* @method getString
*/
getString: function(id) {
/**
* CompetencyPlanNavigation
*
- * @param {String} The selector of the competency element.
- * @param {String} The base url for the page (no params).
- * @param {Number} The user id
- * @param {Number} The competency id
- * @param {Number} The plan id
+ * @param {String} competencySelector The selector of the competency element.
+ * @param {String} baseUrl The base url for the page (no params).
+ * @param {Number} userId The user id
+ * @param {Number} competencyId The competency id
+ * @param {Number} planId The plan id
*/
var CompetencyPlanNavigation = function(competencySelector, baseUrl, userId, competencyId, planId) {
this._baseUrl = baseUrl;
return null;
};
+ // eslint-disable-next-line valid-jsdoc
/**
* Return the type of the module.
*
* Trigger an event.
*
* @param {String} type The type of event.
- * @param {Object} The data to pass to the listeners.
+ * @param {Object} data The data to pass to the listeners.
* @method _trigger
* @protected
*/
try {
config = JSON.parse(self._competency.ruleconfig);
} catch (e) {
+ // eslint-disable-line no-empty
}
}
var parent = $('[data-region="competencyactions"]').data('competency');
var params = {
- competencyframeworkid : treeModel.getCompetencyFrameworkId(),
+ competencyframeworkid: treeModel.getCompetencyFrameworkId(),
pagecontextid: pageContextId
};
{ key: 'addingcompetencywillresetparentrule', component: 'tool_lp', param: parent.shortname },
{ key: 'yes', component: 'core' },
{ key: 'no', component: 'core' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0],
strings[1],
{ key: confirmMessage, component: 'tool_lp' },
{ key: 'yes', component: 'moodle' },
{ key: 'no', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete competency X?
});
treeRoot.show();
- body.on('click', '[data-action="move"]', function() { popup.close(); confirmMove(); });
- body.on('click', '[data-action="cancel"]', function() { popup.close(); });
+ body.on('click', '[data-action="move"]', function() {
+ popup.close();
+ confirmMove();
+ });
+ body.on('click', '[data-action="cancel"]', function() {
+ popup.close();
+ });
};
/**
/**
* A node was chosen and "Move" was selected from the menu. Open a popup to select the target.
+ * @param {Event} e
* @method moveHandler
*/
var moveHandler = function(e) {
competencyframeworkid: competency.competencyframeworkid,
searchtext: ''
}
- },{
+ }, {
methodname: 'core_competency_read_competency_framework',
args: {
id: competency.competencyframeworkid
{ key: 'movecompetency', component: 'tool_lp', param: competency.shortname },
{ key: 'move', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
var context = {
framework: framework,
var competency = $('[data-region="competencyactions"]').data('competency');
var params = {
- competencyframeworkid : treeModel.getCompetencyFrameworkId(),
- id : competency.id,
+ competencyframeworkid: treeModel.getCompetencyFrameworkId(),
+ id: competency.id,
parentid: competency.parentid,
pagecontextid: pageContextId
};
/**
* Re-render the page with the latest data.
+ * @param {Object} context
* @method reloadPage
*/
var reloadPage = function(context) {
/**
* Perform a search and render the page with the new search results.
+ * @param {Event} e
* @method updateSearchHandler
*/
var updateSearchHandler = function(e) {
courses: courses
};
templates.render('tool_lp/linked_courses_summary', context).done(function(html) {
- str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) {
+ str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) {
new Dialogue(
linkedcourses, // Title.
html, // The linked courses.
});
});
- calls.push( {
+ calls.push({
methodname: 'tool_lp_data_for_related_competencies_section',
args: { competencyid: relatedTarget.id }
});
str.get_strings([
{ key: 'competencycannotbedeleted', component: 'tool_lp', param: competency.shortname },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.alert(
null,
strings[0]
{ key: confirmMessage, component: 'tool_lp', param: competency.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete competency X?
/**
* HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
* @method dragStart
+ * @param {Event} e
*/
var dragStart = function(e) {
e.originalEvent.dataTransfer.setData('text', $(e.target).parent().data('id'));
/**
* HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
* @method allowDrop
+ * @param {Event} e
*/
var allowDrop = function(e) {
e.originalEvent.dataTransfer.dropEffect = 'move';
/**
* HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
* @method dragEnter
+ * @param {Event} e
*/
var dragEnter = function(e) {
e.preventDefault();
/**
* HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
* @method dragLeave
+ * @param {Event} e
*/
var dragLeave = function(e) {
e.preventDefault();
/**
* HTML5 implementation of drag/drop (there is an accesible alternative in the menus).
* @method dropOver
+ * @param {Event} e
*/
var dropOver = function(e) {
e.preventDefault();
/**
* Log the competency viewed event.
*
- * @param {Object} The competency.
+ * @param {Object} competency The competency.
* @method triggerCompetencyViewedEvent
*/
var triggerCompetencyViewedEvent = function(competency) {
* @method selectionChanged
* @param {Event} evt The event that triggered the selection change.
* @param {Object} params The parameters for the event. Contains a list of selected nodes.
+ * @return {Boolean}
*/
var selectionChanged = function(evt, params) {
var node = params.selected,
* Return the string "Selected <taxonomy>".
*
* @function parseTaxonomies
- * @param {String} Comma separated list of taxonomies.
+ * @param {String} taxonomiesstr Comma separated list of taxonomies.
* @return {Array} of level => taxonomystr
*/
var parseTaxonomies = function(taxonomiesstr) {
*
*/
var Competencydialogue = function() {
+ // Intentionally left empty.
};
/**
* Log the competency viewed event.
*
- * @param {Number} The competency ID.
+ * @param {Number} competencyId The competency ID.
* @method triggerCompetencyViewedEvent
*/
Competencydialogue.prototype.triggerCompetencyViewedEvent = function(competencyId) {
/**
* The action on the click event.
*
- * @param {Event} event click
+ * @param {Event} e event click
* @method clickEventHandler
*/
Competencydialogue.prototype.clickEventHandler = function(e) {
* Get a promise on data competency.
*
* @param {Number} competencyid
+ * @param {Object} options
* @return {Promise} return promise on data request
* @method getCompetencyDataPromise
*/
* Initialise the competency dialogue module.
*
* Only the first call matters.
- *
- * @return {Void}
*/
init: function() {
if (typeof instance !== 'undefined') {
competencyframeworkid: frameworkId
}}
])[0].done(function(competencies) {
-
+ /**
+ * @param {Object} parent
+ * @param {Array} competencies
+ */
function addCompetencyChildren(parent, competencies) {
for (var i = 0; i < competencies.length; i++) {
if (competencies[i].parentid == parent.id) {
* Find a node in the dialogue.
*
* @param {String} selector
+ * @return {JQuery}
* @method _find
*/
Picker.prototype._find = function(selector) {
* Convenience method to get a framework object.
*
* @param {Number} fid The framework ID.
+ * @return {Object}
* @method _getFramework
*/
Picker.prototype._getFramework = function(fid) {
*
* This needs to be set after reset/close.
*
- * @params {Number[]} The IDs.
+ * @param {Number[]} ids The IDs.
* @method _setDisallowedCompetencyIDs
*/
Picker.prototype.setDisallowedCompetencyIDs = function(ids) {
* Trigger an event.
*
* @param {String} type The type of event.
- * @param {Object} The data to pass to the listeners.
+ * @param {Object} data The data to pass to the listeners.
* @method _reset
*/
Picker.prototype._trigger = function(type, data) {
/**
* Competency picker in plan class.
*
+ * @param {Number} userId
* @param {Number|false} singlePlan The ID of the plan when limited to one.
- * @param {String} pageContextIncludes One of 'children', 'parents', 'self'.
* @param {Boolean} multiSelect Support multi-select in the tree.
*/
var Picker = function(userId, singlePlan, multiSelect) {
* @param {Number} planId The planId.
* @param {String} searchText Limit the competencies to those matching the text.
* @method _fetchCompetencies
- * @return {Promise}
+ * @return {Promise} The promise object.
*/
Picker.prototype._fetchCompetencies = function(planId, searchText) {
var self = this;
*
* Triggered when a change occured.
*
- * @return {Void}
* @method _afterChange
* @protected
*/
*
* Triggered when a change occured in a specific rule config.
*
- * @return {Void}
* @method _afterRuleConfigChange
* @protected
+ * @param {Event} e
+ * @param {Rule} rule
*/
RuleConfig.prototype._afterRuleConfigChange = function(e, rule) {
if (rule != this._getRule()) {
/**
* After render hook.
*
- * @return {Promise}
* @method _afterRender
* @protected
*/
* Find a node in the dialogue.
*
* @param {String} selector
+ * @return {JQuery}
* @method _find
* @protected
*/
/**
* Set up the instance.
*
- * @return {Void}
* @method _setUp
* @protected
*/
/**
* Called when the user switches outcome.
*
- * @return {Void}
* @method _switchedOutcome
* @protected
*/
/**
* Called when the user switches rule.
*
- * @return {Void}
* @method _switchedRule
* @protected
*/
* Trigger an event.
*
* @param {String} type The type of event.
- * @param {Object} The data to pass to the listeners.
+ * @param {Object} data The data to pass to the listeners.
* @method _trigger
* @protected
*/
e.preventDefault();
templates.render('tool_lp/course_competency_settings', context).done(function(html) {
- str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function (title) {
+ str.get_string('configurecoursecompetencysettings', 'tool_lp').done(function(title) {
this._dialogue = new Dialogue(
title,
html,
wide = false;
}
- Y.use('moodle-core-notification', 'timers', function () {
+ Y.use('moodle-core-notification', 'timers', function() {
var width = '480px';
if (wide) {
width = '800px';
/**
* Get content.
+ * @return {node}
*/
dialogue.prototype.getContent = function() {
return this.yuiDialogue.bodyNode.getDOMNode();
{ key: 'emptydragdropregion', component: 'moodle' },
{ key: 'movecontent', component: 'moodle' },
{ key: 'tocontent', component: 'moodle' },
- ]).done( function () {
- Y.use('moodle-tool_lp-dragdrop-reorder', function () {
+ ]).done(function() {
+ Y.use('moodle-tool_lp-dragdrop-reorder', function() {
var context = {
callback: callback
* Trigger an event.
*
* @param {String} type The type of event.
- * @param {Object} The data to pass to the listeners.
+ * @param {Object} data The data to pass to the listeners.
* @method _trigger
*/
Base.prototype._trigger = function(type, data) {
*
* @param {String} triggerSelector The node on which the click will happen.
* @param {String} containerSelector The parent node that will be removed and contains the evidence ID.
- * @return {Void}
*/
var register = function(triggerSelector, containerSelector) {
if (typeof selectors[triggerSelector] !== 'undefined') {
{ key: 'areyousure', component: 'moodle' },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
Notification.confirm(
strings[0], // Confirm.
strings[1], // Are you sure?
}
}
}]);
- requests[0].done(function (success) {
+ requests[0].done(function(success) {
if (success === false) {
var req = ajax.call([{
methodname: 'core_competency_read_competency_framework',
args: { id: frameworkid }
}]);
- req[0].done(function (framework) {
+ req[0].done(function(framework) {
str.get_strings([
{ key: 'frameworkcannotbedeleted', component: 'tool_lp', param: framework.shortname },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.alert(
null,
strings[0]
{ key: 'deletecompetencyframework', component: 'tool_lp', param: framework.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete competency framework X?
* @param {String} selector The selector of the auto complete element.
* @param {String} query The query string.
* @param {Function} callback A callback function receiving an array of results.
- * @return {Void}
*/
transport: function(selector, query, callback) {
var el = $(selector),
/**
* Grade dialogue class.
+ * @param {Array} ratingOptions
*/
var Grade = function(ratingOptions) {
EventBase.prototype.constructor.apply(this, []);
/**
* After render hook.
*
- * @return {Promise}
* @method _afterRender
* @protected
*/
*
* @param {String} selector
* @method _find
+ * @returns {node} The node
* @protected
*/
Grade.prototype._find = function(selector) {
* InlineEditor
*
* @param {String} selector The selector to trigger the grading.
- * @param {Number} The id of the scale for this competency.
- * @param {Number} The id of the competency.
- * @param {Number} The id of the user.
- * @param {Number} The id of the plan.
- * @param {Number} The id of the course.
- * @param {String} Language string for choose a rating.
+ * @param {Number} scaleId The id of the scale for this competency.
+ * @param {Number} competencyId The id of the competency.
+ * @param {Number} userId The id of the user.
+ * @param {Number} planId The id of the plan.
+ * @param {Number} courseId The id of the course.
+ * @param {String} chooseStr Language string for choose a rating.
*/
var InlineEditor = function(selector, scaleId, competencyId, userId, planId, courseId, chooseStr) {
EventBase.prototype.constructor.apply(this, []);
/**
* Constructor
*
- * @param {$} Jquery collection matching the root of the menu.
+ * @param {$} menuRoot Jquery collection matching the root of the menu.
* @param {Function[]} handlers, called when a menu item is chosen.
*/
var Menubar = function(menuRoot, handlers) {
* @method handleClick
* @param {Object} item is the jquery object of the item firing the event
* @param {Event} e is the associated event object
- * @return boolean Returns false
+ * @return {boolean} Returns false
*/
Menubar.prototype.handleClick = function(item, e) {
e.stopPropagation();
this.activeItem = null;
// Close the menu.
- this.menuRoot.find('ul').not('.root-level').attr('aria-hidden','true');
+ this.menuRoot.find('ul').not('.root-level').attr('aria-hidden', 'true');
// Follow any link, or call the click handlers.
var anchor = item.find('a').first();
var clickEvent = new $.Event('click');
subMenuContainer.css('margin-right', '-' + marginright + 'px');
}
} else {
- if ( pos.left + menuRealWidth > $(window).width()) {
+ if (pos.left + menuRealWidth > $(window).width()) {
marginleft = menuRealWidth - widthmenuRoot;
subMenuContainer.css('margin-left', '-' + marginleft + 'px');
}
return true;
}
- switch(e.keyCode) {
+ switch (e.keyCode) {
case this.keys.tab: {
// Hide all menu items and update their aria attributes.
// This is the root level move to next sibling. This will require closing
// the current child menu and opening the new one.
- if (menuIndex < menuNum-1) {
+ if (menuIndex < menuNum - 1) {
// Not the last root menu.
newItem = item.next();
} else { // Wrap to first item.
menuIndex = this.rootMenus.index(rootItem);
// If this is not the last root menu item, move to the next one.
- if (menuIndex < this.rootMenus.length-1) {
+ if (menuIndex < this.rootMenus.length - 1) {
newItem = rootItem.next();
} else {
// Loop.
// to the next item with a title that begins with that character.
if (startChr) {
var match = false;
- var curNdx = menuIndex+1;
+ var curNdx = menuIndex + 1;
// Check if the active item was the last one on the list.
if (curNdx == menuNum) {
// Iterate through the menu items (starting from the current item and wrapping) until a match is found
// or the loop returns to the current menu item.
- while (curNdx != menuIndex) {
+ while (curNdx != menuIndex) {
var titleChr = menuItems.eq(curNdx).html().charAt(0);
break;
}
- curNdx = curNdx+1;
+ curNdx = curNdx + 1;
if (curNdx == menuNum) {
// Reached the end of the list, start again at the beginning.
return item;
}
} else {
- if (menuIndex < menuNum-1) {
- newItem = menuItems.eq(menuIndex+1);
+ if (menuIndex < menuNum - 1) {
+ newItem = menuItems.eq(menuIndex + 1);
} else {
newItem = menuItems.first();
}
// If item is not the first item in its menu, move to the previous item.
if (menuIndex > 0) {
- newItem = menuItems.eq(menuIndex-1);
+ newItem = menuItems.eq(menuIndex - 1);
} else {
// Loop to top of menu.
newItem = menuItems.last();
* { "[data-action='add']" : callAddFunction }
*/
enhance: function(selector, handler) {
- $(selector).each(function (index, element) {
+ $(selector).each(function(index, element) {
var menuRoot = $(element);
// Don't enhance the same menu twice.
if (menuRoot.data("menubarEnhanced") !== true) {
/**
* Set the parent competency in the competency form.
*
- * @param {Object} Data containing selected cmpetency.
+ * @param {Object} data Data containing selected competency.
* @method setParent
*/
ParentCompetencyForm.prototype.setParent = function(data) {
/**
* Main initialisation.
* @param {String} buttonSelector The parent competency button selector.
- * @param {String} inputHiddenSelector The hidden input field selector.
+ * @param {String} inputSelector The hidden input field selector.
* @param {String} staticElementSelector The static element displaying the parent competency.
* @param {Number} frameworkId The competency framework ID.
* @param {Number} pageContextId The page context ID.
{ key: 'deleteplan', component: 'tool_lp', param: plan.name },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete plan X?
{ key: 'reopenplanconfirm', component: 'tool_lp', param: plan.name },
{ key: 'reopenplan', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Reopen plan X?
{ key: 'completeplanconfirm', component: 'tool_lp', param: plan.name },
{ key: 'completeplan', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Complete plan X?
{ key: 'unlinkplantemplateconfirm', component: 'tool_lp', param: plan.name },
{ key: 'unlinkplantemplate', component: 'tool_lp' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Unlink plan X?
courses: courses
};
templates.render('tool_lp/linked_courses_summary', context).done(function(html) {
- str.get_string('linkedcourses', 'tool_lp').done(function (linkedcourses) {
+ str.get_string('linkedcourses', 'tool_lp').done(function(linkedcourses) {
new Dialogue(
linkedcourses, // Title.
html // The linked courses.
*
* @name scaleChangeHandler
* @param {Event} e
- * @return {Void}
* @function
*/
ScaleConfig.prototype.scaleChangeHandler = function(e) {
* @param {Number} scaleid The scale id
* @return [] {Promise}
*/
-
+ // eslint-disable-next-line camelcase
get_values: function(scaleid) {
var deferred = $.Deferred();
if (typeof localCache[scaleid] === 'undefined') {
ajax.call([{
methodname: 'core_competency_get_scale_values',
- args: {scaleid : scaleid},
+ args: {scaleid: scaleid},
done: function(scaleinfo) {
localCache[scaleid] = scaleinfo;
deferred.resolve(scaleinfo);
* @copyright 2015 Damyon Wiese <damyon@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str','tool_lp/actionselector'],
+define(['jquery', 'core/templates', 'core/ajax', 'core/notification', 'core/str', 'tool_lp/actionselector'],
function($, templates, ajax, notification, str, Actionselector) {
// Private variables and functions.
{ key: 'unlinkplanstemplate', component: 'tool_lp' },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
- var actions = [{'text': strings[2], 'value' : 'delete'},
- {'text': strings[3], 'value' : 'unlink'}];
+ ]).done(function(strings) {
+ var actions = [{'text': strings[2], 'value': 'delete'},
+ {'text': strings[3], 'value': 'unlink'}];
var actionselector = new Actionselector(
strings[0], // Title.
strings[1], // Message
doDelete();
});
}).fail(notification.exception);
- }
- else {
+ } else {
str.get_strings([
{ key: 'confirm', component: 'moodle' },
{ key: 'deletetemplate', component: 'tool_lp', param: template.shortname },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete learning plan template X?
var oneItem = null;
while (lastIndex < currentIndex) {
- oneItem = $(this.visibleItems.get(lastIndex));
+ oneItem = $(this.visibleItems.get(lastIndex));
oneItem.attr('aria-selected', 'true');
lastIndex++;
}
while (lastIndex > currentIndex) {
- oneItem = $(this.visibleItems.get(lastIndex));
+ oneItem = $(this.visibleItems.get(lastIndex));
oneItem.attr('aria-selected', 'true');
lastIndex--;
}
*/
Tree.prototype.toggleItem = function(item) {
if (!this.multiSelect) {
- return this.selectItem(item);
+ this.selectItem(item);
+ return;
}
var current = item.attr('aria-selected');
* @method handleKeyDown
* @param {Object} item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleKeyDown = function(item, e) {
var currentIndex = this.visibleItems.index(item);
* @method handleKeyPress
* @param {Object} item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleKeyPress = function(item, e) {
if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
// Iterate through the menu items (starting from the current item and wrapping) until a match is found
// or the loop returns to the current menu item.
- while (currentIndex != itemIndex) {
+ while (currentIndex != itemIndex) {
var currentItem = this.visibleItems.eq(currentIndex);
var titleChr = currentItem.text().charAt(0);
break;
}
- currentIndex = currentIndex+1;
+ currentIndex = currentIndex + 1;
if (currentIndex == itemCount) {
// Reached the end of the list, start again at the beginning.
currentIndex = 0;
}
}
+ // eslint-disable-next-line no-unreachable
return true;
};
* @method handleDblClick
* @param {Object} item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleDblClick = function(item, e) {
* @method handleExpandCollapseClick
* @param {Object} item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleExpandCollapseClick = function(item, e) {
* @method handleClick
* @param {Object} item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleClick = function(item, e) {
* @method handleBlur
* @param {Object} item item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleBlur = function() {
return true;
* @method handleFocus
* @param {Object} item item is the jquery id of the parent item of the group
* @param {Event} e The event.
+ * @return {Boolean}
*/
Tree.prototype.handleFocus = function(item) {
/**
* UserCompetencyCourseNavigation
*
- * @param {String} The selector of the user element.
- * @param {String} The selector of the competency element.
- * @param {String} The base url for the page (no params).
- * @param {Number} The course id
- * @param {Number} The user id
- * @param {Number} The competency id
+ * @param {String} userSelector The selector of the user element.
+ * @param {String} competencySelector The selector of the competency element.
+ * @param {String} baseUrl The base url for the page (no params).
+ * @param {Number} userId The user id
+ * @param {Number} competencyId The competency id
+ * @param {Number} courseId The course id
*/
var UserCompetencyCourseNavigation = function(userSelector, competencySelector, baseUrl, userId, competencyId, courseId) {
this._baseUrl = baseUrl;
/**
* Info
*
- * @param {JQuery} Selector to replace when the information needs updating.
- * @param {Number} The id of the competency.
- * @param {Number} The id of the user.
- * @param {Number} The id of the plan.
- * @param {Number} The id of the course.
- * @param {Boolean} If we should display the user info.
+ * @param {JQuery} rootElement Selector to replace when the information needs updating.
+ * @param {Number} competencyId The id of the competency.
+ * @param {Number} userId The id of the user.
+ * @param {Number} planId The id of the plan.
+ * @param {Number} courseId The id of the course.
+ * @param {Boolean} displayuser If we should display the user info.
*/
var Info = function(rootElement, competencyId, userId, planId, courseId, displayuser) {
this._rootElement = rootElement;
/**
* UserCompetencyPopup
*
- * @param {String} The regionSelector
- * @param {String} The userCompetencySelector
- * @param {Number} The plan ID
+ * @param {String} regionSelector The regionSelector
+ * @param {String} userCompetencySelector The userCompetencySelector
+ * @param {Number} planId The plan ID
*/
var UserCompetencyPopup = function(regionSelector, userCompetencySelector, planId) {
this._regionSelector = regionSelector;
var planId = this._planId;
var requests = ajax.call([{
- methodname : 'tool_lp_data_for_user_competency_summary_in_plan',
+ methodname: 'tool_lp_data_for_user_competency_summary_in_plan',
args: { competencyid: competencyId, planid: planId },
done: this._contextLoaded.bind(this),
fail: notification.exception
}]);
// Log the user competency viewed in plan event.
- requests[0].then(function (result) {
+ requests[0].then(function(result) {
var eventMethodName = 'core_competency_user_competency_viewed_in_plan';
// Trigger core_competency_user_competency_plan_viewed event instead if plan is already completed.
if (result.plan.iscompleted) {
var planId = this._planId;
ajax.call([{
- methodname : 'tool_lp_data_for_plan_page',
+ methodname: 'tool_lp_data_for_plan_page',
args: { planid: planId},
done: this._pageContextLoaded.bind(this),
fail: notification.exception
* Cancel a review request and refresh the view.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method _cancelReviewRequest
*/
UserCompetencyWorkflow.prototype._cancelReviewRequest = function(data) {
* Cancel a review request an refresh the view.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method cancelReviewRequest
*/
UserCompetencyWorkflow.prototype.cancelReviewRequest = function(data) {
* Cancel a review request handler.
*
* @param {Event} e The event.
- * @return {Void}
* @method _cancelReviewRequestHandler
*/
UserCompetencyWorkflow.prototype._cancelReviewRequestHandler = function(e) {
* Request a review and refresh the view.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method _requestReview
*/
UserCompetencyWorkflow.prototype._requestReview = function(data) {
* Request a review.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method requestReview
*/
UserCompetencyWorkflow.prototype.requestReview = function(data) {
* Request a review handler.
*
* @param {Event} e The event.
- * @return {Void}
* @method _requestReviewHandler
*/
UserCompetencyWorkflow.prototype._requestReviewHandler = function(e) {
* Start a review and refresh the view.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method _startReview
*/
UserCompetencyWorkflow.prototype._startReview = function(data) {
* Start a review.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method startReview
*/
UserCompetencyWorkflow.prototype.startReview = function(data) {
* Start a review handler.
*
* @param {Event} e The event.
- * @return {Void}
* @method _startReviewHandler
*/
UserCompetencyWorkflow.prototype._startReviewHandler = function(e) {
* Stop a review and refresh the view.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method _stopReview
*/
UserCompetencyWorkflow.prototype._stopReview = function(data) {
* Stop a review.
*
* @param {Object} data The user competency data.
- * @return {Void}
* @method stopReview
*/
UserCompetencyWorkflow.prototype.stopReview = function(data) {
* Stop a review handler.
*
* @param {Event} e The event.
- * @return {Void}
* @method _stopReviewHandler
*/
UserCompetencyWorkflow.prototype._stopReviewHandler = function(e) {
{ key: 'deleteuserevidence', component: 'tool_lp', param: evidence.name },
{ key: 'delete', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Delete evidence X?
{ key: 'sendallcompetenciestoreview', component: 'tool_lp', param: evidence.name },
{ key: 'confirm', component: 'moodle' },
{ key: 'cancel', component: 'moodle' }
- ]).done(function (strings) {
+ ]).done(function(strings) {
notification.confirm(
strings[0], // Confirm.
strings[1], // Send all competencies in review for X?
}
protected function get_other_values(renderer_base $output) {
- $context = $this->related['cm']->context;
+ $cm = $this->related['cm'];
+ $context = $cm->context;
- return array(
- 'id' => $this->related['cm']->id,
- 'name' => external_format_string($this->related['cm']->name, $context->id),
- 'url' => $this->related['cm']->url->out(),
- 'iconurl' => $this->related['cm']->get_icon_url()->out()
+ $values = array(
+ 'id' => $cm->id,
+ 'name' => external_format_string($cm->name, $context->id),
+ 'iconurl' => $cm->get_icon_url()->out()
);
+ if ($cm->url) {
+ $values['url'] = $cm->url->out();
+ }
+ return $values;
}
'type' => PARAM_TEXT
),
'url' => array(
- 'type' => PARAM_URL
+ 'type' => PARAM_URL,
+ 'optional' => true,
),
'iconurl' => array(
'type' => PARAM_URL
navigation_node::TYPE_SETTING,
null,
null,
- new pix_icon('competency', '', 'tool_lp'));
+ new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
navigation_node::TYPE_SETTING,
null,
null,
- new pix_icon('competency', '', 'tool_lp'));
+ new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
navigation_node::TYPE_SETTING,
null,
null,
- new pix_icon('competency', '', 'tool_lp'));
+ new pix_icon('i/competencies', ''));
if (isset($settingsnode)) {
$navigation->add_node($settingsnode);
}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="32"
- height="32"
- id="svg2"
- version="1.1"
- inkscape:version="0.48.4 r9939"
- sodipodi:docname="New document 1" preserveAspectRatio="xMinYMid meet">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="5.6"
- inkscape:cx="32.609372"
- inkscape:cy="35.818362"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- width="33px"
- inkscape:window-width="1916"
- inkscape:window-height="981"
- inkscape:window-x="0"
- inkscape:window-y="72"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-1020.3622)">
- <g
- id="g3050"
- transform="matrix(0.92121849,0,0,0.92121849,-35.507391,91.120599)">
- <path
- style="fill:#fafafa"
- d="m 38.892857,1026.2908 0,-17 17,0 17,0 0,17 0,17 -17,0 -17,0 0,-17 z"
- id="path3056"
- inkscape:connector-curvature="0" />
- <path
- style="fill:#989898"
- d="m 40.954049,1037.3439 c -3.465234,-3.0054 -1.687876,-4.0531 6.875853,-4.0531 6.919599,0 7.985143,0.2502 9.263277,2.1752 0.947236,1.4266 2.021632,1.9536 3.121972,1.5314 1.37559,-0.5279 1.677706,-2.0754 1.677706,-8.5934 0,-4.3723 0.273145,-8.6614 0.606989,-9.5314 0.509481,-1.3277 -0.303204,-1.5818 -5.059017,-1.5818 -3.522693,0 -5.432219,-0.3783 -5.047972,-1 1.028329,-1.6639 14.737848,-1.2221 17.277494,0.5567 3.593622,2.5171 2.823056,4.4433 -1.777494,4.4433 l -4,0 0,7.345 c 0,9.8743 -0.892111,10.655 -12.175731,10.655 -7.005509,0 -8.916904,-0.3458 -10.763077,-1.9469 z m 3.938808,-10.6589 c 0,-2.9538 0.324365,-3.3942 2.5,-3.3942 2.153991,0 2.499902,0.4498 2.499294,3.25 -6e-4,2.7611 -0.376693,3.2717 -2.5,3.3942 -2.203157,0.1271 -2.499294,-0.2579 -2.499294,-3.25 z m 7.428571,-1.3942 c 0,-1.6931 0.666667,-2 4.344732,-2 5.000845,0 4.927087,1.9191 -0.08232,2.1419 -3.011559,0.1339 -2.966069,0.1822 0.809017,0.8581 l 4,0.7162 -4.535714,0.1419 c -3.91635,0.1225 -4.535715,-0.1312 -4.535715,-1.8581 z m -6.761904,-3.6667 c -1.167788,-1.1678 -0.718106,-4.0457 0.833333,-5.3333 1.846181,-1.5322 4.5,0.2461 4.5,3.0155 0,2.2918 -3.735778,3.9154 -5.333333,2.3178 z m 6.833333,-0.3333 c 0.339919,-0.55 2.139919,-1 4,-1 1.860081,0 3.660081,0.45 4,1 0.377944,0.6115 -1.175955,1 -4,1 -2.824045,0 -4.377944,-0.3885 -4,-1 z"
- id="path3054"
- inkscape:connector-curvature="0" />
- <path
- style="fill:#5e5e5e"
- d="m 40.892857,1036.2908 c -1.027328,-1.9196 -0.76049,-2 6.636076,-2 5.863885,0 8.157677,0.4084 9.593719,1.708 1.429812,1.2939 2.297278,1.4506 3.578741,0.6463 1.318167,-0.8273 1.801811,-3.0713 2.191464,-10.1678 l 0.5,-9.1062 -5.5,-0.351 c -4.40263,-0.2811 -3.893849,-0.3889 2.55,-0.5402 5.16365,-0.1213 8.480263,0.2412 9.25,1.0109 2.011735,2.0117 1.364232,2.8 -2.3,2.8 l -3.5,0 0,7.0657 c 0,10.7479 -0.204518,10.9343 -12,10.9343 -8.906177,0 -10.039956,-0.2061 -11,-2 z m 5.078947,-9.0357 c -0.06465,-2.8954 0.283272,-3.5357 1.921053,-3.5357 1.608782,0 2,0.6666 2,3.4081 0,2.8111 -0.245749,3.2042 -1.402754,2.244 -1.077175,-0.894 -1.523051,-0.8644 -1.921053,0.1276 -0.285064,0.7104 -0.553825,-0.2994 -0.597246,-2.244 z m 8.682712,-0.6716 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m 0,-3 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m 0,-2 c 1.243913,-0.2392 3.043913,-0.2301 4,0.02 0.956088,0.2503 -0.06166,0.446 -2.261659,0.4349 -2.2,-0.011 -2.982253,-0.2159 -1.738341,-0.4551 z m -9.205886,-1.2025 c -0.810187,-1.3109 0.447721,-4.0902 1.851216,-4.0902 1.828446,0 3.499178,2.081 2.907877,3.6219 -0.592966,1.5452 -3.892838,1.87 -4.759093,0.4683 z"
- id="path3052"
- inkscape:connector-curvature="0" />
- </g>
- </g>
-</svg>
.tool-lp-menu li {
float: left;
- display: inline;
position: relative;
list-style-type: none;
white-space: nowrap;
--- /dev/null
+This files describes changes in /admin/tool/lp/* - plugins,
+information provided here is intended especially for developers.
+
+=== 3.2 ===
+
+* The icon 'competency.png/svg' has been removed, please use i/competencies instead.
+
+=== 3.1.1 ===
+
+* The plugin icon 'competency.png/svg' will be removed in the future use i/competencies instead.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
/// Rebuild course cache which might be incorrect now
echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess');
-rebuild_course_cache();
+rebuild_course_cache(0, true);
echo $OUTPUT->notification('...finished', 'notifysuccess');
echo $OUTPUT->continue_button(new moodle_url('/admin/'));
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('toolphpunit');
define('NO_OUTPUT_BUFFERING', true);
-require(dirname(__FILE__) . '/../../../config.php');
+require(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$testpath = optional_param('testpath', '', PARAM_PATH);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
-require_once(dirname(__FILE__) . '/import_form.php');
+require_once(__DIR__ . '/import_form.php');
admin_externalpage_setup('toolprofiling');
// TODO: it is wrong when core lib references ANY plugin lang strings, maybe more login could be moved here (skodak)
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir . '/xhprof/xhprof_moodle.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir . '/tablelib.php');
$contextid = required_param('contextid', PARAM_INT);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
var promises = ajax.call([{
methodname: 'core_output_load_template',
- args:{
+ args: {
component: component,
template: name,
themename: config.theme
}
}, {
methodname: 'tool_templatelibrary_load_canonical_template',
- args:{
+ args: {
component: component,
template: name
}
// When returns a new promise that is resolved when all the passed in promises are resolved.
// The arguments to the done become the values of each resolved promise.
$.when.apply($, promises)
- .done( function(source, originalSource) { templateLoaded(templateName, source, originalSource); })
+ .done(function(source, originalSource) {
+ templateLoaded(templateName, source, originalSource);
+ })
.fail(notification.exception);
};
// Add the event listeners.
- $('[data-region="list-templates"]').on('click', '[data-templatename]', function() {
+ $('[data-region="list-templates"]').on('click', '[data-templatename]', function(e) {
var templatename = $(this).data('templatename');
+ e.preventDefault();
loadTemplate(templatename);
});
* The ajax call has returned with a new list of templates.
*
* @method reloadListTemplate
- * @param String[] templates List of template ids.
+ * @param {String[]} templateList List of template ids.
*/
var reloadListTemplate = function(templateList) {
templates.render('tool_templatelibrary/search_results', { templates: templateList })
- .done(function (result, js) {
+ .done(function(result, js) {
templates.replaceNode($('[data-region="searchresults"]'), result, js);
}).fail(notification.exception);
};
* the function will only be executed once.
*
* @method queueRefresh
- * @param function callback
- * @param int delay The time in milliseconds to delay.
+ * @param {function} callback
+ * @param {Number} delay The time in milliseconds to delay.
*/
var queueRefresh = function(callback, delay) {
if (throttle !== null) {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../../../config.php');
+require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = optional_param('action', '', PARAM_ALPHANUMEXT);
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
- $doc->load(dirname(__FILE__).'/../generate_documentation/xmldb.xsl');
+ $doc->load(__DIR__.'/../generate_documentation/xmldb.xsl');
$xsl->importStyleSheet($doc);
$dbdirs = get_db_directories();
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
- $doc->load(dirname(__FILE__).'/xmldb.xsl');
+ $doc->load(__DIR__.'/xmldb.xsl');
$xsl->importStyleSheet($doc);
$doc->load($path);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-require_once(dirname(__FILE__) . '/../config.php');
+require_once(__DIR__ . '/../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/tablelib.php');
case 3: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_delete.php');
case 4: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_display.php');
case 5: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_download.php');
- //case 6: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_enrol.php'); //TODO: MDL-24064
case 7: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_forcepasswordchange.php');
case 8: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_cohortadd.php');
}
+++ /dev/null
-<?php
-/**
-* script for bulk user multi enrol operations
-*/
-
-die('this needs to be rewritten to use new enrol framework, sorry'); //TODO: MDL-24064
-
-require_once('../../config.php');
-require_once($CFG->libdir.'/adminlib.php');
-$processed = optional_param('processed', '', PARAM_BOOL);
-$sort = optional_param('sort', 'fullname', PARAM_ALPHA); //Sort by full name
-$dir = optional_param('dir', 'asc', PARAM_ALPHA); //Order to sort (ASC)
-
-require_login();
-admin_externalpage_setup('userbulk');
-require_capability('moodle/role:assign', context_system::instance()); //TODO: use some enrol cap
-$return = $CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk.php'