-
Notifications
You must be signed in to change notification settings - Fork 6
/
block_sence.php
executable file
·59 lines (45 loc) · 1.26 KB
/
block_sence.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
<?php
/**
* File containing Sence Module Block class.
*
* @package block_sence
* @copyright 2020 onwards Felipe Uzcátegui
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once('engine.php');
class block_sence extends block_base {
public $alumnos, $codigo_sence;
public function init() {
$this->title = get_string('pluginname', 'block_sence');
}
function has_config() {
return true;
}
function instance_allow_config() {
return true;
}
public function instance_allow_multiple() {
return false;
}
public function get_content() {
if ($this->content !== null) {
return $this->content;
}
$sence = new Engine();
$this->content = new stdClass;
$this->content->text = $sence->content();
$this->content->footer = $sence->get_footer();
return $this->content;
}
public function instance_delete(){
global $DB, $COURSE;
$DB->delete_records('block_sence', ['courseid' => $COURSE->id ] );
}
public function applicable_formats() {
return array(
'course-view' => true,
'all' => false,
);
}
}