blocks editing ui: MDL-19398 Remove stupid pass by reference.
[moodle.git] / blocks / moodleblock.class.php
CommitLineData
56e29ea0 1<?php // $Id$
0f3fe4b6 2
c7e3bc51 3/**
ccd3dd0c 4 * This file contains the parent class for moodle blocks, block_base.
c7e3bc51 5 *
c7e3bc51 6 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
7 * @package blocks
8 */
9
10/// Constants
11
12/**
13 * 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.
14 */
0f3fe4b6 15define('BLOCK_TYPE_LIST', 1);
c7e3bc51 16
17/**
18 * 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.
19 */
0f3fe4b6 20define('BLOCK_TYPE_TEXT', 2);
c7e3bc51 21
c7e3bc51 22/**
e0134f84 23 * Class for describing a moodle block, all Moodle blocks derive from this class
c7e3bc51 24 *
25 * @author Jon Papaioannou
26 * @package blocks
27 */
e89d741a 28class block_base {
c7e3bc51 29
30 /**
31 * Internal var for storing/caching translated strings
32 * @var string $str
33 */
0f3fe4b6 34 var $str;
c7e3bc51 35
36 /**
f8582e3e 37 * The title of the block to be displayed in the block title area.
c7e3bc51 38 * @var string $title
39 */
9b4b78fd 40 var $title = NULL;
c7e3bc51 41
c7e3bc51 42 /**
ccd3dd0c 43 * The type of content that this block creates. Currently support options - BLOCK_TYPE_LIST, BLOCK_TYPE_TEXT
c7e3bc51 44 * @var int $content_type
45 */
3ef642d9 46 var $content_type = BLOCK_TYPE_TEXT;
c7e3bc51 47
48 /**
49 * An object to contain the information to be displayed in the block.
50 * @var stdObject $content
51 */
9b4b78fd 52 var $content = NULL;
c7e3bc51 53
54 /**
1345403a 55 * A string generated by {@link _add_edit_controls()} to display block manipulation links when the user is in editing mode.
c7e3bc51 56 * @var string $edit_controls
57 */
0f3fe4b6 58 var $edit_controls = NULL;
c7e3bc51 59
60 /**
61 * The current version that the block type defines.
62 * @var string $version
63 */
9b4b78fd 64 var $version = NULL;
c7e3bc51 65
66 /**
67 * The initialized instance of this block object.
68 * @var block $instance
69 */
9b4b78fd 70 var $instance = NULL;
c7e3bc51 71
3179b000 72 /**
73 * The page that this block is appearing on.
74 * @var moodle_page
75 */
76 public $page = NULL;
77
e92c286c 78 /**
79 * This blocks's context.
80 * @var stdClass
81 */
82 public $context = NULL;
83
c7e3bc51 84 /**
85 * An object containing the instance configuration information for the current instance of this block.
86 * @var stdObject $config
87 */
9b4b78fd 88 var $config = NULL;
89
f9648e77 90 /**
91 * How often the cronjob should run, 0 if not at all.
92 * @var int $cron
93 */
94
95 var $cron = NULL;
96
e0134f84 97/// Class Functions
c7e3bc51 98
99 /**
100 * The class constructor
101 *
102 */
e89d741a 103 function block_base() {
9b4b78fd 104 $this->init();
105 }
0f3fe4b6 106
73554752 107 /**
108 * Fake constructor to keep PHP5 happy
109 *
110 */
111 function __construct() {
e89d741a 112 $this->block_base();
73554752 113 }
44c55d46 114
44c55d46 115 /**
116 * Function that can be overridden to do extra cleanup before
117 * the database tables are deleted. (Called once per block, not per instance!)
118 */
119 function before_delete() {
120 }
a82e9bc3 121
122 /**
123 * Function that can be overridden to do extra setup after a block instance has been
124 * restored from backup. For example, it may need to alter any dates that the block
125 * stores, if the $restore->course_startdateoffset is set.
126 */
127 function after_restore($restore) {
128 }
73554752 129
b486ef1a 130 /**
5cfefc9b 131 * Enable custom instance data section in backup and restore.
b486ef1a 132 *
133 * If return true, then {@link instance_backup()} and
134 * {@link instance_restore()} will be called during
135 * backup/restore routines.
136 *
137 * @return boolean
138 **/
5cfefc9b 139 function backuprestore_instancedata_used() {
b486ef1a 140 return false;
141 }
142
143 /**
144 * Allows the block class to have a backup routine. Handy
145 * when the block has its own tables that have foreign keys to
146 * other tables (example: user table).
147 *
148 * Note: at the time of writing this comment, the indent level
149 * for the {@link full_tag()} should start at 5.
150 *
151 * @param resource $bf Backup File
152 * @param object $preferences Backup preferences
153 * @return boolean
154 **/
155 function instance_backup($bf, $preferences) {
156 return true;
157 }
158
159 /**
160 * Allows the block class to restore its backup routine.
161 *
162 * Should not return false if data is empty
163 * because old backups would not contain block instance backup data.
164 *
165 * @param object $restore Standard restore object
166 * @param object $data Object from backup_getid for this block instance
167 * @return boolean
168 **/
169 function instance_restore($restore, $data) {
170 return true;
171 }
172
43457dc8 173 /**
174 * Will be called before an instance of this block is backed up, so that any links in
5cfefc9b 175 * in config can be encoded. For example config->text, for the HTML block
176 * @return string
43457dc8 177 */
5cfefc9b 178 function get_backup_encoded_config() {
179 return base64_encode(serialize($this->config));
43457dc8 180 }
181
182 /**
5cfefc9b 183 * Return the content encoded to support interactivities linking. This function is
184 * called automatically from the backup procedure by {@link backup_encode_absolute_links()}.
43457dc8 185 *
5cfefc9b 186 * NOTE: There is no block instance when this method is called.
187 *
188 * @param string $content Content to be encoded
189 * @param object $restore Restore preferences object
190 * @return string The encoded content
191 **/
192 function encode_content_links($content, $restore) {
193 return $content;
194 }
195
196 /**
197 * This function makes all the necessary calls to {@link restore_decode_content_links_worker()}
198 * function in order to decode contents of this block from the backup
199 * format to destination site/course in order to mantain inter-activities
200 * working in the backup/restore process.
201 *
202 * This is called from {@link restore_decode_content_links()} function in the restore process.
203 *
204 * NOTE: There is no block instance when this method is called.
205 *
206 * @param object $restore Standard restore object
207 * @return boolean
208 **/
209 function decode_content_links_caller($restore) {
210 return true;
211 }
212
213 /**
214 * Return content decoded to support interactivities linking.
215 * This is called automatically from
216 * {@link restore_decode_content_links_worker()} function
217 * in the restore process.
218 *
219 * NOTE: There is no block instance when this method is called.
220 *
221 * @param string $content Content to be dencoded
222 * @param object $restore Restore preferences object
223 * @return string The dencoded content
224 **/
225 function decode_content_links($content, $restore) {
226 return $content;
43457dc8 227 }
228
c7e3bc51 229 /**
230 * Returns the block name, as present in the class name,
231 * the database, the block directory, etc etc.
232 *
233 * @return string
234 */
0f3fe4b6 235 function name() {
236 // Returns the block name, as present in the class name,
237 // the database, the block directory, etc etc.
238 static $myname;
c7e3bc51 239 if ($myname === NULL) {
0f3fe4b6 240 $myname = strtolower(get_class($this));
241 $myname = substr($myname, strpos($myname, '_') + 1);
242 }
243 return $myname;
244 }
245
c7e3bc51 246 /**
247 * Parent class version of this function simply returns NULL
248 * This should be implemented by the derived class to return
249 * the content object.
250 *
251 * @return stdObject
252 */
0f3fe4b6 253 function get_content() {
254 // This should be implemented by the derived class.
255 return NULL;
256 }
c7e3bc51 257
258 /**
259 * Returns the class $title var value.
260 *
261 * Intentionally doesn't check if a title is set.
262 * This is already done in {@link _self_test()}
263 *
264 * @return string $this->title
265 */
0f3fe4b6 266 function get_title() {
6195e04a 267 // Intentionally doesn't check if a title is set. This is already done in _self_test()
0f3fe4b6 268 return $this->title;
269 }
c7e3bc51 270
271 /**
272 * Returns the class $content_type var value.
273 *
274 * Intentionally doesn't check if content_type is set.
275 * This is already done in {@link _self_test()}
276 *
277 * @return string $this->content_type
278 */
0f3fe4b6 279 function get_content_type() {
6195e04a 280 // Intentionally doesn't check if a content_type is set. This is already done in _self_test()
0f3fe4b6 281 return $this->content_type;
282 }
c7e3bc51 283
284 /**
285 * Returns the class $version var value.
286 *
287 * Intentionally doesn't check if a version is set.
288 * This is already done in {@link _self_test()}
289 *
290 * @return string $this->version
291 */
0f3fe4b6 292 function get_version() {
6195e04a 293 // Intentionally doesn't check if a version is set. This is already done in _self_test()
0f3fe4b6 294 return $this->version;
295 }
c7e3bc51 296
3ef642d9 297 /**
298 * Returns true or false, depending on whether this block has any content to display
7e874772 299 * and whether the user has permission to view the block
3ef642d9 300 *
301 * @return boolean
302 */
303 function is_empty() {
e92c286c 304 if ( !has_capability('moodle/block:view', $this->context) ) {
7e874772 305 return true;
306 }
307
3ef642d9 308 $this->get_content();
309 return(empty($this->content->text) && empty($this->content->footer));
310 }
311
c7e3bc51 312 /**
313 * First sets the current value of $this->content to NULL
314 * then calls the block's {@link get_content()} function
315 * to set its value back.
316 *
317 * @return stdObject
318 */
0f3fe4b6 319 function refresh_content() {
320 // Nothing special here, depends on content()
321 $this->content = NULL;
322 return $this->get_content();
323 }
c7e3bc51 324
325 /**
d4a03c00 326 * Return a block_contents oject representing the full contents of this block.
327 *
328 * This internally calls ->get_content(), and then adds the editing controls etc.
329 *
330 * You probably should not override this method, but instead override
331 * {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()},
332 * {@link hide_header()}, {@link (get_edit_controls)}, etc.
333 *
334 * @return block_contents a represntation of the block, for rendering.
335 * @since Moodle 2.0.
c7e3bc51 336 */
d4a03c00 337 public function get_content_for_output($output) {
338 global $CFG;
0a0bb380 339
d4a03c00 340 $bc = new block_contents();
341 $bc->blockinstanceid = $this->instance->id;
342 $bc->blockpositionid = $this->instance->blockpositionid;
c7e3bc51 343
d4a03c00 344 $attributes = $this->html_attributes();
345 if (isset($attributes['id'])) {
346 $bc->id = $attributes['id'];
347 unset($attributes['id']);
348 }
349 if (isset($attributes['class'])) {
350 $bc->set_classes($attributes['class']);
351 unset($attributes['class']);
352 }
353 $bc->attributes = $attributes;
c4d951e1 354
d4a03c00 355 if (!$this->hide_header()) {
356 $bc->title = $this->title;
357 }
ae42ff6f 358
359 if ($this->instance->visible) {
360 $bc->content = $this->formatted_contents($output);
361 if (!empty($this->content->footer)) {
362 $bc->footer = $this->content->footer;
363 }
bc422e69 364 } else {
365 $bc->add_class('invisible');
d4a03c00 366 }
c4d951e1 367
d4a03c00 368 if ($this->page->user_is_editing()) {
1936f20b 369 $bc->controls = block_edit_controls($this, $this->page);
d4a03c00 370 }
c4d951e1 371
f674ec86 372 if ($this->is_empty() && !$bc->controls) {
373 return null;
374 }
375
ae42ff6f 376 if (empty($CFG->allowuserblockhiding) ||
377 (empty($bc->content) && empty($bc->footer))) {
d4a03c00 378 $bc->collapsible = block_contents::NOT_HIDEABLE;
379 } else if (get_user_preferences('block' . $bc->blockinstanceid . 'hidden', false)) {
380 $bc->collapsible = block_contents::HIDDEN;
381 } else {
382 $bc->collapsible = block_contents::VISIBLE;
0f3fe4b6 383 }
c4d951e1 384
d4a03c00 385 $bc->annotation = ''; // TODO
386
387 return $bc;
0f3fe4b6 388 }
89adb174 389
c7e3bc51 390 /**
d4a03c00 391 * Convert the contents of the block to HTML.
c7e3bc51 392 *
d4a03c00 393 * This is used by block base classes like block_list to convert the structured
394 * $this->content->list and $this->content->icons arrays to HTML. So, in most
395 * blocks, you probaby want to override the {@link get_contents()} method,
396 * which generates that structured representation of the contents.
397 *
398 * @param $output The core_renderer to use when generating the output.
399 * @return string the HTML that should appearn in the body of the block.
400 * @since Moodle 2.0.
c7e3bc51 401 */
d4a03c00 402 protected function formatted_contents($output) {
403 $this->get_content();
404 if (!empty($this->content->text)) {
405 return $this->content->text;
406 } else {
407 return '';
408 }
409 }
410
c7e3bc51 411 /**
412 * Tests if this block has been implemented correctly.
413 * Also, $errors isn't used right now
414 *
415 * @return boolean
416 */
417
0f3fe4b6 418 function _self_test() {
419 // Tests if this block has been implemented correctly.
420 // Also, $errors isn't used right now
421 $errors = array();
422
423 $correct = true;
c7e3bc51 424 if ($this->get_title() === NULL) {
0f3fe4b6 425 $errors[] = 'title_not_set';
426 $correct = false;
427 }
ccd3dd0c 428 if (!in_array($this->get_content_type(), array(BLOCK_TYPE_LIST, BLOCK_TYPE_TEXT))) {
0f3fe4b6 429 $errors[] = 'invalid_content_type';
430 $correct = false;
431 }
17e5635c 432 //following selftest was not working when roles&capabilities were used from block
35a518c5 433/* if ($this->get_content() === NULL) {
0f3fe4b6 434 $errors[] = 'content_not_set';
435 $correct = false;
35a518c5 436 }*/
c7e3bc51 437 if ($this->get_version() === NULL) {
0f3fe4b6 438 $errors[] = 'version_not_set';
439 $correct = false;
440 }
2b0d60ec 441
442 $formats = $this->applicable_formats();
c7e3bc51 443 if (empty($formats) || array_sum($formats) === 0) {
8a47e075 444 $errors[] = 'no_formats';
0f3fe4b6 445 $correct = false;
446 }
2b0d60ec 447
0f3fe4b6 448 $width = $this->preferred_width();
c7e3bc51 449 if (!is_int($width) || $width <= 0) {
0f3fe4b6 450 $errors[] = 'invalid_width';
451 $correct = false;
452 }
453 return $correct;
454 }
455
c7e3bc51 456 /**
457 * Subclasses should override this and return true if the
458 * subclass block has a config_global.html file.
459 *
460 * @return boolean
461 */
0f3fe4b6 462 function has_config() {
463 return false;
464 }
c7e3bc51 465
c7e3bc51 466 /**
467 * Default behavior: save all variables as $CFG properties
468 * You don't need to override this if you 're satisfied with the above
469 *
f8582e3e 470 * @param array $data
c7e3bc51 471 * @return boolean
472 */
f8582e3e 473 function config_save($data) {
f8582e3e 474 foreach ($data as $name => $value) {
9b4b78fd 475 set_config($name, $value);
476 }
477 return true;
0f3fe4b6 478 }
59b29207 479
c7e3bc51 480 /**
481 * Default case: the block can be used in all course types
482 * @return array
483 * @todo finish documenting this function
484 */
0f3fe4b6 485 function applicable_formats() {
d232b8c7 486 // Default case: the block can be used in courses and site index, but not in activities
9591bc3c 487 return array('all' => true, 'mod' => false, 'tag' => false);
0f3fe4b6 488 }
59b29207 489
c7e3bc51 490
c7e3bc51 491 /**
492 * Default return is false - header will be shown
493 * @return boolean
494 */
0f3fe4b6 495 function hide_header() {
0f3fe4b6 496 return false;
497 }
c7e3bc51 498
499 /**
d4a03c00 500 * Return any HTML attributes that you want added to the outer <div> that
501 * of the block when it is output.
502 * @return array attribute name => value.
c7e3bc51 503 */
c5507e52 504 function html_attributes() {
2f747639 505 return array(
d4a03c00 506 'id' => 'inst' . $this->instance->id,
507 'class' => 'block_' . $this->name()
2f747639 508 );
c5507e52 509 }
d4a03c00 510
c7e3bc51 511 /**
512 * Given an instance set the class var $instance to it and
513 * load class var $config
514 * @param block $instance
515 * @todo add additional documentation to further explain the format of instance and config
516 */
3179b000 517 function _load_instance($instance, $page) {
c7e3bc51 518 if (!empty($instance->configdata)) {
9b4b78fd 519 $this->config = unserialize(base64_decode($instance->configdata));
520 }
9b4b78fd 521 $this->instance = $instance;
e92c286c 522 if (isset($instance->context)) {
523 $this->context = $instance->context;
524 } else {
525 $this->context = get_context_instance(CONTEXT_BLOCK, $instance->id);
526 }
3179b000 527 $this->page = $page;
9b4b78fd 528 $this->specialization();
529 }
59b29207 530
43038ce6 531 /**
532 * This function is called on your subclass right after an instance is loaded
533 * Use this function to act on instance data just after it's loaded and before anything else is done
67677908 534 * For instance: if your block will have different title's depending on location (site, course, blog, etc)
43038ce6 535 */
9b4b78fd 536 function specialization() {
537 // Just to make sure that this method exists.
9b4b78fd 538 }
539
c7e3bc51 540 /**
f032aa7a 541 * Is each block of this type going to have instance-specific configuration?
542 * Normally, this setting is controlled by {@link instance_allow_multiple}: if multiple
543 * instances are allowed, then each will surely need its own configuration. However, in some
544 * cases it may be necessary to provide instance configuration to blocks that do not want to
545 * allow multiple instances. In that case, make this function return true.
546 * I stress again that this makes a difference ONLY if {@link instance_allow_multiple} returns false.
547 * @return boolean
548 * @todo finish documenting this function by explaining per-instance configuration further
549 */
550 function instance_allow_config() {
551 return false;
552 }
553
554 /**
555 * Are you going to allow multiple instances of each block?
c7e3bc51 556 * If yes, then it is assumed that the block WILL USE per-instance configuration
557 * @return boolean
558 * @todo finish documenting this function by explaining per-instance configuration further
559 */
9b4b78fd 560 function instance_allow_multiple() {
561 // Are you going to allow multiple instances of each block?
562 // If yes, then it is assumed that the block WILL USE per-instance configuration
563 return false;
564 }
59b29207 565
c7e3bc51 566 /**
567 * Default behavior: print the config_instance.html file
568 * You don't need to override this if you're satisfied with the above
569 *
570 * @uses $CFG
c7e3bc51 571 * @return boolean
572 * @todo finish documenting this function
573 */
9b4b78fd 574 function instance_config_print() {
f28f2d90 575 global $CFG, $DB;
9b4b78fd 576 // Default behavior: print the config_instance.html file
e1b8bdf8 577 // You don't need to override this if you're satisfied with the above
f032aa7a 578 if (!$this->instance_allow_multiple() && !$this->instance_allow_config()) {
9b4b78fd 579 return false;
580 }
9b4b78fd 581
c7e3bc51 582 if (is_file($CFG->dirroot .'/blocks/'. $this->name() .'/config_instance.html')) {
0705dcc0 583 print_simple_box_start('center', '', '', 5, 'blockconfiginstance');
6195e04a 584 include($CFG->dirroot .'/blocks/'. $this->name() .'/config_instance.html');
9b4b78fd 585 print_simple_box_end();
6195e04a 586 } else {
9b4b78fd 587 notice(get_string('blockconfigbad'), str_replace('blockaction=', 'dummy=', qualified_me()));
588 }
589
590 return true;
591 }
c7e3bc51 592
593 /**
594 * Serialize and store config data
c7e3bc51 595 */
f474a4e5 596 function instance_config_save($data, $nolongerused = false) {
a5d424df 597 global $DB;
f474a4e5 598 $DB->set_field('block_instances', 'configdata', base64_encode(serialize($data)),
e03c0c1d 599 array('id' => $this->instance->id));
9b4b78fd 600 }
601
0144a0a7 602 /**
603 * Replace the instance's configuration data with those currently in $this->config;
604 * @return boolean
605 * @todo finish documenting this function
606 */
f474a4e5 607 function instance_config_commit($nolongerused = false) {
a5d424df 608 global $DB;
f474a4e5 609 $this->instance_config_save($this->config);
0144a0a7 610 }
611
d4a03c00 612 /**
b33dd23a 613 * Do any additional initialization you may need at the time a new block instance is created
614 * @return boolean
615 * @todo finish documenting this function
616 */
617 function instance_create() {
618 return true;
619 }
620
d4a03c00 621 /**
b33dd23a 622 * Delete everything related to this instance if you have been using persistent storage other than the configdata field.
623 * @return boolean
624 * @todo finish documenting this function
625 */
626 function instance_delete() {
627 return true;
628 }
629
d4a03c00 630 /**
11306331 631 * Allows the block class to have a say in the user's ability to edit (i.e., configure) blocks of this type.
632 * The framework has first say in whether this will be allowed (e.g., no editing allowed unless in edit mode)
633 * but if the framework does allow it, the block can still decide to refuse.
634 * @return boolean
635 * @todo finish documenting this function
636 */
637 function user_can_edit() {
638 return true;
639 }
640
d4a03c00 641 /**
11306331 642 * Allows the block class to have a say in the user's ability to create new instances of this block.
643 * The framework has first say in whether this will be allowed (e.g., no adding allowed unless in edit mode)
644 * but if the framework does allow it, the block can still decide to refuse.
645 * This function has access to the complete page object, the creation related to which is being determined.
646 * @return boolean
647 * @todo finish documenting this function
648 */
15a00b4b 649 function user_can_addto($page) {
11306331 650 return true;
651 }
652
f432bebf 653 function get_extra_capabilities() {
44df8fa9 654 return array('moodle/block:view');
f432bebf 655 }
d4a03c00 656
657 // Methods deprecated in Moodle 2.0 ========================================
658
659 /**
660 * Default case: the block wants to be 180 pixels wide
661 * @deprecated since Moodle 2.0.
662 * @return int
663 */
664 function preferred_width() {
665 return 180;
666 }
667
668 /** @deprecated since Moodle 2.0. */
669 function _print_block() {
670 throw new coding_exception('_print_block is no longer used. It was a private ' .
671 'method of the block class, only for use by the blocks system. You ' .
672 'should not have been calling it anyway.');
673 }
674
675 /** @deprecated since Moodle 2.0. */
676 function _print_shadow() {
677 throw new coding_exception('_print_shadow is no longer used. It was a private ' .
678 'method of the block class, only for use by the blocks system. You ' .
679 'should not have been calling it anyway.');
680 }
681
682 /** @deprecated since Moodle 2.0. */
683 function _title_html() {
684 throw new coding_exception('_title_html is no longer used. It was a private ' .
685 'method of the block class, only for use by the blocks system. You ' .
686 'should not have been calling it anyway.');
687 }
688
689 /** @deprecated since Moodle 2.0. */
690 function _add_edit_controls() {
691 throw new coding_exception('_add_edit_controls is no longer used. It was a private ' .
692 'method of the block class, only for use by the blocks system. You ' .
693 'should not have been calling it anyway.');
694 }
695
7cf51142 696 /** @deprecated since Moodle 2.0. */
697 function config_print() {
698 throw new coding_exception('config_print() can no longer be used. Blocks should use a settings.php file.');
699 }
0f3fe4b6 700}
701
c7e3bc51 702/**
3ef642d9 703 * Specialized class for displaying a block with a list of icons/text labels
704 *
d4a03c00 705 * The get_content method should set $this->content->items and (optionally)
706 * $this->content->icons, instead of $this->content->text.
707 *
3ef642d9 708 * @author Jon Papaioannou
709 * @package blocks
710 */
711
712class block_list extends block_base {
713 var $content_type = BLOCK_TYPE_LIST;
714
715 function is_empty() {
e92c286c 716 if ( !has_capability('moodle/block:view', $this->context) ) {
25a7d980 717 return true;
718 }
719
3ef642d9 720 $this->get_content();
721 return (empty($this->content->items) && empty($this->content->footer));
722 }
723
d4a03c00 724 protected function formatted_contents($output) {
725 $this->get_content();
726 if (!empty($this->content->items)) {
727 return $output->list_block_contents($this->content->icons, $this->content->items);
3ef642d9 728 } else {
d4a03c00 729 return '';
3ef642d9 730 }
731 }
3ef642d9 732}
733
d0b59e3b 734?>