Proyectos de Subversion Moodle

Rev

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

Rev 263 Rev 264
Línea 53... Línea 53...
53
        $PAGE->set_context(context_user::instance($this->userID));
53
        $PAGE->set_context(context_user::instance($this->userID));
54
        $PAGE->set_pagelayout('mydashboard');
54
        $PAGE->set_pagelayout('mydashboard');
55
        $PAGE->set_title("{$SITE->shortname}: " . $this->title);
55
        $PAGE->set_title("{$SITE->shortname}: " . $this->title);
56
    }
56
    }
Línea 57... Línea -...
57
 
-
 
58
    public function __construct_statics_blocks($title, $blockNames, $regionName)
-
 
59
    {
-
 
60
        global $USER, $PAGE, $SITE;
-
 
61
        require_login(null, false);
-
 
62
 
-
 
63
        if (isguestuser()) {
-
 
64
            throw new require_login_exception('Guests are not allowed here.');
-
 
65
        }
-
 
66
 
-
 
67
        $this->userID = optional_param('userid', $USER->id, PARAM_INT);
-
 
68
        $this->currentUser = $this->userID == $USER->id;
-
 
69
        $this->user = core_user::get_user($this->userID);
-
 
70
        $this->title = get_string($title);
-
 
71
        $this->blockManager = $PAGE->blocks;
-
 
72
        $this->regionName = $regionName;
-
 
73
        $this->blockNames = is_array($blockNames) ? $blockNames : [$blockNames];
-
 
74
        $this->blockExists = true;
-
 
75
 
-
 
76
        if (!$this->user || !core_user::is_real_user($this->userID)) {
-
 
77
            throw new moodle_exception('invaliduser', 'error');
-
 
78
        }
-
 
79
    }
-
 
80
 
57
 
81
    public function addRegion()
58
    public function addRegion()
82
    {
59
    {
83
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
60
        if (!in_array($this->regionName, $this->blockManager->get_regions())) {
84
            $this->blockManager->add_region($this->regionName);
61
            $this->blockManager->add_region($this->regionName);