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;
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 >
88 <td colspan =
3 align=center
><strong><?php print_string("settings") ?></strong></td>
91 <td align=right
><p><?php print_string("includemodules") ?>:
</td>
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
, "") ?>
97 <?php print_string("backupincludemoduleshelp") ?>
101 <td align=right
><p><?php print_string("users") ?>:
</td>
103 <?php choose_from_menu($courseall_array, "backup_sche_users", $backup_config->backup_sche_users
, "") ?>
106 <?php print_string("backupusershelp") ?>
110 <td align=right
><p><?php print_string("logs") ?>:
</td>
112 <?php choose_from_menu($yesno_array, "backup_sche_logs", $backup_config->backup_sche_logs
, "") ?>
115 <?php print_string("backuplogshelp") ?>
119 <td align=right
><p><?php print_string("userfiles") ?>:
</td>
121 <?php choose_from_menu($yesno_array, "backup_sche_userfiles", $backup_config->backup_sche_userfiles
, "") ?>
124 <?php print_string("backupuserfileshelp") ?>
128 <td align=right
><p><?php print_string("coursefiles") ?>:
</td>
130 <?php choose_from_menu($yesno_array, "backup_sche_coursefiles", $backup_config->backup_sche_coursefiles
, "") ?>
133 <?php print_string("backupcoursefileshelp") ?>
137 <td align=right
><p><?php print_string("keep") ?>:
</td>
140 choose_from_menu($keep_array, "backup_sche_keep", $backup_config->backup_sche_keep
, "");
141 print_string("files");
145 <?php print_string("backupkeephelp") ?>
149 <td colspan =
3 align=center
><strong><?php print_string("schedule") ?></strong></td>
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,
"")
?>
157 <td colspan=
3 align=center
>
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) {
166 //Now create the timestamp of a well-know sunday (02/25/2001, my 31th birthday (stronk7) !!)
167 $onesunday = make_timestamp(2001,2,25);
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";
182 $check_names[] = "<input type=\"checkbox\" name=\"dayofweek_$stddayofweek\" value=\"1\"$strchecked>";
185 $table->align
= array("center","center","center","center","center","center","center");
186 $table->head
= $day_names;
187 $table->data
[] = $check_names;
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))
?>
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")
?>
203 <td colspan=
3 align=center
>
204 <input type=
"submit" value=
"<?php print_string("savechanges
") ?>"></td
>