Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 69... Línea 69...
69
     */
69
     */
70
    var $content_type  = BLOCK_TYPE_TEXT;
70
    var $content_type  = BLOCK_TYPE_TEXT;
Línea 71... Línea 71...
71
 
71
 
72
    /**
72
    /**
73
     * An object to contain the information to be displayed in the block.
73
     * An object to contain the information to be displayed in the block.
74
     * @var stdClass $content
74
     * @var stdClass|null $content
75
     */
75
     */
Línea 76... Línea 76...
76
    var $content       = NULL;
76
    var $content       = NULL;
77
 
77
 
Línea 86... Línea 86...
86
     * @var moodle_page
86
     * @var moodle_page
87
     */
87
     */
88
    public $page       = NULL;
88
    public $page       = NULL;
Línea 89... Línea 89...
89
 
89
 
90
    /**
90
    /**
91
     * This blocks's context.
91
     * This block's context.
92
     * @var context
92
     * @var context
93
     */
93
     */
Línea 94... Línea 94...
94
    public $context    = NULL;
94
    public $context    = NULL;
Línea 139... Línea 139...
139
    /**
139
    /**
140
     * Parent class version of this function simply returns NULL
140
     * Parent class version of this function simply returns NULL
141
     * This should be implemented by the derived class to return
141
     * This should be implemented by the derived class to return
142
     * the content object.
142
     * the content object.
143
     *
143
     *
144
     * @return stdObject
144
     * @return stdClass
145
     */
145
     */
146
    function get_content() {
146
    function get_content() {
147
        // This should be implemented by the derived class.
147
        // This should be implemented by the derived class.
148
        return NULL;
148
        return NULL;
149
    }
149
    }
Línea 165... Línea 165...
165
     * Returns the class $content_type var value.
165
     * Returns the class $content_type var value.
166
     *
166
     *
167
     * Intentionally doesn't check if content_type is set.
167
     * Intentionally doesn't check if content_type is set.
168
     * This is already done in {@link _self_test()}
168
     * This is already done in {@link _self_test()}
169
     *
169
     *
170
     * @return string $this->content_type
170
     * @return int $this->content_type
171
     */
171
     */
172
    function get_content_type() {
172
    function get_content_type() {
173
        // Intentionally doesn't check if a content_type is set. This is already done in _self_test()
173
        // Intentionally doesn't check if a content_type is set. This is already done in _self_test()
174
        return $this->content_type;
174
        return $this->content_type;
175
    }
175
    }
Línea 176... Línea 176...
176
 
176
 
177
    /**
177
    /**
178
     * Returns true or false, depending on whether this block has any content to display
178
     * Returns true or false, depending on whether this block has any content to display
179
     * and whether the user has permission to view the block
179
     * and whether the user has permission to view the block
180
     *
180
     *
181
     * @return boolean
181
     * @return bool
182
     */
182
     */
183
    function is_empty() {
183
    function is_empty() {
184
        if ( !has_capability('moodle/block:view', $this->context) ) {
184
        if ( !has_capability('moodle/block:view', $this->context) ) {
185
            return true;
185
            return true;
Línea 192... Línea 192...
192
    /**
192
    /**
193
     * First sets the current value of $this->content to NULL
193
     * First sets the current value of $this->content to NULL
194
     * then calls the block's {@link get_content()} function
194
     * then calls the block's {@link get_content()} function
195
     * to set its value back.
195
     * to set its value back.
196
     *
196
     *
197
     * @return stdObject
197
     * @return stdClass
198
     */
198
     */
199
    function refresh_content() {
199
    function refresh_content() {
200
        // Nothing special here, depends on content()
200
        // Nothing special here, depends on content()
201
        $this->content = NULL;
201
        $this->content = NULL;
202
        return $this->get_content();
202
        return $this->get_content();
Línea 209... Línea 209...
209
     *
209
     *
210
     * You probably should not override this method, but instead override
210
     * You probably should not override this method, but instead override
211
     * {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()},
211
     * {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()},
212
     * {@link hide_header()}, {@link (get_edit_controls)}, etc.
212
     * {@link hide_header()}, {@link (get_edit_controls)}, etc.
213
     *
213
     *
214
     * @return block_contents a representation of the block, for rendering.
214
     * @return block_contents|null a representation of the block, for rendering.
215
     * @since Moodle 2.0.
215
     * @since Moodle 2.0.
216
     */
216
     */
217
    public function get_content_for_output($output) {
217
    public function get_content_for_output($output) {
218
        global $CFG;
218
        global $CFG;