move code up one directory
[atutor.git] / documentation / common / print.php
1 <?php require(dirname(__FILE__) . '/vitals.inc.php'); ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html lang="<?php echo $req_lang; ?>">
4 <head>
5         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6         <title><?php get_text('doc_title'); ?></title>
7         <link rel="stylesheet" href="styles.css" type="text/css" />
8 </head>
9 <body>
10 <?php
11 require('../'.$section.'/pages.inc.php');
12
13 echo '<a href="../'.$section.'/index.php?'.$req_lang.'" target="_top">';
14 get_text('back_to_chapters');
15 echo '</a>';
16
17 foreach ($_pages as $file => $title) {
18         if (($req_lang != 'en') && (file_exists('../'.$section.'/'.$req_lang.'/'.$file))) {
19                 $string = file_get_contents('../'.$section.'/'.$req_lang.'/'.$file);
20         } else if ($req_lang != 'en') {
21                 ?>
22                 <div style="margin: 20px auto; border: 1px solid #aaf; padding: 4px; text-align: center; background-color: #eef;">
23                         <?php get_text('page_not_translated'); ?>
24                 </div>
25                 <?php
26                 $string = file_get_contents('../'.$section.'/'.$file);
27         } else {
28                 $string = file_Get_contents('../'.$section.'/'.$file);
29         }
30         
31         $patterns = array('#<a href="(?!http)([[:alnum:].?/_-]+)"([^>]*)>([^<]+)</a>#is',
32                                           '#<a href="http://([[:alnum:]./_-]+)"([^>]*)>([^<]+)</a>#i');
33
34         $replacements = array('<strong><u>$3</u></strong>',
35                                                   '<strong><u>$3</u></strong> [$1]');
36
37         echo preg_replace($patterns, $replacements, $string);
38 }
39 ?>
40 </body>
41 </html>