Skip to content

Commit 574911c

Browse files
committed
Add main files
1 parent 3d14c7a commit 574911c

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

README.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1+
# Featured courses #
2+
3+
A block to push forward a set of courses from the global list of courses.
4+
5+
## License ##
6+
7+
2020 CALL Learning <[email protected]>
8+
9+
This program is free software: you can redistribute it and/or modify it under
10+
the terms of the GNU General Public License as published by the Free Software
11+
Foundation, either version 3 of the License, or (at your option) any later
12+
version.
13+
14+
This program is distributed in the hope that it will be useful, but WITHOUT ANY
15+
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16+
PARTICULAR PURPOSE. See the GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License along with
19+
this program. If not, see <http://www.gnu.org/licenses/>.
120

block_featured_courses.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function init() {
4343
$this->title = get_string('title', 'block_featured_courses');
4444
}
4545

46-
4746
/**
4847
* Update the block title from config values
4948
*/

classes/output/featured_courses.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,14 @@ protected function get_other_values(renderer_base $output) {
8484
$courseimage = $output->get_generated_image_for_id($this->data->id);
8585
}
8686
$coursecategory = \core_course_category::get($this->data->category, MUST_EXIST, true);
87+
$urlparam = array('id' => $this->data->id);
88+
$courseurl = new moodle_url('/course/view.php', $urlparam);
89+
if (class_exists('\\local_syllabus\\locallib\utils')) {
90+
$courseurl = \local_syllabus\locallib\utils::get_syllabus_page_url($urlparam);
91+
}
8792
return array(
8893
'fullnamedisplay' => get_course_display_name_for_list($this->data),
89-
'viewurl' => (new moodle_url('/course/view.php', array('id' => $this->data->id)))->out(false),
94+
'viewurl' => $courseurl->out(false),
9095
'courseimage' => $courseimage,
9196
'showshortname' => $CFG->courselistshortnames ? true : false,
9297
'coursecategory' => $coursecategory->name

edit_form.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ protected function specific_definition($mform) {
4747
$mform->setDefault('config_title', get_string('title', 'block_featured_courses'));
4848
$mform->setType('config_title', PARAM_TEXT);
4949

50-
51-
$courses = (core_course_category::get(0))->get_courses(['recursive'=>true]);
50+
$courses = (core_course_category::get(0))->get_courses(['recursive' => true]);
5251
$courseitems = [];
5352
foreach ($courses as $c) {
5453
$courseitems[$c->id] = $c->get_formatted_name();

0 commit comments

Comments
 (0)