remove old readme
[atutor.git] / mods / _core / imscc / classes / WeblinksExport.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 very simple class to generates a singular webcontent weblink xml file.
17  * Based on the namespace:
18  * http://www.imsglobal.org/profile/cc/ccv1p0/derived_schema/domainProfile_5/imswl_v1p0_localised.xsd
19  */
20 class WeblinksExport {
21         //Global Variables
22         var     $wl;    //weblink obj
23
24         /**
25          * Constructor
26          * @param       mixed   Weblink Object, ref Weblinks.class.php
27          */
28         function WeblinksExport($wl){
29                 $this->wl = $wl;
30         }
31
32
33         /** 
34          * Export
35          */
36         function export(){
37                 global $savant;
38
39                 //localize
40                 $wl = $this->wl;
41
42                 //assign all the neccessarily values to the template.
43                 $savant->assign('title', htmlentities($wl->getTitle(), ENT_QUOTES, 'UTF-8'));
44                 $url = $wl->getUrl();
45                 $savant->assign('url_href', urlencode($url['href']));
46                 $savant->assign('url_target', $url['target']);
47                 //TODO: not supported yet
48                 //$savant->assign('url_window_features', $url['window_features']);
49
50                 //generates xml
51                 $xml = $savant->fetch(AT_INCLUDE_PATH.'../mods/_core/imscc/classes/Weblinks.tmpl.php');
52
53                 return $xml;
54         }
55 }
56 ?>