Automatic installer.php lang files by installer_builder (20070224)
[moodle.git] / backup / config.html
blobfe0a908f1ba4a41b750cfc27c81b8f6a3f5c5992
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_metacourse)) {
24 $backup_config->backup_sche_metacourse = 1;
26 if (!isset($backup_config->backup_sche_users)) {
27 $backup_config->backup_sche_users = 1;
29 if (!isset($backup_config->backup_sche_logs)) {
30 $backup_config->backup_sche_logs = 0;
32 if (!isset($backup_config->backup_sche_userfiles)) {
33 $backup_config->backup_sche_userfiles = 1;
35 if (!isset($backup_config->backup_sche_coursefiles)) {
36 $backup_config->backup_sche_coursefiles = 1;
38 if (!isset($backup_config->backup_sche_messages)) {
39 $backup_config->backup_sche_messages = 0;
41 if (!isset($backup_config->backup_sche_active)) {
42 $backup_config->backup_sche_active = 0;
44 if (!isset($backup_config->backup_sche_weekdays)) {
45 $backup_config->backup_sche_weekdays = "0000000";
47 if (!isset($backup_config->backup_sche_hour)) {
48 $backup_config->backup_sche_hour = 00;
50 if (!isset($backup_config->backup_sche_minute)) {
51 $backup_config->backup_sche_minute = 00;
53 if (!isset($backup_config->backup_sche_destination)) {
54 $backup_config->backup_sche_destination = "";
56 if (!isset($backup_config->backup_sche_keep)) {
57 $backup_config->backup_sche_keep = 1;
60 //print_object($backup_config); //Debug
62 //Yes/no array for use in yes/no menu
63 $yesno_array[0] = $no;
64 $yesno_array[1] = $yes;
66 //With user data/without user data array for use in menu
67 $withwithout_array[0] = $withoutuserdata;
68 $withwithout_array[1] = $withuserdata;
70 //Course/alla array for use in course/all menu
71 $courseall_array[0] = $all;
72 $courseall_array[1] = $course;
74 //Keep array for use in keep menu
75 $keep_array[0] = $all;
76 $keep_array[1] = "1";
77 $keep_array[2] = "2";
78 $keep_array[5] = "5";
79 $keep_array[10] = "10";
80 $keep_array[20] = "20";
81 $keep_array[30] = "30";
82 $keep_array[40] = "40";
83 $keep_array[50] = "50";
84 $keep_array[100] = "100";
85 $keep_array[200] = "200";
86 $keep_array[300] = "300";
87 $keep_array[400] = "400";
88 $keep_array[500] = "500";
90 <form method="post" action="backup.php" name="form">
91 <?php echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\"/>"; ?>
93 <table cellpadding="9" cellspacing="0" >
94 <tr valign="top">
95 <td colspan ="3" align="center"><strong><?php print_string("settings") ?></strong></td>
96 </tr>
97 <tr valign="top">
98 <td align="right"><?php print_string("includemodules") ?>:</td>
99 <td nowrap="nowrap">
100 <?php choose_from_menu($yesno_array, "backup_sche_modules", $backup_config->backup_sche_modules, "") ?>
101 <?php choose_from_menu($withwithout_array, "backup_sche_withuserdata", $backup_config->backup_sche_withuserdata, "") ?>
102 </td>
103 <td>
104 <?php print_string("backupincludemoduleshelp") ?>
105 </td>
106 </tr>
107 <tr valign="top">
108 <td align="right"><?php print_string("metacourse") ?>:</td>
109 <td>
110 <?php choose_from_menu($yesno_array, "backup_sche_metacourse", $backup_config->backup_sche_metacourse, "") ?>
111 </td>
112 <td>
113 <?php print_string("backupmetacoursehelp") ?>
114 </td>
115 </tr>
116 <tr valign="top">
117 <td align="right"><?php print_string("users") ?>:</td>
118 <td>
119 <?php choose_from_menu($courseall_array, "backup_sche_users", $backup_config->backup_sche_users, "") ?>
120 </td>
121 <td>
122 <?php print_string("backupusershelp") ?>
123 </td>
124 </tr>
125 <tr valign="top">
126 <td align="right"><?php print_string("logs") ?>:</td>
127 <td>
128 <?php choose_from_menu($yesno_array, "backup_sche_logs", $backup_config->backup_sche_logs, "") ?>
129 </td>
130 <td>
131 <?php print_string("backuplogshelp") ?>
132 </td>
133 </tr>
134 <tr valign="top">
135 <td align="right"><?php print_string("userfiles") ?>:</td>
136 <td>
137 <?php choose_from_menu($yesno_array, "backup_sche_userfiles", $backup_config->backup_sche_userfiles, "") ?>
138 </td>
139 <td>
140 <?php print_string("backupuserfileshelp") ?>
141 </td>
142 </tr>
143 <tr valign="top">
144 <td align="right"><?php print_string("coursefiles") ?>:</td>
145 <td>
146 <?php choose_from_menu($yesno_array, "backup_sche_coursefiles", $backup_config->backup_sche_coursefiles, "") ?>
147 </td>
148 <td>
149 <?php print_string("backupcoursefileshelp") ?>
150 </td>
151 </tr>
152 <tr valign="top">
153 <td align="right"><?php print_string("messages","message") ?>:</td>
154 <td>
155 <?php choose_from_menu($yesno_array, "backup_sche_messages", $backup_config->backup_sche_messages, "") ?>
156 </td>
157 <td>
158 <?php print_string("backupmessageshelp","message") ?>
159 </td>
160 </tr>
161 <tr valign="top">
162 <td align="right"><?php print_string("keep") ?>:</td>
163 <td>
164 <?php
165 choose_from_menu($keep_array, "backup_sche_keep", $backup_config->backup_sche_keep, "");
166 print_string("files");
168 </td>
169 <td>
170 <?php print_string("backupkeephelp") ?>
171 </td>
172 </tr>
173 <tr valign="top">
174 <td colspan="3" align="center"><strong><?php print_string("schedule") ?></strong></td>
175 </tr>
176 <tr valign="top">
177 <td colspan="3" align="center">
178 <?php print_string("active") ?>: <?php choose_from_menu($yesno_array, "backup_sche_active", $backup_config->backup_sche_active, "") ?>
179 </td>
180 </tr>
181 <tr>
182 <td colspan="3" align="center">
183 <?php
184 //Get first day of week from languaje files
185 //after searching the web I haven't find a sytem to retrieve it in php from locale info
186 $firstdayofweek = get_string("firstdayofweek");
187 //If it is empty ot it is different of 1, default to 0
188 if (!isset($firstdayofweek) || $firstdayofweek != 1) {
189 $firstdayofweek = 0;
191 //Now create the GMT timestamp of a well-know sunday (02/25/2001, my 31th birthday (stronk7) !!)
192 $onesunday = gmmktime(0,0,0,2,25,2001);
193 $i = 0;
194 $day_names = "";
195 $check_names = "";
196 while ($i<7) {
197 $day_names[] = gmstrftime("%A",$onesunday + (($firstdayofweek+$i)*86400));
198 //Calculate standard day of week (0=Sunday......6=Saturday)
199 //to store info in that exact order in DB
200 $stddayofweek = ($i+$firstdayofweek) % 7;
201 //Calculate the status of the checkbox
202 if (substr($backup_config->backup_sche_weekdays,$stddayofweek,1) == "1") {
203 $strchecked = " checked=\"checked\"";
204 } else {
205 $strchecked = "";
207 $check_names[] = "<input type=\"checkbox\" name=\"dayofweek_$stddayofweek\" value=\"1\"$strchecked />";
208 $i++;
210 $table->align = array("center","center","center","center","center","center","center");
211 $table->head = $day_names;
212 $table->data[] = $check_names;
213 print_table($table);
215 </td>
216 </tr>
217 <tr valign="top">
218 <td colspan ="3" align="center">
219 <?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)) ?>
220 </td>
221 </tr>
222 <tr valign="top">
223 <td colspan ="3" align="center">
224 <?php print_string("saveto") ?>: <input name="backup_sche_destination" type="text" size="40" value="<?php p($backup_config->backup_sche_destination) ?>" /><?php helpbutton("directorypaths", strip_tags(get_string("directorypaths"))) ?><br /><?php if (!empty($sche_destination_error)) { formerr($sche_destination_error); echo "<br />"; } ?><?php print_string("backupsavetohelp") ?>
225 </td>
226 </tr>
227 <tr>
228 <td colspan="3" align="center">
229 <input type="submit" value="<?php print_string("savechanges") ?>" /></td>
230 </tr>
231 </table>
233 </form>