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;
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" >
95 <td colspan =
"3" align=
"center"><strong><?php print_string("settings") ?></strong></td>
98 <td align=
"right"><?php print_string("includemodules") ?>:
</td>
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
, "") ?>
104 <?php print_string("backupincludemoduleshelp") ?>
108 <td align=
"right"><?php print_string("metacourse") ?>:
</td>
110 <?php choose_from_menu($yesno_array, "backup_sche_metacourse", $backup_config->backup_sche_metacourse
, "") ?>
113 <?php print_string("backupmetacoursehelp") ?>
117 <td align=
"right"><?php print_string("users") ?>:
</td>
119 <?php choose_from_menu($courseall_array, "backup_sche_users", $backup_config->backup_sche_users
, "") ?>
122 <?php print_string("backupusershelp") ?>
126 <td align=
"right"><?php print_string("logs") ?>:
</td>
128 <?php choose_from_menu($yesno_array, "backup_sche_logs", $backup_config->backup_sche_logs
, "") ?>
131 <?php print_string("backuplogshelp") ?>
135 <td align=
"right"><?php print_string("userfiles") ?>:
</td>
137 <?php choose_from_menu($yesno_array, "backup_sche_userfiles", $backup_config->backup_sche_userfiles
, "") ?>
140 <?php print_string("backupuserfileshelp") ?>
144 <td align=
"right"><?php print_string("coursefiles") ?>:
</td>
146 <?php choose_from_menu($yesno_array, "backup_sche_coursefiles", $backup_config->backup_sche_coursefiles
, "") ?>
149 <?php print_string("backupcoursefileshelp") ?>
153 <td align=
"right"><?php print_string("messages","message") ?>:
</td>
155 <?php choose_from_menu($yesno_array, "backup_sche_messages", $backup_config->backup_sche_messages
, "") ?>
158 <?php print_string("backupmessageshelp","message") ?>
162 <td align=
"right"><?php print_string("keep") ?>:
</td>
165 choose_from_menu($keep_array, "backup_sche_keep", $backup_config->backup_sche_keep
, "");
166 print_string("files");
170 <?php print_string("backupkeephelp") ?>
174 <td colspan=
"3" align=
"center"><strong><?php print_string("schedule") ?></strong></td>
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,
"")
?>
182 <td colspan=
"3" align=
"center">
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) {
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);
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\"";
207 $check_names[] = "<input type=\"checkbox\" name=\"dayofweek_$stddayofweek\" value=\"1\"$strchecked />";
210 $table->align
= array("center","center","center","center","center","center","center");
211 $table->head
= $day_names;
212 $table->data
[] = $check_names;
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))
?>
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")
?>
228 <td colspan=
"3" align=
"center">
229 <input type=
"submit" value=
"<?php print_string("savechanges
") ?>" /></td
>