forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-63337-master' of git://github.com/bmbrands/moodle
- Loading branch information
Showing
56 changed files
with
1,604 additions
and
1,845 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// 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, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Javascript to initialise the myoverview block. | ||
* | ||
* @package block_myoverview | ||
* @copyright 2018 Bas Brands <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
define( | ||
[ | ||
'jquery', | ||
'block_myoverview/view', | ||
'block_myoverview/view_nav' | ||
], | ||
function( | ||
$, | ||
View, | ||
ViewNav | ||
) { | ||
|
||
var SELECTORS = { | ||
COURSES_VIEW: '[data-region="courses-view"]', | ||
COURSES_VIEW_CONTENT: '[data-region="course-view-content"]' | ||
}; | ||
/** | ||
* Initialise all of the modules for the overview block. | ||
* | ||
* @param {object} root The root element for the overview block. | ||
*/ | ||
var init = function(root) { | ||
root = $(root); | ||
var coursesViewRoot = root.find(SELECTORS.COURSES_VIEW); | ||
var coursesViewContent = root.find(SELECTORS.COURSES_VIEW_CONTENT); | ||
// Initialise the course navigation elements. | ||
ViewNav.init(root, coursesViewRoot, coursesViewContent); | ||
// Initialise the courses view modules. | ||
View.init(coursesViewRoot, coursesViewContent); | ||
}; | ||
|
||
return { | ||
init: init | ||
}; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// 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, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* A javascript module to retrieve enrolled coruses from the server. | ||
* | ||
* @package block_myoverview | ||
* @copyright 2018 Bas Brands <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
define(['core/ajax'], function(Ajax) { | ||
|
||
/** | ||
* Retrieve a list of enrolled courses. | ||
* | ||
* Valid args are: | ||
* string classification future, inprogress, past | ||
* int limit number of records to retreive | ||
* int Offset offset for pagination | ||
* int sort sort by lastaccess or name | ||
* | ||
* @method getEnrolledCoursesByTimeline | ||
* @param {object} args The request arguments | ||
* @return {promise} Resolved with an array of courses | ||
*/ | ||
var getEnrolledCoursesByTimeline = function(args) { | ||
|
||
var request = { | ||
methodname: 'core_course_get_enrolled_courses_by_timeline_classification', | ||
args: args | ||
}; | ||
|
||
var promise = Ajax.call([request])[0]; | ||
|
||
return promise; | ||
}; | ||
|
||
return { | ||
getEnrolledCoursesByTimeline: getEnrolledCoursesByTimeline | ||
}; | ||
}); |
Oops, something went wrong.