tazpanel rev 338 1.6.1

settings.cgi: set tz
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 02 14:12:12 2013 +0100 (2013-01-02)
parents 1bccb526ff67
children 0d5d3fd19825
files settings.cgi
line diff
     1.1 --- a/settings.cgi	Wed Jan 02 13:35:40 2013 +0100
     1.2 +++ b/settings.cgi	Wed Jan 02 14:12:12 2013 +0100
     1.3 @@ -102,6 +102,8 @@
     1.4  	*\ style*)
     1.5  		sed -i s/'^STYLE.*'/"STYLE=\"$(GET style)\""/ $CONFIG
     1.6  		. $CONFIG ;;
     1.7 +	*\ settz\ *)
     1.8 +		GET tz > /etc/TZ ;;
     1.9  esac
    1.10  
    1.11  #
    1.12 @@ -384,13 +386,25 @@
    1.13  <section>
    1.14  <h3>$(gettext 'System time')</h3>
    1.15  
    1.16 +<form method="get" action="$SCRIPT_NAME">
    1.17  <table>
    1.18 -	<tr><td>$(gettext 'Time zome:')</td><td>$(cat /etc/TZ)
    1.19 -		<a class="button" href="$SCRIPT_NAME">$(gettext 'Change')</a></td></tr>
    1.20 +	<tr><td>$(gettext 'Time zome:')</td><td>
    1.21 +		<select name="tz">
    1.22 +		$(cd  /usr/share/zoneinfo ; find * -type f | while read tz; do
    1.23 +			if [ "$(cat /etc/TZ)" == "$tz" ]; then
    1.24 +				echo "<option selected>$tz</option>"
    1.25 +			else
    1.26 +				echo "<option>$tz</option>"
    1.27 +			fi
    1.28 +		done)
    1.29 +		</select>
    1.30 +		<input type="submit" name="settz" value="$(gettext 'Change')" /></td></tr>
    1.31  	<tr><td>$(gettext 'System time:')</td><td>$(date)</td></tr>
    1.32  	<tr><td>$(gettext 'Hardware clock:')</td><td>$(hwclock -r)</tr>
    1.33  </table>
    1.34 +</form>
    1.35  <form method="get" action="$SCRIPT_NAME">
    1.36 +<input type="submit" name="date" value="$(gettext 'Set date')" />
    1.37  <select name="day">
    1.38  $(for i in $(seq 1 31); do echo "<option>$i</option>"; done)
    1.39  </select>
    1.40 @@ -412,7 +426,6 @@
    1.41  : <select name="sec">
    1.42  $(for i in $(seq 0 59); do printf "<option>%02d</option>" $i; done)
    1.43  </select>
    1.44 -<input type="submit" name="date" value="$(gettext 'Set date')" />
    1.45  </form>
    1.46  <a class="button" href="$SCRIPT_NAME?rdate">$(gettext 'Sync online')</a>
    1.47  <a class="button" href="$SCRIPT_NAME?hwclock">$(gettext 'Set hardware clock')</a>