AC_4897, AC_4898, AC_4899: Multifile uploader fixes.
[acontent.git] / include / classes / Weblinks / WeblinksExport.class.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2009                                                                              */
6 /* Adaptive Technology Resource Centre / University of Toronto  */
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: WeblinksExport.class.php 8119 2008-10-29 13:53:06Z hwong $
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_utf8($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(TR_INCLUDE_PATH.'classes/Weblinks/Weblinks.tmpl.php');
52
53                 return $xml;
54         }
55 }
56 ?>