Faster block_method_result(), my back-of-the-envelope benchmarks say that
[moodle.git] / blocks / moodleblock.class.php
CommitLineData
56e29ea0 1<?php // $Id$
0f3fe4b6 2
c7e3bc51 3/**
67677908 4 * This file contains the parent class for moodle blocks, block_base,
5 * as well as the block_nuke subclass.
c7e3bc51 6 *
7 * @author Jon Papaioannou
8 * @version $Id$
9 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
10 * @package blocks
11 */
12
13/// Constants
14
15/**
16 * Block type of list. Contents of block should be set as an associative array in the content object as items ($this->content->items). Optionally include footer text in $this->content->footer.
17 */
0f3fe4b6 18define('BLOCK_TYPE_LIST', 1);
c7e3bc51 19
20/**
21 * Block type of text. Contents of block should be set to standard html text in the content object as items ($this->content->text). Optionally include footer text in $this->content->footer.
22 */
0f3fe4b6 23define('BLOCK_TYPE_TEXT', 2);
c7e3bc51 24
25/**
26 * Block type of nuke. Compitibility with post nuke blocks. Basically treated as BLOCK_TYPE_TEXT.
27 */
828c4e09 28define('BLOCK_TYPE_NUKE', 3);
0f3fe4b6 29
c7e3bc51 30/**
e0134f84 31 * Class for describing a moodle block, all Moodle blocks derive from this class
c7e3bc51 32 *
33 * @author Jon Papaioannou
34 * @package blocks
35 */
e89d741a 36class block_base {
c7e3bc51 37
38 /**
39 * Internal var for storing/caching translated strings
40 * @var string $str
41 */
0f3fe4b6 42 var $str;
c7e3bc51 43
44 /**
f8582e3e 45 * The title of the block to be displayed in the block title area.
c7e3bc51 46 * @var string $title
47 */
9b4b78fd 48 var $title = NULL;
c7e3bc51 49
c7e3bc51 50 /**
51 * The type of content that this block creates. Currently support options - BLOCK_TYPE_LIST, BLOCK_TYPE_TEXT, BLOCK_TYPE_NUKE
52 * @var int $content_type
53 */
3ef642d9 54 var $content_type = BLOCK_TYPE_TEXT;
c7e3bc51 55
56 /**
57 * An object to contain the information to be displayed in the block.
58 * @var stdObject $content
59 */
9b4b78fd 60 var $content = NULL;
c7e3bc51 61
62 /**
1345403a 63 * A string generated by {@link _add_edit_controls()} to display block manipulation links when the user is in editing mode.
c7e3bc51 64 * @var string $edit_controls
65 */
0f3fe4b6 66 var $edit_controls = NULL;
c7e3bc51 67
68 /**
69 * The current version that the block type defines.
70 * @var string $version
71 */
9b4b78fd 72 var $version = NULL;
c7e3bc51 73
74 /**
75 * The initialized instance of this block object.
76 * @var block $instance
77 */
9b4b78fd 78 var $instance = NULL;
c7e3bc51 79
80 /**
81 * An object containing the instance configuration information for the current instance of this block.
82 * @var stdObject $config
83 */
9b4b78fd 84 var $config = NULL;
85
c7e3bc51 86
e0134f84 87/// Class Functions
c7e3bc51 88
89 /**
90 * The class constructor
91 *
92 */
e89d741a 93 function block_base() {
9b4b78fd 94 $this->init();
95 }
0f3fe4b6 96
73554752 97 /**
98 * Fake constructor to keep PHP5 happy
99 *
100 */
101 function __construct() {
e89d741a 102 $this->block_base();
73554752 103 }
104
c7e3bc51 105 /**
106 * Returns the block name, as present in the class name,
107 * the database, the block directory, etc etc.
108 *
109 * @return string
110 */
0f3fe4b6 111 function name() {
112 // Returns the block name, as present in the class name,
113 // the database, the block directory, etc etc.
114 static $myname;
c7e3bc51 115 if ($myname === NULL) {
0f3fe4b6 116 $myname = strtolower(get_class($this));
117 $myname = substr($myname, strpos($myname, '_') + 1);
118 }
119 return $myname;
120 }
121
c7e3bc51 122 /**
123 * Parent class version of this function simply returns NULL
124 * This should be implemented by the derived class to return
125 * the content object.
126 *
127 * @return stdObject
128 */
0f3fe4b6 129 function get_content() {
130 // This should be implemented by the derived class.
131 return NULL;
132 }
c7e3bc51 133
134 /**
135 * Returns the class $title var value.
136 *
137 * Intentionally doesn't check if a title is set.
138 * This is already done in {@link _self_test()}
139 *
140 * @return string $this->title
141 */
0f3fe4b6 142 function get_title() {
6195e04a 143 // Intentionally doesn't check if a title is set. This is already done in _self_test()
0f3fe4b6 144 return $this->title;
145 }
c7e3bc51 146
147 /**
148 * Returns the class $content_type var value.
149 *
150 * Intentionally doesn't check if content_type is set.
151 * This is already done in {@link _self_test()}
152 *
153 * @return string $this->content_type
154 */
0f3fe4b6 155 function get_content_type() {
6195e04a 156 // Intentionally doesn't check if a content_type is set. This is already done in _self_test()
0f3fe4b6 157 return $this->content_type;
158 }
c7e3bc51 159
160 /**
161 * Returns the class $version var value.
162 *
163 * Intentionally doesn't check if a version is set.
164 * This is already done in {@link _self_test()}
165 *
166 * @return string $this->version
167 */
0f3fe4b6 168 function get_version() {
6195e04a 169 // Intentionally doesn't check if a version is set. This is already done in _self_test()
0f3fe4b6 170 return $this->version;
171 }
c7e3bc51 172
3ef642d9 173 /**
174 * Returns true or false, depending on whether this block has any content to display
175 *
176 * @return boolean
177 */
178 function is_empty() {
179 $this->get_content();
180 return(empty($this->content->text) && empty($this->content->footer));
181 }
182
c7e3bc51 183 /**
184 * First sets the current value of $this->content to NULL
185 * then calls the block's {@link get_content()} function
186 * to set its value back.
187 *
188 * @return stdObject
189 */
0f3fe4b6 190 function refresh_content() {
191 // Nothing special here, depends on content()
192 $this->content = NULL;
193 return $this->get_content();
194 }
c7e3bc51 195
196 /**
197 * Display the block!
198 */
1345403a 199 function _print_block() {
3ef642d9 200 // is_empty() includes a call to get_content()
201 if ($this->is_empty()) {
202 if (empty($this->edit_controls)) {
203 // No content, no edit controls, so just shut up
76a8339a 204 return;
3ef642d9 205 } else {
206 // No content but editing, so show something at least
207 $this->_print_shadow();
208 }
209 } else {
210 if ($this->hide_header() && empty($this->edit_controls)) {
211 // Header wants to hide, no edit controls to show, so no header it is
212 print_side_block(NULL, $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
213 } else {
214 // The full treatment, please
c4d951e1 215 print_side_block($this->_title_html(), $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
3ef642d9 216 }
0f3fe4b6 217 }
218 }
c7e3bc51 219
220 /**
221 * Block contents are missing. Simply display an empty block so that
222 * edit controls are accessbile to the user and they are aware that this
223 * block is in place, even if empty.
224 */
1345403a 225 function _print_shadow() {
c4d951e1 226 print_side_block($this->_title_html(), '&nbsp;', NULL, NULL, '', array('class' => 'hidden'));
227 }
228
229
230 function _title_html() {
231 global $CFG;
232
233 $title = '<div class="title">';
234
235 if (!empty($CFG->allowuserblockhiding)) {
236 $title .= '<div class="hide-show"><a href="#" onclick="elementToggleHide(this, true, function(el) {return findParentNode(el, \'DIV\', \'sideblock\'); } ); return false;"><img src="'.$CFG->pixpath.'/spacer.gif" alt="" class="hide-show-image" /></a></div>';
237 }
238
239 $title .= $this->title;
240
c7e3bc51 241 if ($this->edit_controls !== NULL) {
0f3fe4b6 242 $title .= $this->edit_controls;
243 }
c4d951e1 244
245 $title .= '</div>';
246
247 return $title;
0f3fe4b6 248 }
89adb174 249
c7e3bc51 250 /**
251 * Sets class $edit_controls var with correct block manipulation links.
252 *
253 * @uses $CFG
c7e3bc51 254 * @uses $USER
255 * @param stdObject $options ?
256 * @todo complete documenting this function. Define $options.
257 */
1345403a 258 function _add_edit_controls($options) {
0705dcc0 259 global $CFG, $USER;
0f3fe4b6 260
0f3fe4b6 261 if (!isset($this->str)) {
262 $this->str->delete = get_string('delete');
263 $this->str->moveup = get_string('moveup');
264 $this->str->movedown = get_string('movedown');
265 $this->str->moveright = get_string('moveright');
266 $this->str->moveleft = get_string('moveleft');
267 $this->str->hide = get_string('hide');
268 $this->str->show = get_string('show');
9b4b78fd 269 $this->str->configure = get_string('configuration');
0f3fe4b6 270 }
271
96803c88 272 $movebuttons = '<div class="commands">';
0f3fe4b6 273
c7e3bc51 274 if ($this->instance->visible) {
0f3fe4b6 275 $icon = '/t/hide.gif';
276 $title = $this->str->hide;
c7e3bc51 277 } else {
0f3fe4b6 278 $icon = '/t/show.gif';
279 $title = $this->str->show;
280 }
281
4374ee2c 282 if (empty($this->instance->pageid)) {
283 $this->instance->pageid = 0;
284 }
9b128500 285 $page = page_create_object($this->instance->pagetype, $this->instance->pageid);
f032aa7a 286 $script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey));
9b4b78fd 287
5a46b156 288 $movebuttons .= '<a class="icon hide" title="'. $title .'" href="'.$script.'&amp;blockaction=toggle">' .
0705dcc0 289 '<img src="'. $CFG->pixpath.$icon .'" alt="'.$title.'" /></a>';
0f3fe4b6 290
c7e3bc51 291 if ($options & BLOCK_CONFIGURE) {
5a46b156 292 $movebuttons .= '<a class="icon edit" title="'. $this->str->configure .'" href="'.$script.'&amp;blockaction=config">' .
0705dcc0 293 '<img src="'. $CFG->pixpath .'/t/edit.gif" alt="'. $this->str->configure .'" /></a>';
9b4b78fd 294 }
295
5a46b156 296 $movebuttons .= '<a class="icon delete" title="'. $this->str->delete .'" href="'.$script.'&amp;blockaction=delete">' .
297 '<img src="'. $CFG->pixpath .'/t/delete.gif" alt="'. $this->str->delete .'" /></a>';
0f3fe4b6 298
299 if ($options & BLOCK_MOVE_LEFT) {
5a46b156 300 $movebuttons .= '<a class="icon left" title="'. $this->str->moveleft .'" href="'.$script.'&amp;blockaction=moveleft">' .
0705dcc0 301 '<img src="'. $CFG->pixpath .'/t/left.gif" alt="'. $this->str->moveleft .'" /></a>';
0f3fe4b6 302 }
303 if ($options & BLOCK_MOVE_UP) {
5a46b156 304 $movebuttons .= '<a class="icon up" title="'. $this->str->moveup .'" href="'.$script.'&amp;blockaction=moveup">' .
0705dcc0 305 '<img src="'. $CFG->pixpath .'/t/up.gif" alt="'. $this->str->moveup .'" /></a>';
0f3fe4b6 306 }
307 if ($options & BLOCK_MOVE_DOWN) {
5a46b156 308 $movebuttons .= '<a class="icon down" title="'. $this->str->movedown .'" href="'.$script.'&amp;blockaction=movedown">' .
0705dcc0 309 '<img src="'. $CFG->pixpath .'/t/down.gif" alt="'. $this->str->movedown .'" /></a>';
0f3fe4b6 310 }
311 if ($options & BLOCK_MOVE_RIGHT) {
5a46b156 312 $movebuttons .= '<a class="icon right" title="'. $this->str->moveright .'" href="'.$script.'&amp;blockaction=moveright">' .
0705dcc0 313 '<img src="'. $CFG->pixpath .'/t/right.gif" alt="'. $this->str->moveright .'" /></a>';
0f3fe4b6 314 }
315
316 $movebuttons .= '</div>';
317 $this->edit_controls = $movebuttons;
318 }
319
c7e3bc51 320 /**
321 * Tests if this block has been implemented correctly.
322 * Also, $errors isn't used right now
323 *
324 * @return boolean
325 */
326
0f3fe4b6 327 function _self_test() {
328 // Tests if this block has been implemented correctly.
329 // Also, $errors isn't used right now
330 $errors = array();
331
332 $correct = true;
c7e3bc51 333 if ($this->get_title() === NULL) {
0f3fe4b6 334 $errors[] = 'title_not_set';
335 $correct = false;
336 }
c7e3bc51 337 if (!in_array($this->get_content_type(), array(BLOCK_TYPE_LIST, BLOCK_TYPE_TEXT, BLOCK_TYPE_NUKE))) {
0f3fe4b6 338 $errors[] = 'invalid_content_type';
339 $correct = false;
340 }
c7e3bc51 341 if ($this->get_content() === NULL) {
0f3fe4b6 342 $errors[] = 'content_not_set';
343 $correct = false;
344 }
c7e3bc51 345 if ($this->get_version() === NULL) {
0f3fe4b6 346 $errors[] = 'version_not_set';
347 $correct = false;
348 }
2b0d60ec 349
350 $formats = $this->applicable_formats();
c7e3bc51 351 if (empty($formats) || array_sum($formats) === 0) {
8a47e075 352 $errors[] = 'no_formats';
0f3fe4b6 353 $correct = false;
354 }
2b0d60ec 355
0f3fe4b6 356 $width = $this->preferred_width();
c7e3bc51 357 if (!is_int($width) || $width <= 0) {
0f3fe4b6 358 $errors[] = 'invalid_width';
359 $correct = false;
360 }
361 return $correct;
362 }
363
c7e3bc51 364 /**
365 * Subclasses should override this and return true if the
366 * subclass block has a config_global.html file.
367 *
368 * @return boolean
369 */
0f3fe4b6 370 function has_config() {
371 return false;
372 }
c7e3bc51 373
374 /**
375 * Default behavior: print the config_global.html file
376 * You don't need to override this if you're satisfied with the above
377 *
378 * @uses $CFG
c7e3bc51 379 * @return boolean
380 */
f8582e3e 381 function config_print() {
9b4b78fd 382 // Default behavior: print the config_global.html file
c7e3bc51 383 // You don't need to override this if you're satisfied with the above
384 if (!$this->has_config()) {
9b4b78fd 385 return false;
386 }
0705dcc0 387 global $CFG;
388 print_simple_box_start('center', '', '', 5, 'blockconfigglobal');
59b29207 389 include($CFG->dirroot.'/blocks/'. $this->name() .'/config_global.html');
9b4b78fd 390 print_simple_box_end();
391 return true;
0f3fe4b6 392 }
59b29207 393
c7e3bc51 394 /**
395 * Default behavior: save all variables as $CFG properties
396 * You don't need to override this if you 're satisfied with the above
397 *
f8582e3e 398 * @param array $data
c7e3bc51 399 * @return boolean
400 */
f8582e3e 401 function config_save($data) {
9b4b78fd 402 // Default behavior: save all variables as $CFG properties
403 // You don't need to override this if you 're satisfied with the above
f8582e3e 404 foreach ($data as $name => $value) {
9b4b78fd 405 set_config($name, $value);
406 }
407 return true;
0f3fe4b6 408 }
59b29207 409
c7e3bc51 410 /**
411 * Default case: the block can be used in all course types
412 * @return array
413 * @todo finish documenting this function
414 */
0f3fe4b6 415 function applicable_formats() {
d232b8c7 416 // Default case: the block can be used in courses and site index, but not in activities
5d3715d4 417 return array('all' => true, 'mod' => false);
0f3fe4b6 418 }
59b29207 419
c7e3bc51 420
421 /**
422 * Default case: the block wants to be 180 pixels wide
423 * @return int
424 */
0f3fe4b6 425 function preferred_width() {
426 // Default case: the block wants to be 180 pixels wide
427 return 180;
428 }
59b29207 429
c7e3bc51 430 /**
431 * Default return is false - header will be shown
432 * @return boolean
433 */
0f3fe4b6 434 function hide_header() {
4e60e777 435 //Default, false--> the header is shown
0f3fe4b6 436 return false;
437 }
c7e3bc51 438
439 /**
440 * Default case: just an id for the block, with our name in it
441 * @return array
442 * @todo finish documenting this function
443 */
c5507e52 444 function html_attributes() {
d232b8c7 445 // Default case: an id with the instance and a class with our name in it
29ba5158 446 return array('id' => 'inst'.$this->instance->id, 'class' => 'block_'. $this->name());
c5507e52 447 }
59b29207 448
c7e3bc51 449 /**
450 * Given an instance set the class var $instance to it and
451 * load class var $config
452 * @param block $instance
453 * @todo add additional documentation to further explain the format of instance and config
454 */
1345403a 455 function _load_instance($instance) {
c7e3bc51 456 if (!empty($instance->configdata)) {
9b4b78fd 457 $this->config = unserialize(base64_decode($instance->configdata));
458 }
673c1b2f 459 // [pj] This line below is supposed to be an optimization (we don't need configdata anymore)
460 // but what it does is break in PHP5 because the same instance object will be passed to
461 // this function twice in each page view, and the second time it won't have any configdata
462 // so it won't work correctly. Thus it's commented out.
463 // unset($instance->configdata);
9b4b78fd 464 $this->instance = $instance;
465 $this->specialization();
466 }
59b29207 467
43038ce6 468 /**
469 * This function is called on your subclass right after an instance is loaded
470 * Use this function to act on instance data just after it's loaded and before anything else is done
67677908 471 * For instance: if your block will have different title's depending on location (site, course, blog, etc)
43038ce6 472 */
9b4b78fd 473 function specialization() {
474 // Just to make sure that this method exists.
9b4b78fd 475 }
476
c7e3bc51 477 /**
f032aa7a 478 * Is each block of this type going to have instance-specific configuration?
479 * Normally, this setting is controlled by {@link instance_allow_multiple}: if multiple
480 * instances are allowed, then each will surely need its own configuration. However, in some
481 * cases it may be necessary to provide instance configuration to blocks that do not want to
482 * allow multiple instances. In that case, make this function return true.
483 * I stress again that this makes a difference ONLY if {@link instance_allow_multiple} returns false.
484 * @return boolean
485 * @todo finish documenting this function by explaining per-instance configuration further
486 */
487 function instance_allow_config() {
488 return false;
489 }
490
491 /**
492 * Are you going to allow multiple instances of each block?
c7e3bc51 493 * If yes, then it is assumed that the block WILL USE per-instance configuration
494 * @return boolean
495 * @todo finish documenting this function by explaining per-instance configuration further
496 */
9b4b78fd 497 function instance_allow_multiple() {
498 // Are you going to allow multiple instances of each block?
499 // If yes, then it is assumed that the block WILL USE per-instance configuration
500 return false;
501 }
59b29207 502
c7e3bc51 503 /**
504 * Default behavior: print the config_instance.html file
505 * You don't need to override this if you're satisfied with the above
506 *
507 * @uses $CFG
c7e3bc51 508 * @return boolean
509 * @todo finish documenting this function
510 */
9b4b78fd 511 function instance_config_print() {
512 // Default behavior: print the config_instance.html file
e1b8bdf8 513 // You don't need to override this if you're satisfied with the above
f032aa7a 514 if (!$this->instance_allow_multiple() && !$this->instance_allow_config()) {
9b4b78fd 515 return false;
516 }
0705dcc0 517 global $CFG;
9b4b78fd 518
c7e3bc51 519 if (is_file($CFG->dirroot .'/blocks/'. $this->name() .'/config_instance.html')) {
0705dcc0 520 print_simple_box_start('center', '', '', 5, 'blockconfiginstance');
6195e04a 521 include($CFG->dirroot .'/blocks/'. $this->name() .'/config_instance.html');
9b4b78fd 522 print_simple_box_end();
6195e04a 523 } else {
9b4b78fd 524 notice(get_string('blockconfigbad'), str_replace('blockaction=', 'dummy=', qualified_me()));
525 }
526
527 return true;
528 }
c7e3bc51 529
530 /**
531 * Serialize and store config data
532 * @return boolean
533 * @todo finish documenting this function
534 */
0d6b9d4f 535 function instance_config_save($data,$pinned=false) {
9b4b78fd 536 $data = stripslashes_recursive($data);
537 $this->config = $data;
0d6b9d4f 538 $table = 'block_instance';
539 if (!empty($pinned)) {
540 $table = 'block_pinned';
541 }
542 return set_field($table, 'configdata', base64_encode(serialize($data)), 'id', $this->instance->id);
9b4b78fd 543 }
544
0144a0a7 545 /**
546 * Replace the instance's configuration data with those currently in $this->config;
547 * @return boolean
548 * @todo finish documenting this function
549 */
0d6b9d4f 550 function instance_config_commit($pinned=false) {
551 $table = 'block_instance';
552 if (!empty($pinned)) {
553 $table = 'block_pinned';
554 }
555 return set_field($table, 'configdata', base64_encode(serialize($this->config)), 'id', $this->instance->id);
0144a0a7 556 }
557
b33dd23a 558 /**
559 * Do any additional initialization you may need at the time a new block instance is created
560 * @return boolean
561 * @todo finish documenting this function
562 */
563 function instance_create() {
564 return true;
565 }
566
567 /**
568 * Delete everything related to this instance if you have been using persistent storage other than the configdata field.
569 * @return boolean
570 * @todo finish documenting this function
571 */
572 function instance_delete() {
573 return true;
574 }
575
0f3fe4b6 576}
577
c7e3bc51 578/**
3ef642d9 579 * Specialized class for displaying a block with a list of icons/text labels
580 *
581 * @author Jon Papaioannou
582 * @package blocks
583 */
584
585class block_list extends block_base {
586 var $content_type = BLOCK_TYPE_LIST;
587
588 function is_empty() {
589 $this->get_content();
590 return (empty($this->content->items) && empty($this->content->footer));
591 }
592
593 function _print_block() {
3ef642d9 594 // is_empty() includes a call to get_content()
595 if ($this->is_empty()) {
596 if (empty($this->edit_controls)) {
597 // No content, no edit controls, so just shut up
76a8339a 598 return;
3ef642d9 599 } else {
600 // No content but editing, so show something at least
601 $this->_print_shadow();
602 }
603 } else {
604 if ($this->hide_header() && empty($this->edit_controls)) {
605 // Header wants to hide, no edit controls to show, so no header it is
606 print_side_block(NULL, '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
607 } else {
608 // The full treatment, please
c4d951e1 609 print_side_block($this->_title_html(), '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
3ef642d9 610 }
611 }
612 }
613
614}
615
616/**
617 * Class for supporting a phpnuke style block as a moodle block
c7e3bc51 618 *
619 * @author Jon Papaioannou
620 * @package blocks
621 */
e89d741a 622class block_nuke extends block_base {
3ef642d9 623
624 var $content_type = BLOCK_TYPE_NUKE;
625
828c4e09 626 function get_content() {
627
c7e3bc51 628 if ($this->content !== NULL) {
d4950608 629 return $this->content;
630 }
828c4e09 631
632 global $CFG;
d4950608 633 $this->content = &New stdClass;
634
635 // This whole thing begs to be written for PHP >= 4.3.0 using glob();
59b29207 636 $dir = $CFG->dirroot .'/blocks/'. $this->name() .'/nuke/';
c7e3bc51 637 if ($dh = @opendir($dir)) {
828c4e09 638 while (($file = readdir($dh)) !== false) {
639 $regs = array();
c7e3bc51 640 if (ereg('^block\-(.*)\.php$', $file, $regs)) {
d4950608 641 // Found it! Let's prepare the environment...
828c4e09 642
d4950608 643 $oldvals = array();
c7e3bc51 644 if (isset($GLOBALS['admin'])) {
d4950608 645 $oldvals['admin'] = $GLOBALS['admin'];
646 }
647
648 $GLOBALS['admin'] = isteacher($this->course->id);
828c4e09 649 @include($dir.$file);
d4950608 650
651 foreach($oldvals as $key => $val) {
652 $GLOBALS[$key] = $val;
653 }
828c4e09 654
655 // We should have $content set now
c7e3bc51 656 if (!isset($content)) {
828c4e09 657 return NULL;
658 }
659 return $this->content->text = $content;
660 }
661 }
662 }
d4950608 663
664 // If we reached here, we couldn't find the nuke block for some reason
665 return $this->content->text = get_string('blockmissingnuke');
828c4e09 666 }
667}
668
73554752 669?>