Skip to content

Commit

Permalink
Merge branch 'MDL-63337-master' of git://github.com/bmbrands/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Oct 15, 2018
2 parents 4bc3f50 + 6481a21 commit 6bcf1e7
Show file tree
Hide file tree
Showing 56 changed files with 1,604 additions and 1,845 deletions.
1 change: 1 addition & 0 deletions blocks/myoverview/amd/build/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion blocks/myoverview/amd/build/paging_bar.min.js

This file was deleted.

1 change: 0 additions & 1 deletion blocks/myoverview/amd/build/paging_content.min.js

This file was deleted.

1 change: 1 addition & 0 deletions blocks/myoverview/amd/build/repository.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions blocks/myoverview/amd/build/view.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions blocks/myoverview/amd/build/view_nav.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions blocks/myoverview/amd/src/main.js
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
};
});
102 changes: 0 additions & 102 deletions blocks/myoverview/amd/src/paging_bar.js

This file was deleted.

105 changes: 0 additions & 105 deletions blocks/myoverview/amd/src/paging_content.js

This file was deleted.

53 changes: 53 additions & 0 deletions blocks/myoverview/amd/src/repository.js
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
};
});
Loading

0 comments on commit 6bcf1e7

Please sign in to comment.