diff options
author | Sem <sembrestels@riseup.net> | 2012-07-20 05:45:54 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-07-20 05:45:54 +0200 |
commit | 3ac2c8fd0cacc57b8080be5f7d381b8cf5524f2f (patch) | |
tree | 46475df7579e0bf12c7bff62c3e125b16c641247 /views/default/input | |
parent | 6e3d519f4ff1e163fe698607adba1568386d8c55 (diff) | |
parent | 86d154541f9cf1de74f79cae6c1b05b3214bdca8 (diff) | |
download | elgg-3ac2c8fd0cacc57b8080be5f7d381b8cf5524f2f.tar.gz elgg-3ac2c8fd0cacc57b8080be5f7d381b8cf5524f2f.tar.bz2 |
Merge branch 'full' of https://github.com/kevinjardine/Elgg-Event-Calendar
Diffstat (limited to 'views/default/input')
-rw-r--r-- | views/default/input/datepicker_inline.php | 3 | ||||
-rw-r--r-- | views/default/input/datepicker_popup.php | 31 | ||||
-rw-r--r-- | views/default/input/timepicker.php | 62 |
3 files changed, 31 insertions, 65 deletions
diff --git a/views/default/input/datepicker_inline.php b/views/default/input/datepicker_inline.php index 1d0a0689d..3fd9c37af 100644 --- a/views/default/input/datepicker_inline.php +++ b/views/default/input/datepicker_inline.php @@ -65,7 +65,6 @@ $("#<?php echo $vars['name']; ?>").datepicker({ document.location.href = "<?php echo $link_bit; ?>".replace('%s', date.substring(0,10)); }, dateFormat: "yy-mm-dd", - <?php echo $vars['range_bit']; ?> defaultDate: "<?php echo $vars['start_date'] .' - '.$vars['end_date']; ?>", beforeShowDay: highlightWeek }); @@ -76,7 +75,7 @@ if ("<?php echo $vars['mode'] ?>" == "month") { end_date += 1; } $("#<?php echo $vars['name']; ?>").datepicker("setDate", start_date, end_date); -var done_loading = true; +done_loading = true; }); </script> diff --git a/views/default/input/datepicker_popup.php b/views/default/input/datepicker_popup.php deleted file mode 100644 index 0daeb7307..000000000 --- a/views/default/input/datepicker_popup.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * JQuery data picker - * - * @package event_calendar - * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 - * @author Kevin Jardine <kevin@radagast.biz> - * @copyright Radagast Solutions 2008 - * @link http://radagast.biz/ - * - */ - -if ($vars['dateformat']) { - $date_format = $vars['dateformat']; -} else { - $date_format = "yy/mm/dd"; -} -?> - -<script language="javascript"> -$(document).ready(function(){ -$("#<?php echo $vars['internalname']; ?>").datepicker({ - dateFormat: "<?php echo $date_format; ?>", - showOn: "both", - buttonImage: "<?php echo $vars['url']; ?>mod/event_calendar/images/calendar.gif", - buttonImageOnly: true -}) -}); -</script> -<input type="text" size="30" value="<?php echo $vars['value']; ?>" name="<?php echo $vars['internalname']; ?>" id="<?php echo $vars['internalname']; ?>"/>
\ No newline at end of file diff --git a/views/default/input/timepicker.php b/views/default/input/timepicker.php index d7df04699..2cc95ced7 100644 --- a/views/default/input/timepicker.php +++ b/views/default/input/timepicker.php @@ -1,5 +1,4 @@ <?php - $time_format = elgg_get_plugin_setting('timeformat', 'event_calendar'); if (!$time_format) { $time_format = '24'; @@ -9,45 +8,44 @@ $value = $vars['value']; if (is_numeric($value)) { $hour = floor($value/60); $minute = ($value -60*$hour); - $time = $hour*60+$minute; } else { - $time = '-'; + $hour = 0; + $minute = 0; } -$dates = array(); -$dates['-'] = '-'; +$hours = array(); +$minutes = array(); if ($time_format == '12') { - for($h=0;$h<=12;$h++) { - $ht = sprintf("%02d",$h); - for($m=0;$m<60;$m=$m+15) { - $mt = sprintf("%02d",$m); - $t = $h*60+$m; - if ($h < 12) { - $dates[$t] = "$ht:$mt am"; - } else { - $dates[$t] = "$ht:$mt pm"; - } - } + $meridians = array('am'=>'am','pm'=>'pm'); + if ($hour == 0) { + $hour = 12; + $meridian = 'am'; + } else if ($hour == 12) { + $meridian = 'pm'; + } else if ($hour < 12) { + $meridian = 'am'; + } else { + $hour -= 12; + $meridian = 'pm'; } - for($h=1;$h<12;$h++) { - $ht = sprintf("%02d",$h); - for($m=0;$m<60;$m=$m+15) { - $mt = sprintf("%02d",$m); - $t = 12*60+$h*60+$m; - $dates[$t] = "$ht:$mt pm"; - } + for($h=1;$h<=12;$h++) { + $hours[$h] = $h; } } else { - for($h=0;$h<24;$h++) { - $ht = sprintf("%02d",$h); - for($m=0;$m<60;$m=$m+15) { - $mt = sprintf("%02d",$m); - $t = $h*60+$m; - $dates[$t] = "$ht:$mt"; - } + for($h=0;$h<=23;$h++) { + $hours[$h] = $h; } -} +} -echo elgg_view('input/dropdown',array('name'=>$vars['name'],'value'=>$time,'options_values'=>$dates)); +for($m=0;$m<60;$m=$m+5) { + $mt = sprintf("%02d",$m); + $minutes[$m] = $mt; +} +echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_hour','value'=>$hour,'options_values'=>$hours)); +echo " <b>:</b> "; +echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_minute','value'=>$minute,'options_values'=>$minutes)); +if ($time_format == '12') { + echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_meridian','value'=>$meridian,'options_values'=>$meridians)); +} |