Proyectos de Subversion Moodle

Rev

Rev 1 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

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