5fcfcbdcd930d54d142ffcec997f1c6fd1e4b5c3
[atutor.git] / mods / wiki / page.php
1 <?php
2 /****************************************************************/
3 /* ATutor                                                                                                               */
4 /****************************************************************/
5 /* Copyright (c) 2002-2005 by Greg Gay & Joel Kronenberg        */
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: index.php 5123 2005-07-12 14:59:03Z joel $
14 //$_user_location       = 'public';
15
16         $page = 'wiki';
17         define('AT_INCLUDE_PATH', '../../include/');
18         require (AT_INCLUDE_PATH.'vitals.inc.php');
19
20         //authenticate(AT_PRIV_WIKI);
21         include_once("config.php");
22         $content =  ewiki_page();
23         $content = stripslashes($content);
24         global $_pages;
25         $_pages =array();
26
27
28 if (empty($_GET) || ($_GET['page'] == EWIKI_PAGE_INDEX)) {
29
30         header('Location: index.php');
31         exit;
32 }
33
34
35         if ($ewiki_title != $_GET['page']) {
36                 $_pages['mods/wiki/page.php']['title'] ='Editing this page';
37                 $_pages['mods/wiki/page.php']['parent'] = 'mods/wiki/page.php?page=' . $ewiki_title;
38
39                 $_pages['mods/wiki/page.php?page=' . $ewiki_title]['title'] = $ewiki_title;
40                 $_pages['mods/wiki/page.php?page=' . $ewiki_title]['children'] = array('mods/wiki/page.php');
41                 $_pages['mods/wiki/page.php?page=' . $ewiki_title]['parent'] = 'mods/wiki/index.php';
42
43         } else {
44                 $_pages['mods/wiki/page.php']['title'] = $ewiki_title;
45                 $_pages['mods/wiki/page.php']['parent'] = 'mods/wiki/index.php';
46                 $_pages['mods/wiki/page.php']['children'] = array('mods/wiki/page.php?edit/'. $_GET['page']);
47                 $_pages['mods/wiki/page.php?edit/'. $_GET['page']]['title'] = 'Edit This Page';
48         }
49
50         //$_pages['mods/wiki/page.php?edit/'. $_GET['page']]['parent'] = 'mods/wiki/page.php';
51
52         /*
53         $_pages['./tools/wiki/index.php']['title']  = 'Wiki Home';
54         $_pages['mods/wiki/index.php']['title']  = "$ewiki_title"; //'wiki';
55         $_pages['mods/wiki/index.php?page='.$_GET['page'].'']['parent']    = 'mods/wiki/index.php';
56         $_pages['mods/wiki/index.php']['children']  = array('./tools/wiki/index.php');
57 */
58         $_custom_css = $_base_path . 'mods/wiki/module.css';
59         require (AT_INCLUDE_PATH.'header.inc.php');
60
61         // Display the Toolbar at the top of the page too, after making $o global in ewiki_control_links_list() 
62         if($o){
63                 echo '<div class="wiki"><div class="wiki-plugins" align="right">';
64                 echo $o;
65                 echo '</div><hr></div>';
66         }
67         echo $content;   
68         // Show the Calendar if the page displayed has one associated with it.
69          if (function_exists("calendar_exists") && calendar_exists()) {
70                   echo  calendar();
71           }
72
73  require(AT_INCLUDE_PATH.'footer.inc.php'); 
74  ?>