aboutsummaryrefslogtreecommitdiff
path: root/mod/event_connect/views/default/plugin/event_connector/settings.php
blob: 668cbda33a8c5e642157f23fd31977441b9b5b03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
	if($vars['entity']->timezone == "")
		$vars['entity']->timezone = "Europe/Paris";
?>
<p>
	<?php echo elgg_echo('event_connector:timezone'); ?>
	<select name="params[timezone]">
    <?php
    $timezone_identifiers = DateTimeZone::listIdentifiers();
    foreach( $timezone_identifiers as $value ){
        if ( preg_match( '/^(America|Antartica|Arctic|Asia|Atlantic|Europe|Indian|Pacific)\//', $value ) ){
            $ex=explode("/",$value);//obtain continent,city    
            if ($continent!=$ex[0]){
                if ($continent!="") echo '</optgroup>';
                echo '<optgroup label="'.$ex[0].'">';
            }
    
            $city=$ex[1];
            $continent=$ex[0];
            echo '<option value="'.$value.'"'; if ($vars['entity']->timezone == $value) echo " selected=\"yes\" "; echo ">".$city.'</option>';        
        }
    }
    ?>
        </optgroup>
    </select>
</p>