Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1234
Línea 1... Línea 1...
1
<?php
1
<?php
2
 
-
 
3
 
-
 
4
defined('MOODLE_INTERNAL') || die();
2
defined('MOODLE_INTERNAL') || die();
Línea 5... Línea -...
5
 
-
 
6
 
-
 
7
 
3
 
-
 
4
class block_cesa_lastcourse extends block_base
8
class block_cesa_lastcourse extends block_base {
5
{
-
 
6
    public function init()
9
    public function init() {
7
    {
10
        $this->title = get_string('pluginname', 'block_cesa_lastcourse');
8
        $this->title = get_string('pluginname', 'block_cesa_lastcourse');
11
    }
9
    }
12
    
10
 
13
    // if you have a settings.php file
11
    // if you have a settings.php file
14
    public function has_config()
12
    public function has_config()
15
    {
13
    {
16
        return false;
14
        return false;
17
    }
15
    }
18
    
16
 
19
    public function hide_header()
17
    public function hide_header()
20
    {
18
    {
21
        return true;
19
        return true;
22
    }
20
    }
23
    
21
 
24
    public function instance_allow_multiple()
22
    public function instance_allow_multiple()
25
    {
23
    {
26
        return false;
24
        return false;
Línea 27... Línea 25...
27
    }
25
    }
28
 
26
 
29
    public function get_content() {
27
    public function get_content()
30
        
28
    {
31
        if (isset($this->content)) {
29
        if (isset($this->content)) {
32
            return $this->content;
30
            return $this->content;
33
        } else {
31
        } else {
34
            $this->content = new \stdClass();
-
 
35
        }
32
            $this->content = new \stdClass();
36
        
33
        }
37
        
34
 
38
        $renderer = $this->page->get_renderer('block_cesa_lastcourse');
35
        $renderer = $this->page->get_renderer('block_cesa_lastcourse');
39
        $this->content = new stdClass();
36
        $this->content = new stdClass();
40
        $this->content->text = $renderer->procesar();
-
 
41
        return $this->content;
-
 
42
        
-
 
43
       
37
        $this->content->text = $renderer->procesar();
44
 
38
        return $this->content;