Proyectos de Subversion Moodle

Rev

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

Rev 254 Rev 255
Línea 3... Línea 3...
3
 
3
 
4
class StaticsBlocks extends Cesa
4
class StaticsBlocks extends Cesa
5
{
5
{
6
    public function __construct($title)
6
    public function __construct($title)
-
 
7
    {
-
 
8
        global $USER, $PAGE, $SITE;
-
 
9
        require_login(null, false);
-
 
10
 
-
 
11
        if (isguestuser()) {
-
 
12
            throw new require_login_exception('Guests are not allowed here.');
-
 
13
        }
-
 
14
 
-
 
15
        $this->userID = optional_param('userid', $USER->id, PARAM_INT);
-
 
16
        $this->currentUser = $this->userID == $USER->id;
-
 
17
        $this->user = core_user::get_user($this->userID);
-
 
18
        $this->title = get_string($title);
7
    {
19
        $this->blockManager = $PAGE->blocks;
8
        // Ahora pasamos un array de varios bloques en lugar de un solo bloque
20
        $this->regionName = 'side-pre'; // Puedes cambiar la región si lo necesitas
-
 
21
        $this->blockNames = ['cesa_course_rating', 'comments', 'messageteacher'];
-
 
22
        $this->blockExists = true;
-
 
23
 
-
 
24
        if (!$this->user || !core_user::is_real_user($this->userID)) {
-
 
25
            throw new moodle_exception('invaliduser', 'error');
9
        parent::__construct($title, ['cesa_course_rating', 'comments', 'messageteacher'], 'side-pre');
26
        }
Línea 10... Línea 27...
10
    }
27
    }
11
 
28
 
12
    public function renderBlocks()
29
    public function renderBlocks()