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