2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2010 */
6 /* Inclusive Design Institute */
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 /************************************************************************/
14 define('AT_INCLUDE_PATH', '../../../include/');
15 require(AT_INCLUDE_PATH.'vitals.inc.php');
17 admin_authenticate(AT_ADMIN_PRIV_MODULES);
20 if (isset($_POST['cancel'])) {
21 $msg->addFeedback('CANCELLED');
22 header('Location: ../courses.php');
26 if (isset($_POST['submit'])) {
29 $_stack_names = array();
31 foreach($_stacks as $name=>$file) {
32 $_stack_names[] = $name;
35 $_POST['stack'] = array_unique($_POST['stack']);
36 $_POST['stack'] = array_intersect($_POST['stack'], $_stack_names);
38 foreach($_POST['stack'] as $dropdown) {
40 $side_menu .= $dropdown . '|';
43 $side_menu = substr($side_menu, 0, -1);
45 if (!($_config_defaults['side_defaults'] == $side_menu) && (strlen($side_menu) < 256)) {
46 $sql = "REPLACE INTO ".TABLE_PREFIX."config VALUES('side_defaults', '$side_menu')";
47 } else if ($_config_defaults['side_defaults'] == $side_menu) {
48 $sql = "DELETE FROM ".TABLE_PREFIX."config WHERE name='side_defaults'";
51 $result = mysql_query($sql, $db);
52 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
53 header('Location:'. $_SERVER[PHP_SELF]);
57 require(AT_INCLUDE_PATH.'header.inc.php');
60 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="prefs">
61 <div class="input-form" style="width:95%">
63 <p><?php echo _AT('side_menu_text'); ?></p>
68 $num_stack = count($_stacks);
70 $side_menu = explode('|', $_config['side_defaults']);
72 for ($i=0; $i<$num_stack; $i++) {
73 echo '<select name="stack['.$i.']">';
74 echo '<option value=""></option>';
75 foreach ($_stacks as $name=>$info) {
76 if (isset($info['title'])) {
77 $title = $info['title'];
79 $title = _AT($info['title_var']);
81 echo '<option value="'.$name.'"';
82 if (isset($side_menu[$i]) && ($name == $side_menu[$i])) {
83 echo ' selected="selected"';
85 echo '>'.$title.'</option>';
93 <input type="submit" name="submit" value="<?php echo _AT('save'); ?>" accesskey="s" />
94 <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" />
99 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>