aboutsummaryrefslogtreecommitdiff
path: root/views/default/input
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-04-03 12:31:42 +0200
committerKevin Jardine <kevinjardine@yahoo.com>2012-04-03 12:31:42 +0200
commit0b25adcd921149b50845647980284e8ab66d8fed (patch)
tree0702f1ef157f0417cd1c17ba711f76e563e299ef /views/default/input
parent2d19bfa232be5eff43bb6c1d1eef12e681552956 (diff)
downloadelgg-0b25adcd921149b50845647980284e8ab66d8fed.tar.gz
elgg-0b25adcd921149b50845647980284e8ab66d8fed.tar.bz2
major changes to add new features, including a full calendar and repeating events
Diffstat (limited to 'views/default/input')
-rw-r--r--views/default/input/timepicker.php38
1 files changed, 34 insertions, 4 deletions
diff --git a/views/default/input/timepicker.php b/views/default/input/timepicker.php
index d7df04699..ccbb88778 100644
--- a/views/default/input/timepicker.php
+++ b/views/default/input/timepicker.php
@@ -1,5 +1,5 @@
<?php
-
+$event_calendar_restricted_times = elgg_get_plugin_setting('restricted_times', 'event_calendar');
$time_format = elgg_get_plugin_setting('timeformat', 'event_calendar');
if (!$time_format) {
$time_format = '24';
@@ -18,7 +18,14 @@ $dates = array();
$dates['-'] = '-';
if ($time_format == '12') {
- for($h=0;$h<=12;$h++) {
+ if ($event_calendar_restricted_times == 'yes') {
+ $h1 = 6;
+ $h2 = 9;
+ } else {
+ $h1 = 0;
+ $h2 = 11;
+ }
+ for($h=$h1;$h<=12;$h++) {
$ht = sprintf("%02d",$h);
for($m=0;$m<60;$m=$m+15) {
$mt = sprintf("%02d",$m);
@@ -30,7 +37,7 @@ if ($time_format == '12') {
}
}
}
- for($h=1;$h<12;$h++) {
+ for($h=1;$h<$h2;$h++) {
$ht = sprintf("%02d",$h);
for($m=0;$m<60;$m=$m+15) {
$mt = sprintf("%02d",$m);
@@ -38,8 +45,23 @@ if ($time_format == '12') {
$dates[$t] = "$ht:$mt pm";
}
}
+ if ($event_calendar_restricted_times == 'yes') {
+ $m = 0;
+ $h = 9;
+ $ht = sprintf("%02d",$h);
+ $mt = sprintf("%02d",$m);
+ $t = 12*60+$h*60+$m;
+ $dates[$t] = "$ht:$mt pm";
+ }
} else {
- for($h=0;$h<24;$h++) {
+ if ($event_calendar_restricted_times == 'yes') {
+ $h1 = 6;
+ $h2 = 21;
+ } else {
+ $h1 = 0;
+ $h2 = 24;
+ }
+ for($h=$h1;$h<$h2;$h++) {
$ht = sprintf("%02d",$h);
for($m=0;$m<60;$m=$m+15) {
$mt = sprintf("%02d",$m);
@@ -47,6 +69,14 @@ if ($time_format == '12') {
$dates[$t] = "$ht:$mt";
}
}
+ if ($event_calendar_restricted_times == 'yes') {
+ $m = 0;
+ $h = 21;
+ $ht = sprintf("%02d",$h);
+ $mt = sprintf("%02d",$m);
+ $t = 12*60+$h*60+$m;
+ $dates[$t] = "$ht:$mt pm";
+ }
}
echo elgg_view('input/dropdown',array('name'=>$vars['name'],'value'=>$time,'options_values'=>$dates));