2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Joel Kronenberg & Heidi Hazelton*/
6 /* Adaptive Technology Resource Centre / University of Toronto */
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 /************************************************************************/
15 define('AT_INCLUDE_PATH', '../../include/');
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
18 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
21 if (isset($_POST['cancel'])) {
22 $msg->addFeedback('CANCELLED');
23 header('Location: ../courses.php');
27 if (isset($_POST['submit'])) {
30 $_stack_names = array();
32 foreach($_stacks as $name=>$file) {
33 $_stack_names[] = $name;
36 $_POST['stack'] = array_unique($_POST['stack']);
37 $_POST['stack'] = array_intersect($_POST['stack'], $_stack_names);
39 foreach($_POST['stack'] as $dropdown) {
41 $side_menu .= $dropdown . '|';
44 $side_menu = substr($side_menu, 0, -1);
46 if (!($_config_defaults['side_defaults'] == $side_menu) && (strlen($side_menu) < 256)) {
47 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES('side_defaults', '$side_menu')";
48 } else if ($_config_defaults['side_defaults'] == $side_menu) {
49 $sql = "DELETE FROM ".TABLE_PREFIX."config WHERE name='side_defaults'";
52 $result = mysql_query($sql, $db);
53 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
54 header('Location:'. $_SERVER[PHP_SELF]);
58 require(AT_INCLUDE_PATH.'header.inc.php');
61 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="prefs">
62 <div class="input-form" style="width:50%">
64 <p><?php echo _AT('side_menu_text'); ?></p>
69 $num_stack = count($_stacks);
71 $side_menu = explode('|', $_config['side_defaults']);
73 for ($i=0; $i<$num_stack; $i++) {
74 echo '<select name="stack['.$i.']">';
75 echo '<option value=""></option>';
76 foreach ($_stacks as $name=>$info) {
77 if (isset($info['title'])) {
78 $title = $info['title'];
80 $title = _AT($info['title_var']);
82 echo '<option value="'.$name.'"';
83 if (isset($side_menu[$i]) && ($name == $side_menu[$i])) {
84 echo ' selected="selected"';
86 echo '>'.$title.'</option>';
94 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" accesskey="s" />
95 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
100 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>