/[scire]/webgli/timezone.php
Gentoo

Contents of /webgli/timezone.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (show annotations) (download)
Sun May 7 19:57:58 2006 UTC (12 years, 2 months ago) by codeman
File size: 1541 byte(s)
adding a lot of webgli screens, some of which are done
the details of the status of webgli is in /webgli/TODO

1 <?php
2
3 include('webgliIP.php');
4 include('webgliUtility.php');
5
6 include('Smarty.class.php');
7 $smarty = new Smarty;
8
9 $smarty->template_dir = './templates';
10 $smarty->compile_dir = './templates_c';
11 $smarty->cache_dir = './cache';
12 $smarty->config_dir = './configs';
13
14 $ip = new InstallProfile();
15 $ip->parse('test.xml');
16
17
18 $error_msg = "";
19 if ($_GET['zonepath']) {
20 $zonepath = $_GET['zonepath'];
21 if (is_dir($zonepath)) {
22 $zonepath .= "/";
23 }
24 print "I got me a zonepath: $zonepath";
25
26 if ( substr($zonepath,-1) != '/') {
27 $ip->set("time_zone",substr($zonepath,20));
28 $error_msg .= "Timezone saved.<br>";
29 #$error_msg .= "ERROR: Could not set that timezone!";
30 #SAVE VALUES
31 file_put_contents('test.xml', $ip->serialize()); #PHP 5 only
32 }
33
34 } else {
35 $zonepath = "/usr/share/zoneinfo/";
36 }
37 if ($_POST['back']) {
38 $zonepath = $_POST['tzback'];
39 }
40
41 $smarty->assign('tzback',"/usr/share/zoneinfo/");
42 $smarty->assign('zonepath', $zonepath);
43
44 $skiplist = array("zone.tab","iso3166.tab","posixrules", '../', './' );
45 if (is_dir($zonepath)) {
46 $temp_tzlist = scandir($zonepath); #PHP 5 only.
47
48 } else {
49 $temp_tzlist = array();
50 }
51 $tzlist = array();
52 foreach ($temp_tzlist as $tz) {
53 if (!in_array($tz, $skiplist) ) {
54 if (is_dir($tz)) {
55 $tz .= "/";
56 }
57 array_push($tzlist, $tz);
58 }
59 }
60 sort($tzlist);
61
62 #print "TZList: ";
63 #print_r($tzlist);
64 #print "Zonepath: ";
65 #print_r($zonepath);
66
67 $smarty->assign('current',$ip->get("time_zone"));
68 $smarty->assign('error_msg',$error_msg);
69 $smarty->assign('tzlist',$tzlist);
70 $smarty->display('timezone.tpl');
71 ?>

  ViewVC Help
Powered by ViewVC 1.1.20