forked from ponlawat-w/moodle-block_hubcourseranking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock_hubcourseranking.php
65 lines (54 loc) · 1.4 KB
/
block_hubcourseranking.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
defined('MOODLE_INTERNAL') || die();
class block_hubcourseranking extends block_base {
public function init() {
$this->title = (isset($this->config) && isset($this->config->title)) ?
$this->config->title : get_string('pluginname', 'block_hubcourseranking');
$this->version = 2020010800;
}
public function has_config() {
return false;
}
public function instance_can_be_hidden() {
return false;
}
public function instance_allow_multiple() {
return true;
}
public function applicable_formats() {
return [
'all' => false,
'my' => true,
'site' => true
];
}
public function get_content() {
global $PAGE;
$PAGE->requires->jquery();
$PAGE->requires->js(new moodle_url('/blocks/hubcourseranking/script.js'));
$PAGE->requires->strings_for_js([
'coursename',
'uploadeddate',
'downloads',
'reviews',
'ratings',
'loadmore',
'loading'
], 'block_hubcourseranking');
if (isset($this->config)) {
$this->title = $this->config->title;
$this->content = new stdClass();
$this->content->text = html_writer::div(
get_string('loading', 'block_hubcourseranking'),
'block-hubcourseranking-body',
[
'data-id' => $this->instance->id,
]
);
}
return $this->content;
}
public function get_aria_role() {
return 'navigation';
}
}