setTimestamp($timestamp); } return $date->format('Y'); } /** * Returns array status information based on filesystem state * @param array $var Global state variable containing filesystem information * @return array Status with class, icon, text and progress information */ function getArrayStatus($var) { $progress = (_var($var,'fsProgress')!='') ? $var['fsProgress'] : ""; $statusMap = [ 'Stopped' => ['class' => 'red', 'icon' => 'stop-circle', 'text' => _('Array Stopped')], 'Starting' => ['class' => 'orange', 'icon' => 'pause-circle', 'text' => _('Array Starting')], 'Stopping' => ['class' => 'orange', 'icon' => 'pause-circle', 'text' => _('Array Stopping')], 'default' => ['class' => 'green', 'icon' => 'play-circle', 'text' => _('Array Started')] ]; $state = _var($var,'fsState'); $status = $statusMap[$state] ?? $statusMap['default']; return [ 'class' => $status['class'], 'icon' => $status['icon'], 'text' => $status['text'], 'progress' => $progress ]; } ?>