Add idnumber to list of course students
[moodle.git] / backup / config.html
blob208779ae46ca065f1334caa33fe6cf1c1ec45a49
1 <?php
2 //Get some strings
4 $yes = get_string("yes");
5 $no = get_string("no");
6 $withuserdata = get_string("withuserdata");
7 $withoutuserdata = get_string("withoutuserdata");
8 $course = get_string("course");
9 $all = get_string("all");
10 $include = get_string("include");
11 $modules = get_string("modules");
13 //Get backup_config pairs
14 $backup_config = backup_get_config();
16 //Checks backup_config pairs exist
17 if (!isset($backup_config->backup_sche_modules)) {
18 $backup_config->backup_sche_modules = 1;
20 if (!isset($backup_config->backup_sche_withuserdata)) {
21 $backup_config->backup_sche_withuserdata = 1;
23 if (!isset($backup_config->backup_sche_users)) {
24 $backup_config->backup_sche_users = 1;
26 if (!isset($backup_config->backup_sche_logs)) {
27 $backup_config->backup_sche_logs = 0;
29 if (!isset($backup_config->backup_sche_userfiles)) {
30 $backup_config->backup_sche_userfiles = 1;
32 if (!isset($backup_config->backup_sche_coursefiles)) {
33 $backup_config->backup_sche_coursefiles = 1;
35 if (!isset($backup_config->backup_sche_active)) {
36 $backup_config->backup_sche_active = 0;
38 if (!isset($backup_config->backup_sche_weekdays)) {
39 $backup_config->backup_sche_weekdays = "0000000";
41 if (!isset($backup_config->backup_sche_hour)) {
42 $backup_config->backup_sche_hour = 00;
44 if (!isset($backup_config->backup_sche_minute)) {
45 $backup_config->backup_sche_minute = 00;
47 if (!isset($backup_config->backup_sche_destination)) {
48 $backup_config->backup_sche_destination = "";
50 if (!isset($backup_config->backup_sche_keep)) {
51 $backup_config->backup_sche_keep = 1;
54 //print_object($backup_config); //Debug
56 //Yes/no array for use in yes/no menu
57 $yesno_array[0] = $no;
58 $yesno_array[1] = $yes;
60 //With user data/without user data array for use in menu
61 $withwithout_array[0] = $withoutuserdata;
62 $withwithout_array[1] = $withuserdata;
64 //Course/alla array for use in course/all menu
65 $courseall_array[0] = $all;
66 $courseall_array[1] = $course;
68 //Keep array for use in keep menu
69 $keep_array[0] = $all;
70 $keep_array[1] = "1";
71 $keep_array[2] = "2";
72 $keep_array[5] = "5";
73 $keep_array[10] = "10";
74 $keep_array[20] = "20";
75 $keep_array[30] = "30";
76 $keep_array[40] = "40";
77 $keep_array[50] = "50";
78 $keep_array[100] = "100";
79 $keep_array[200] = "200";
80 $keep_array[300] = "300";
81 $keep_array[400] = "400";
82 $keep_array[500] = "500";
84 <form method="post" action="backup.php" name="form">
86 <table cellpadding=9 cellspacing=0 >
87 <tr valign=top>
88 <td colspan = 3 align=center><strong><?php print_string("settings") ?></strong></td>
89 </tr>
90 <tr valign=top>
91 <td align=right><p><?php print_string("includemodules") ?>:</td>
92 <td nowrap>
93 <?php choose_from_menu($yesno_array, "backup_sche_modules", $backup_config->backup_sche_modules, "") ?>
94 <?php choose_from_menu($withwithout_array, "backup_sche_withuserdata", $backup_config->backup_sche_withuserdata, "") ?>
95 </td>
96 <td>
97 <?php print_string("backupincludemoduleshelp") ?>
98 </td>
99 </tr>
100 <tr valign=top>
101 <td align=right><p><?php print_string("users") ?>:</td>
102 <td>
103 <?php choose_from_menu($courseall_array, "backup_sche_users", $backup_config->backup_sche_users, "") ?>
104 </td>
105 <td>
106 <?php print_string("backupusershelp") ?>
107 </td>
108 </tr>
109 <tr valign=top>
110 <td align=right><p><?php print_string("logs") ?>:</td>
111 <td>
112 <?php choose_from_menu($yesno_array, "backup_sche_logs", $backup_config->backup_sche_logs, "") ?>
113 </td>
114 <td>
115 <?php print_string("backuplogshelp") ?>
116 </td>
117 </tr>
118 <tr valign=top>
119 <td align=right><p><?php print_string("userfiles") ?>:</td>
120 <td>
121 <?php choose_from_menu($yesno_array, "backup_sche_userfiles", $backup_config->backup_sche_userfiles, "") ?>
122 </td>
123 <td>
124 <?php print_string("backupuserfileshelp") ?>
125 </td>
126 </tr>
127 <tr valign=top>
128 <td align=right><p><?php print_string("coursefiles") ?>:</td>
129 <td>
130 <?php choose_from_menu($yesno_array, "backup_sche_coursefiles", $backup_config->backup_sche_coursefiles, "") ?>
131 </td>
132 <td>
133 <?php print_string("backupcoursefileshelp") ?>
134 </td>
135 </tr>
136 <tr valign=top>
137 <td align=right><p><?php print_string("keep") ?>:</td>
138 <td>
139 <?php
140 choose_from_menu($keep_array, "backup_sche_keep", $backup_config->backup_sche_keep, "");
141 print_string("files");
143 </td>
144 <td>
145 <?php print_string("backupkeephelp") ?>
146 </td>
147 </tr>
148 <tr valign=top>
149 <td colspan = 3 align=center><strong><?php print_string("schedule") ?></strong></td>
150 </tr>
151 <tr valign=top>
152 <td colspan = 3 align=center>
153 <?php print_string("active") ?>: <?php choose_from_menu($yesno_array, "backup_sche_active", $backup_config->backup_sche_active, "") ?>
154 </td>
155 </tr>
156 <tr>
157 <td colspan=3 align=center>
158 <?php
159 //Get first day of week from languaje files
160 //after searching the web I haven't find a sytem to retrieve it in php from locale info
161 $firstdayofweek = get_string("firstdayofweek");
162 //If it is empty ot it is different of 1, default to 0
163 if (!isset($firstdayofweek) || $firstdayofweek != 1) {
164 $firstdayofweek = 0;
166 //Now create the timestamp of a well-know sunday (02/25/2001, my 31th birthday (stronk7) !!)
167 $onesunday = make_timestamp(2001,2,25);
168 $i = 0;
169 $day_names = "";
170 $check_names = "";
171 while ($i<7) {
172 $day_names[] = strftime("%A",$onesunday + (($firstdayofweek+$i)*86400));
173 //Calculate standard day of week (0=Sunday......6=Saturday)
174 //to store info in that exact order in DB
175 $stddayofweek = ($i+$firstdayofweek) % 7;
176 //Calculate the status of the checkbox
177 if (substr($backup_config->backup_sche_weekdays,$stddayofweek,1) == "1") {
178 $strchecked = " checked";
179 } else {
180 $strchecked = "";
182 $check_names[] = "<input type=\"checkbox\" name=\"dayofweek_$stddayofweek\" value=\"1\"$strchecked>";
183 $i++;
185 $table->align = array("center","center","center","center","center","center","center");
186 $table->head = $day_names;
187 $table->data[] = $check_names;
188 print_table($table);
190 </td>
191 </tr>
192 <tr valign=top>
193 <td colspan = 3 align=center>
194 <?php print_string("executeat") ?>: <?php print_time_selector("backup_sche_hour","backup_sche_minute",make_timestamp(2000,1,1,$backup_config->backup_sche_hour,$backup_config->backup_sche_minute)) ?>
195 </td>
196 </tr>
197 <tr valign=top>
198 <td colspan = 3 align=center>
199 <?php print_string("saveto") ?>: <input name="backup_sche_destination" type="text" size="40" value="<?php p($backup_config->backup_sche_destination) ?>"><br><?php if (!empty($sche_destination_error)) { formerr($sche_destination_error); echo "<br>"; } ?><?php print_string("backupsavetohelp") ?>
200 </td>
201 </tr>
202 <tr>
203 <td colspan=3 align=center>
204 <input type="submit" value="<?php print_string("savechanges") ?>"></td>
205 </tr>
206 </table>
208 </form>