688cc1648bfe22f8fff562b0d6b5beb4c2494ce0
[atutor.git] / docs / mods / _core / imscc / classes / DiscussionTools.class.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2009                                                                              */
6 /* Inclusive Design Institute                                   */
7 /* http://atutor.ca                                                                                             */
8 /*                                                              */
9 /* This program is free software. You can redistribute it and/or*/
10 /* modify it under the terms of the GNU General Public License  */
11 /* as published by the Free Software Foundation.                                */
12 /****************************************************************/
13 // $Id$
14
15 /**
16  * A class for DiscussionTools
17  * based on:
18  *  http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_5/imsdt_v1p0_localised.xsd
19  */
20 class DiscussionTools {
21         //global variables
22         var $title = '';        //The Forum title
23         var $text = '';         //The description of the discussion tools.
24
25         //constructor
26         function DiscussionTools($title, $text){
27                 $this->title = $title;
28                 $this->text = $text;
29         }
30
31         function getTitle(){
32                 return htmlspecialchars(trim($this->title));
33         }
34
35         function getText(){
36                 //change the $IMS-CC-FILEBASE$ to the base of this directory
37                 //TODO: The returned value may contains HTML, ATutor doesn't check 
38                 //              if it contains malicious javascript at this point.
39                 $this->text = preg_replace('/\$IMS\-CC\-FILEBASE\$/', '', $this->text);
40                 return trim(html_entity_decode($this->text));
41         }
42 }
43 ?>