24a56393e14a71c9c931c5758218d94486a660de
[acontent.git] / docs / home / ims / include / ims_template.inc.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 if (!defined('TR_INCLUDE_PATH')) { exit; }
14
15 // This function gets files from html tag @import
16 function get_import_files($text)
17 {
18         $text = strtolower($text);
19         $tag = '@import';
20         $files = array();
21         
22         while (strpos(strtolower($text), strtolower($tag)) > 0)
23         {
24                 $start_pos      = strpos($text, $tag);
25                 if ($start_pos !== false) 
26                 {
27                         $text = substr($text, $start_pos);
28                         $start_pos = strlen($tag);
29                         $len = strpos($text, ';') - strlen($tag);
30                         
31                         $file = substr(trim($text), $start_pos, $len);
32                         
33                         // remove these characters from file name: url, (, ), ", '
34                         $file = trim(preg_replace('/(\'|\"|url|\(|\))/', '', $file));
35                         
36                         // strip processed tag
37                         $text = substr($text, $start_pos);
38                         array_push($files, $file);
39                 }
40         
41         }
42         
43         return $files;
44 }
45         
46 function print_organizations($parent_id,
47                                                          &$_menu, 
48                                                          $depth, 
49                                                          $path='',
50                                                          $children,
51                                                          &$string) {
52         
53         global $html_content_template, $default_html_style, $zipfile, $resources, $ims_template_xml, $parser, $my_files;
54         global $used_glossary_terms, $course_id, $course_language_charset, $course_language_code;
55         static $paths, $zipped_files;
56         global $glossary;
57         global $test_zipped_files, $use_a4a, $db;
58
59         require_once(TR_INCLUDE_PATH.'../home/classes/ContentUtility.class.php');
60         
61         $space  = '    ';
62         $prefix = '                    ';
63
64         if ($depth == 0) {
65                 $string .= '<ul>';
66         }
67         $top_level = $_menu[$parent_id];
68         if (!is_array($paths)) {
69                 $paths = array();
70         }
71         if (!is_array($zipped_files)) {
72                 $zipped_files = array();
73         }
74         if ( is_array($top_level) ) {
75                 
76                 $counter = 1;
77                 $num_items = count($top_level);
78                
79                 foreach ($top_level as $garbage => $content) {
80                         $link = '';
81                                 
82                         if ($content['content_path']) {
83                                 $content['content_path'] .= '/';
84                         }
85                         //if this is a folder, export it without identifierref
86                         if ($content['content_type']==CONTENT_TYPE_FOLDER){
87                                 $link = $prevfix.'<item identifier="MANIFEST01_ITEM'.$content['content_id'].'">'."\n";
88                         } else {
89                                 $link = $prevfix.'<item identifier="MANIFEST01_ITEM'.$content['content_id'].'" identifierref="MANIFEST01_RESOURCE'.$content['content_id'].'" parameters="'.htmlentities($content['test_message'], ENT_QUOTES, 'UTF-8').'">'."\n";
90                         }
91                         $html_link = '<a href="resources/'.$content['content_path'].$content['content_id'].'.html" target="body">'.$content['title'].'</a>';    
92                         
93                         /* save the content as HTML files */
94                         /* @See: include/lib/format_content.inc.php */
95                         $content['text'] = str_replace('CONTENT_DIR/', '', $content['text']);
96
97                         /* Commented by Cindy Qi Li on Jan 12, 2010
98                          * AContent does not support glossary
99                         // get all the glossary terms used
100                         $terms = find_terms($content['text']);
101                         if (is_array($terms)) {
102                                 foreach ($terms[2] as $term) {
103                                         $used_glossary_terms[] = $term;
104                                 }
105                         }
106 */
107                         /** Test dependency **/
108 //                      $test_dependency = '';  //Template for test
109 //                      $sql = 'SELECT * FROM '.TABLE_PREFIX.'content_tests_assoc WHERE content_id='.$content['content_id'];
110 //                      $result = mysql_query($sql, $db);
111 //                      while ($row = mysql_fetch_assoc($result)){
112                         require_once(TR_INCLUDE_PATH.'classes/DAO/ContentTestsAssocDAO.class.php');
113                         $contentTestsAssocDAO = new ContentTestsAssocDAO();
114                         $rows = $contentTestsAssocDAO->getByContent($content['content_id']);
115                         if (is_array($rows)) {
116                                 //add test dependency on top of forum dependency
117                                 foreach ($rows as $row)
118                                         $test_dependency .= $prefix.$space.'<dependency identifierref="MANIFEST01_RESOURCE_QTI'.$row['test_id'].'" />';
119                         }
120
121                         /* calculate how deep this page is: */
122                         $path = '../';
123                         if ($content['content_path']) {
124                                 $depth = substr_count($content['content_path'], '/');
125
126                                 $path .= str_repeat('../', $depth);
127                         }
128                         
129                         $content['text'] = ContentUtility::formatContent($content['text'], $content['formatting']);
130
131                         /* add HTML header and footers to the files */
132                         
133                         /* use default style if <style> is not in imported html head */
134                         $head = '';
135                         if ($content['use_customized_head'])
136                         {
137                                 if (strpos(strtolower($content['head']), '<style') > 0)
138                                 {
139                                         $head = $content['head'];
140                                 }
141                                 else
142                                 {
143                                         if (strlen($content['head']) > 0)  
144                                                 $head = $content['head'] . $default_html_style;
145                                         else 
146                                                 $head = $default_html_style;
147                                 }
148                         }
149
150                         $content['text'] = str_replace( array('{TITLE}',        '{CONTENT}', '{KEYWORDS}', '{COURSE_PRIMARY_LANGUAGE_CHARSET}', '{COURSE_PRIMARY_LANGUAGE_CODE}', '{HEAD}'),
151                                                                         array($content['title'],        $content['text'], $content['keywords'], $course_language_charset, $course_language_code, $head),
152                                                                         $html_content_template);
153                                                                 
154                         /* duplicate the paths in the content_path field in the zip file */
155                         if ($content['content_path']) {
156                                 if (!in_array($content['content_path'], $paths)) {
157                                         $zipfile->create_dir('resources/'.$content['content_path'], time());
158                                         $paths[] = $content['content_path'];
159                                 }
160                         }
161
162                         $zipfile->add_file($content['text'], 'resources/'.$content['content_path'].$content['content_id'].'.html', $content['u_ts']);
163                         $content['title'] = htmlspecialchars($content['title']);
164
165                         /* add the resource dependancies */
166                         if ($my_files == null) $my_files = array();
167                         $content_files = "\n";
168                         $parser->parse($content['text']);
169
170                         /* generate the IMS QTI resource and files */
171                         global $contentManager;
172                         //check if test export is allowed.
173                         $content_test_rs = $contentManager->getContentTestsAssoc($content['content_id']);       
174                         $test_ids = array();            //reset test ids
175                         //$my_files = array();          //reset myfiles.
176                         if (is_array($content_test_rs)) {
177                                 foreach ($content_test_rs as $content_test_row){
178                                         //export
179                                         $test_ids[] = $content_test_row['test_id'];
180                                         //the 'added_files' is for adding into the manifest file in this zip
181                                         $added_files = test_qti_export($content_test_row['test_id'], '', $zipfile);
182         
183                                         //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
184                                         foreach($added_files as $filename=>$file_array){
185                                                 $my_files[] = $filename;
186                                                 foreach ($file_array as $garbage=>$filename2){
187                                                         if (!in_array($filename2, $my_files)){
188                                                                 $my_files[] = $filename2;
189                                                         }
190                                                 }
191                                         }
192         
193                                         //Save all the xml files in this array, and then print_organizations will add it to the manifest file.
194                                         $resources .= str_replace(      array('{TEST_ID}', '{PATH}', '{FILES}'),
195                                                                                                 array($content_test_row['test_id'], 'tests_'.$content_test_row['test_id'].'.xml', $added_files_xml),
196                                                                                                 $ims_template_xml['resource_test']); 
197                                 }
198                         }
199
200                         /* generate the a4a files */
201                         $a4a_xml_array = array();
202                         if ($use_a4a == true){
203                                 $a4aExport = new A4aExport($content['content_id']);
204 //                              $a4aExport->setRelativePath('resources/'.$content['content_path']);
205                                 $secondary_files = $a4aExport->getAllSecondaryFiles();
206                                 $a4a_xml_array = $a4aExport->exportA4a();
207                                 $my_files = array_merge($my_files, $a4aExport->getAllSecondaryFiles());
208                         }
209
210                         /* handle @import */
211                         $import_files = get_import_files($content['text']);
212
213                         if (count($import_files) > 0) $my_files = array_merge($my_files, $import_files);
214
215                         foreach ($my_files as $file) {
216                                 /* filter out full urls */
217                                 $url_parts = @parse_url($file);
218                                 if (isset($url_parts['scheme'])) {
219                                         continue;
220                                 }
221
222                                 /* file should be relative to content. let's double check */
223                                 if ((substr($file, 0, 1) == '/')) {
224                                         continue;
225                                 }
226
227                                 $file_path = realpath(TR_CONTENT_DIR . $course_id . '/' . $content['content_path'] . $file);
228
229                                 /* check if this file exists in the content dir, if not don't include it */
230                                 if (file_exists($file_path) &&  is_file($file_path) && !in_array($file_path, $zipped_files)) {
231                                         $zipped_files[] = $file_path;
232                                         $dir = substr(dirname($file_path), strlen(TR_CONTENT_DIR . $course_id));
233
234                                         if (!in_array($dir, $paths) && $dir) {
235                                                 $dir = str_replace('\\', '/', substr($dir, 1));
236                                                 $zipfile->create_dir('resources/' . $dir, time());
237                                                 
238                                                 $paths[] = $dir;
239                                         }
240
241                                         $file_info = stat( $file_path );
242
243                                         //Fixes relative paths, so folder1/folder2/../file.jpg will become just folder1/file.jpg
244                                         $file_save_path = str_replace(TR_CONTENT_DIR . $course_id . DIRECTORY_SEPARATOR, '', $file_path);
245                                         $file_save_path = str_replace('\\', '/', $file_save_path);
246
247                                         //condition checks if the file has been added, so then the test won't be added to all the subchildren
248                                         //leads to normal images not capable to be extracted.
249                                         if ( (empty($test_zipped_files) || (is_array($test_zipped_files) && !in_array($file_path, $test_zipped_files))) 
250                                                  && file_exists($file_path)){
251                                                 $zipfile->add_file(@file_get_contents($file_path), 'resources/' . $file_save_path, $file_info['mtime']);
252 //                                              $test_zipped_files[] = $content['content_path'] . $file;
253                                                 $test_zipped_files[] = $file_path;
254                                         } elseif (!is_array($test_zipped_files) && file_exists($file_path) && !in_array($file_path, $zipped_files)){
255                                                 $zipfile->add_file(@file_get_contents($file_path), 'resources/' . $file_save_path, $file_info['mtime']);
256                                         } 
257
258                                         //a4a secondary files have mapping, save the ones that we want in order to add the tag in
259                                         $a4a_secondary_files = array();
260                                         foreach ($a4a_xml_array as $a4a_filename=>$a4a_filearray){
261                                                 if (preg_match('/(.*)\sto\s(.*)/', $a4a_filename, $matches)){
262                                                         //save the actual file name
263                                                         $a4a_secondary_files[$matches[1]][] = $a4a_filename;    //values are holders
264                                                 }
265                                         }
266
267                                         // If this file has a4a alternatives, link it.
268                                         if (isset($a4a_xml_array[$file]) || isset($a4a_secondary_files[$file])){
269                                                 //if this is an array, meaning that it has more than 1 alternatives, print all
270                                                 if (is_array($a4a_secondary_files[$file])){
271                                                         $all_secondary_files_md = '';   //reinitialize string to null
272                                                         foreach ($a4a_secondary_files[$file] as $v){
273                                                                 foreach($a4a_xml_array[$v] as $v2){
274                                                                         $all_secondary_files_md .= $v2; //all the meta data             
275                                                                 }                                               
276                                                         }
277                                                         $content_files .= str_replace(  array('{FILE}', '{FILE_META_DATA}'), 
278                                                         array('resources/'.$file_save_path, $all_secondary_files_md), 
279                                                         $ims_template_xml['file_meta']);
280                                                 } else {        
281                                                         $content_files .= str_replace(  array('{FILE}', '{FILE_META_DATA}'), 
282                                                         array('resources/'.$file_save_path, $a4a_xml_array[$file]), 
283                                                         $ims_template_xml['file_meta']);
284                                                 }
285                                         } else {
286                                                 //if this file is in the test array, add an extra link to the direct file, 
287                                                 if (!empty($test_zipped_files) && in_array($file_path, $test_zipped_files)){
288                                                         $content_files .= str_replace('{FILE}', $file_save_path, $ims_template_xml['file']);
289                                                 } else {
290                                                         $content_files .= str_replace('{FILE}', $file_save_path, $ims_template_xml['file']);
291                                                 }
292                                         }
293                                 }
294
295                                 /* check if this file is one of the test xml file, if so, we need to add the dependency
296                                  * Note:  The file has already been added to the archieve before this is called.
297                                  */
298 /* taken out as of nov 17th, used dependency instead
299                                 if (preg_match('/tests\_[0-9]+\.xml$/', $file) && !in_array($file, $test_zipped_files)){
300                                         $content_files .= str_replace('{FILE}', $file, $ims_template_xml['xml']);
301                                         $test_zipped_files[] = $file;
302                                 }
303 */
304                         }
305
306                         /******************************/
307                         $resources .= str_replace(      array('{CONTENT_ID}', '{PATH}', '{FILES}', '{DEPENDENCY}'),
308                                                                                 array($content['content_id'], $content['content_path'], $content_files, $test_dependency),
309                                                                                 $ims_template_xml['resource']);
310
311
312                         for ($i=0; $i<$depth; $i++) {
313                                 $link .= $space;
314                         }
315                         
316                         $title = $prefix.$space.'<title>'.$content['title'].'</title>';
317
318                         if ( is_array($_menu[$content['content_id']]) ) {
319                                 /* has children */
320
321                                 $html_link = '<li>'.$html_link.'<ul>';
322                                 for ($i=0; $i<$depth; $i++) {
323                                         if ($children[$i] == 1) {
324                                                 echo $space;
325                                                 //$html_link = $space.$html_link;
326                                         } else {
327                                                 echo $space;
328                                                 //$html_link = $space.$html_link;
329                                         }
330                                 }
331
332                         } else {
333                                 /* doesn't have children */
334
335                                 $html_link = '<li>'.$html_link.'</li>';
336                                 if ($counter == $num_items) {
337                                         for ($i=0; $i<$depth; $i++) {
338                                                 if ($children[$i] == 1) {
339                                                         echo $space;
340                                                         //$html_link = $space.$html_link;
341                                                 } else {
342                                                         echo $space;
343                                                         //$html_link = $space.$html_link;
344                                                 }
345                                         }
346                                 } else {
347                                         for ($i=0; $i<$depth; $i++) {
348                                                 echo $space;
349                                                 //$html_link = $space.$html_link;
350                                         }
351                                 }
352                                 $title = $space.$title;
353                         }
354
355                         echo $prefix.$link;
356                         echo $title;
357                         echo "\n";
358
359                         $string .= $html_link."\n";
360
361                         $depth ++;
362                         print_organizations($content['content_id'],
363                                                                 $_menu, 
364                                                                 $depth, 
365                                                                 $path.$counter.'.', 
366                                                                 $children,
367                                                                 $string);
368                         $depth--;
369
370                         $counter++;
371                         for ($i=0; $i<$depth; $i++) {
372                                 echo $space;
373                         }
374                         echo $prefix.'</item>';
375                         echo "\n";
376                 }  
377
378                 $string .= '</ul>';
379                 if ($depth > 0) {
380                         $string .= '</li>';
381                 }
382
383         }
384 }
385
386 $ims_template_xml['header'] = '<?xml version="1.0" encoding="{COURSE_PRIMARY_LANGUAGE_CHARSET}"?>
387 <!--This is an ATutor SCORM 1.2 Content Package document-->
388 <!--Created from the ATutor Content Package Generator - http://www.atutor.ca-->
389 <manifest xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_rootv1p2p1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_rootv1p2" identifier="MANIFEST-'.md5(time()).'" 
390 xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 http://www.imsglobal.org/xsd/imscp_v1p1p4.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 http://www.imsglobal.org/xsd/imsmd_v1p2p2.xsd http://www.imsglobal.org/xsd/imsqti_item_v2p0 http://www.imsglobal.org/xsd/imsqti_item_v2p0.xsd" 
391 version = "CP 1.1.4">
392         <metadata>
393                 <schema>ADL SCORM</schema> 
394             <schemaversion>1.2</schemaversion>
395                 <imsmd:lom>
396                   <imsmd:general>
397                         <imsmd:title>
398                           <imsmd:langstring xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}">{COURSE_TITLE}</imsmd:langstring>
399                         </imsmd:title>
400                         <imsmd:description>
401                           <imsmd:langstring xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}">{COURSE_DESCRIPTION}</imsmd:langstring>
402                         </imsmd:description>
403                   </imsmd:general>
404                   <imsmd:lifecycle>
405                         <imsmd:contribute>
406                           <imsmd:role>
407                             <imsmd:source>
408                               <imsmd:langstring xml:lang="x-none">LOMv1.0</imsmd:langstring> 
409                             </imsmd:source>
410                             <imsmd:value>
411                               <imsmd:langstring xml:lang="x-none">Author</imsmd:langstring> 
412                             </imsmd:value>
413                           </imsmd:role>
414                           <imsmd:centity>
415                             <imsmd:vcard>{VCARD}</imsmd:vcard> 
416                           </imsmd:centity>
417                         </imsmd:contribute>
418                   </imsmd:lifecycle>
419                   <imsmd:educational>
420                         <imsmd:learningresourcetype>
421                           <imsmd:source>
422                                 <imsmd:langstring xml:lang="x-none">ATutor</imsmd:langstring>
423                           </imsmd:source>
424                           <imsmd:value>
425                                 <imsmd:langstring xml:lang="x-none">Content Module</imsmd:langstring>
426                           </imsmd:value>
427                         </imsmd:learningresourcetype>
428                   </imsmd:educational>
429                   <imsmd:rights>
430                   </imsmd:rights>
431                 </imsmd:lom>
432         </metadata>
433 ';
434
435 $ims_template_xml['resource'] = '               <resource identifier="MANIFEST01_RESOURCE{CONTENT_ID}" type="webcontent" href="resources/{PATH}{CONTENT_ID}.html"  adlcp:scormtype="asset">
436                         <metadata/>
437                         <file href="resources/{PATH}{CONTENT_ID}.html"/>{FILES}
438                         {DEPENDENCY}
439                 </resource>
440 '."\n";
441 $ims_template_xml['resource_test'] = '          <resource identifier="MANIFEST01_RESOURCE_QTI{TEST_ID}" type="imsqti_xmlv1p2/imscc_xmlv1p0/assessment">
442                         <metadata/>
443                         <file href="{PATH}"/>{FILES}
444                 </resource>
445 '."\n";
446
447 $ims_template_xml['file'] = '                   <file href="resources/{FILE}"/>'."\n";
448 $ims_template_xml['xml'] = '                    <file href="{FILE}"/>'."\n";
449 $ims_template_xml['file_meta'] = '                      <file href="{FILE}">
450                                 <metadata>
451                                 {FILE_META_DATA}
452                                 </metadata>
453                         </file>'."\n";
454 $ims_template_xml['final'] = '
455         <organizations default="MANIFEST01_ORG1">
456                 <organization identifier="MANIFEST01_ORG1" structure="hierarchical">
457                         <title>{COURSE_TITLE}</title>
458 {ORGANIZATIONS}
459                 </organization>
460         </organizations>
461         <resources>
462 {RESOURCES}
463         </resources>
464 </manifest>';
465
466 $html_template = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
467     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
468 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
469 <head>
470         <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
471         <style type="text/css">
472         body { font-family: Verdana, Arial, Helvetica, sans-serif;}
473         a.at-term {     font-style: italic; }
474         </style>
475         <title>{TITLE}</title>
476         <meta name="Generator" content="ATutor">
477         <meta name="Keywords" content="{KEYWORDS}">
478 </head>
479 <body>{CONTENT}</body>
480 </html>';
481
482 $html_content_template = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
483     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
484 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
485 <head>
486         <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
487         {HEAD}
488         <title>{TITLE}</title>
489         <meta name="Generator" content="ATutor">
490         <meta name="Keywords" content="{KEYWORDS}">
491 </head>
492 <body>{CONTENT}</body>
493 </html>';
494
495 $default_html_style = ' <style type="text/css">
496         body { font-family: Verdana, Arial, Helvetica, sans-serif;}
497         a.at-term {     font-style: italic; }
498         </style>';
499         
500 //output this as header.html
501 $html_mainheader = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
502     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
503 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
504 <head>
505         <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
506         <link rel="stylesheet" type="text/css" href="ims.css"/>
507         <title>{COURSE_TITLE}</title>
508 </head>
509 <body class="headerbody"><h3>{COURSE_TITLE}</h3></body></html>';
510
511
512 $html_toc = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
513     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
514 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
515 <head>
516         <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
517         <link rel="stylesheet" type="text/css" href="ims.css" />
518         <title></title>
519 </head>
520 <body>{TOC}</body></html>';
521
522 // index.html
523 $html_frame = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
524    "http://www.w3.org/TR/html4/frameset.dtd">
525 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{COURSE_PRIMARY_LANGUAGE_CODE}" lang="{COURSE_PRIMARY_LANGUAGE_CODE}">
526         <meta http-equiv="Content-Type" content="text/html; charset={COURSE_PRIMARY_LANGUAGE_CHARSET}" />
527         <title>{COURSE_TITLE}</title>
528 </head>
529 <frameset rows="50,*,50">
530 <frame src="header.html" name="header" title="header" scrolling="no">
531         <frameset cols="25%, *" frameborder="1" framespacing="3">
532                 <frame frameborder="2" marginwidth="0" marginheight="0" src="toc.html" name="frame" title="TOC">
533                 <frame frameborder="2" src="resources/{PATH}{FIRST_ID}.html" name="body" title="{COURSE_TITLE}">
534         </frameset>
535 <frame src="footer.html" name="footer" title="footer" scrolling="no">
536         <noframes>
537                 <h1>{COURSE_TITLE}</h1>
538       <p><a href="toc.html">Table of Contents</a> | <a href="footer.html">About</a><br />
539           </p>
540   </noframes>
541 </frameset>
542 </html>';
543
544
545
546 $glossary_xml = '<?xml version="1.0" encoding="{COURSE_PRIMARY_LANGUAGE_CHARSET}"?>
547 <!--This is an ATutor Glossary terms document-->
548 <!--Created from the ATutor Content Package Generator - http://www.atutor.ca-->
549
550 <!DOCTYPE glossary [
551    <!ELEMENT item (term, definition)>
552    <!ELEMENT term (#PCDATA)>
553    <!ELEMENT definition (#PCDATA)>
554 ]>
555
556 <glossary>
557       {GLOSSARY_TERMS}
558 </glossary>
559 ';
560
561 $glossary_term_xml = '  <item>
562                 <term>{TERM}</term>
563                 <definition>{DEFINITION}</definition>
564         </item>';
565
566 $glossary_body_html = '<h2>Glossary</h2>
567         <ul>
568 {BODY}
569 </ul>';
570
571 $glossary_term_html = ' <li><a name="{ENCODED_TERM}"></a><strong>{TERM}</strong><br />
572                 {DEFINITION}<br /><br /></li>';
573
574 ?>