Menu="Scheduler:1" Title="Parity Check" Tag="calendar" Cond="$disks['parity']['device'] || $disks['parity2']['device'] || count(array_filter(array_column($disks,'type'),function($type){return $type=='Data';}))" --- "._('No Parity disk present')."!

"; } $width = [166,300]; $mode = ['Disabled','Daily','Weekly','Monthly','Yearly','Custom']; $days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; $months = ['January','February','March','April','May','June','July','August','September','October','November','December']; $memory = '/tmp/memory.tmp'; if (file_exists($memory)) { parse_str(file_get_contents($memory), $parity); if (empty($parity['hour'])) $parity['hour'] = ""; if (empty($parity['day'])) $parity['day'] = ""; if (empty($parity['dotm'])) $parity['dotm'] = ""; if (empty($parity['month'])) $parity['month'] = ""; if (empty($parity['write'])) $parity['write'] = "NOCORRECT"; } if ($parity['mode']<2) $parity['cumulative'] = ''; if ($parity['mode']==2) $parity['frequency'] = '1'; // Build day options array based on mode $day_options = []; $day_select_attrs = 'name="day"'; if ($parity['mode'] == 2) { // Weekly mode - regular dropdown for ($d = 0; $d < count($days); $d++) { $day_options[] = mk_option($parity['day'], strval($d), ucfirst(_($days[$d],0))); } } elseif ($parity['mode'] == 5) { // Custom mode - multiple select $day_select_attrs = 'id="s1" name="day" multiple="multiple" style="display:none"'; for ($d = 0; $d < count($days); $d++) { $day_options[] = mk_option_check($parity['day'], strval($d), ucfirst(_($days[$d],0))); } } else { // Other modes - disabled placeholder $day_options[] = mk_option($parity['day'], "*", "--------"); } // Build dotm (day of the month/week) options array based on mode $dotm_options = []; if ($parity['mode'] >= 3) { if ($parity['mode'] == 5) { // Custom mode - week options $dotm_options[] = mk_option($parity['dotm'], "*", _("Every week")); $dotm_options[] = mk_option($parity['dotm'], "W1", _("First week")); $dotm_options[] = mk_option($parity['dotm'], "W2", _("Second week")); $dotm_options[] = mk_option($parity['dotm'], "W3", _("Third week")); $dotm_options[] = mk_option($parity['dotm'], "W4", _("Fourth week")); $dotm_options[] = mk_option($parity['dotm'], "WL", _("Last week")); } else { // Monthly/Yearly mode - day options $dotm_options[] = mk_option($parity['dotm'], "1", _("First day")); $dotm_options[] = mk_option($parity['dotm'], "28-31", _("Last day")); for ($d = 2; $d <= 31; $d++) { $dotm_options[] = mk_option($parity['dotm'], strval($d), sprintf("%02d", $d)); } } } else { // Other modes - disabled placeholder $dotm_options[] = mk_option($parity['dotm'], "*", "--------"); } // Set the label for dotm field based on mode $dotm_label = ($parity['mode'] < 5) ? _('Day of the month') : _('Week of the month'); // Build month options array based on mode $month_options = []; $month_select_attrs = 'name="month"'; if ($parity['mode'] >= 4) { if ($parity['mode'] == 5) { // Custom mode - multiple select $month_select_attrs = 'id="s2" name="month" multiple="multiple" style="display:none"'; for ($m = 0; $m < count($months); $m++) { $month_options[] = mk_option_check($parity['month'], strval($m+1), ucfirst(_($months[$m],0))); } } else { // Yearly mode - regular dropdown for ($m = 0; $m < count($months); $m++) { $month_options[] = mk_option($parity['month'], strval($m+1), ucfirst(_($months[$m],0))); } } } else { // Other modes - disabled placeholder $month_options[] = mk_option($parity['month'], "*", "--------"); } // Build hour options array based on mode $hour_options = []; if ($parity['mode'] > 0) { // Active modes - generate 24-hour options with 30-minute intervals for ($h = 0; $h < 24; $h++) { $hour_options[] = mk_option($parity['hour'], sprintf("0 %d", $h), sprintf("%02d:00", $h)); $hour_options[] = mk_option($parity['hour'], sprintf("30 %d", $h), sprintf("%02d:30", $h)); } } else { // Disabled mode - placeholder $hour_options[] = mk_option($parity['hour'], "*", "--------"); } ?>
_(Scheduled parity check)_: : :parity_check_scheduled_help: _(Day of the week)_: : :parity_day_of_the_week_help: : : :parity_week_of_the_month_help: _(Time of the day)_: : :parity_time_of_the_day_help: _(Month of the year)_: : :parity_month_of_the_year_help: _(Write corrections to parity disk)_: : :parity_write_corrections_help: _(Cumulative parity check)_: : :parity_cumulative_check_help:   :