tagging as ATutor 1.5.4-release
[atutor.git] / admin / index.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2007 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
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$
14
15 define('AT_INCLUDE_PATH', '../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 admin_authenticate();
18
19 if (defined('AT_DEVEL_TRANSLATE') && AT_DEVEL_TRANSLATE) { 
20         $msg->addWarning('TRANSLATE_ON');       
21 }
22
23 require(AT_INCLUDE_PATH.'header.inc.php');
24
25 if ($_config['check_version']) {
26         $request = @file('http://atutor.ca/check_atutor_version.php?return');
27         if ($request && version_compare(VERSION, $request[0], '<')) {
28                 $msg->printFeedbacks('ATUTOR_UPDATE_AVAILABLE');
29         }
30 }
31 ?>
32
33 <div style="width: 40%; float: right; padding-top: 4px; padding-left: 10px;">
34
35         <?php if ($_config['allow_instructor_requests'] && admin_authenticate(AT_ADMIN_PRIV_USERS, AT_PRIV_RETURN)): ?> 
36                 <?php
37                         $sql    = "SELECT COUNT(*) AS cnt FROM ".TABLE_PREFIX."instructor_approvals";
38                         $result = mysql_query($sql, $db);
39                         $row    = mysql_fetch_assoc($result);
40                 ?>
41
42         <div class="input-form" style="width: 98%;">
43                 <form method="get" action="admin/instructor_requests.php">
44                         <div class="row">
45                                 <h3><?php echo _AT('instructor_requests'); ?></h3>
46                                 <p><?php echo _AT('instructor_requests_text', $row['cnt']); ?></p>
47                         </div>
48
49                         <div class="row buttons">
50                                 <input type="submit" name="submit" value="<?php echo _AT('view'); ?>" />
51                         </div>
52                 </form>
53         </div>
54
55         <?php endif; ?>
56
57         <div class="input-form" style="width: 98%;">
58                 <form method="get" action="http://atutor.ca/check_atutor_version.php" target="_blank">
59                 <input type="hidden" name="v" value="<?php echo urlencode(VERSION); ?>" />
60                         <div class="row">
61                                 <h3><?php echo _AT('atutor_version'); ?></h3>
62                                 <p><?php echo _AT('atutor_version_text', VERSION); ?></p>
63                         </div>
64
65                         <div class="row buttons">
66                                 <input type="submit" name="submit" value="<?php echo _AT('submit'); ?>" />
67                         </div>
68                 </form>
69         </div>
70 </div>
71
72 <div style="width: 55%;">
73         <?php
74         $path_length = strlen($_base_path);
75
76         echo '<ol id="tools" style="margin-right: 0px;">';
77         foreach ($_top_level_pages as $page_info) {
78                 echo '<li class="top-tool"><a href="' . $page_info['url'] . '">' . $page_info['title'] . '</a>  ';
79
80                 $page_info['url'] = substr($page_info['url'], $path_length);
81
82                 if ($_pages[$page_info['url']]['children']) {
83                         echo '<ul class="child-top-tool">';
84                         foreach ($_pages[$page_info['url']]['children'] as $child) {
85                                 echo ' <li class="child-tool"><a href="'.$child.'">'._AT($_pages[$child]['title_var']).'</a></li>';
86                         }
87                         echo '</ul>';
88                 }
89                 echo '</li>';
90         }
91         echo '</ol>';
92 ?>
93 </div>
94 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>