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