aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--models/model.php27
-rw-r--r--start.php2
-rw-r--r--views/default/input/timepicker.php6
-rw-r--r--views/default/object/event_calendar.php20
4 files changed, 38 insertions, 17 deletions
diff --git a/models/model.php b/models/model.php
index d4bc5d0a7..52fd472b3 100644
--- a/models/model.php
+++ b/models/model.php
@@ -81,14 +81,31 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) {
$event->end_date = get_input('end_date');
if ($event_calendar_times == 'yes') {
- $event->start_time = get_input('start_time');
- //$event->original_start_date = $event->start_date;
+ $sh = get_input('start_time_h','');
+ $sm = get_input('start_time_m','');
+ if (is_numeric($sh) && is_numeric($sm)) {
+ // workaround for pulldown zero value bug
+ $sh--;
+ $sm--;
+ $event->start_time = $sh*60+$sm;
+ } else {
+ $event->start_time = '';
+ }
+ $eh = get_input('end_time_h','');
+ $em = get_input('end_time_m','');
+ if (is_numeric($eh) && is_numeric($em)) {
+ // workaround for pulldown zero value bug
+ $eh--;
+ $em--;
+ $event->end_time = $eh*60+$em;
+ } else {
+ $event->end_time = '';
+ }
if (is_numeric($event->start_time)) {
// Set start date to the Unix start time, if set.
// This allows sorting by date *and* time.
$event->start_date += $event->start_time*60;
}
- $event->end_time = get_input('end_time');
}
if ($event_calendar_spots_display == 'yes') {
$event->spots = trim(get_input('spots'));
@@ -377,7 +394,7 @@ function event_calendar_get_entities_from_metadata_between($meta_start_name, $me
if (!$count) {
$query .= " order by $order_by limit $offset, $limit"; // Add order and limit
$entities = get_data($query, "entity_row_to_elggstar");
- if (get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') {
+ if (elgg_get_plugin_setting('add_to_group_calendar', 'event_calendar') == 'yes') {
if (get_entity($container_guid) instanceOf ElggGroup) {
$entities = event_calendar_get_entities_from_metadata_between_related($meta_start_name, $meta_end_name,
$meta_start_value, $meta_end_value, $entity_type,
@@ -1011,7 +1028,7 @@ function event_calendar_get_page_content_list($page_type,$group_guid,$start_date
forward();
}
elgg_push_breadcrumb(elgg_echo('event_calendar:group_breadcrumb'));
- elgg_set_context('groups');
+ elgg_push_context('groups');
elgg_set_page_owner_guid($group_guid);
$user_guid = elgg_get_logged_in_user_guid();
$group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar');
diff --git a/start.php b/start.php
index 967e40b8a..330f10092 100644
--- a/start.php
+++ b/start.php
@@ -241,7 +241,7 @@ function event_calendar_page_handler($page) {
}
/**
- * Add particular blog links/info to entity menu
+ * Add particular event calendar links/info to entity menu
*/
function event_calendar_entity_menu_setup($hook, $type, $return, $params) {
if (elgg_in_context('widgets')) {
diff --git a/views/default/input/timepicker.php b/views/default/input/timepicker.php
index 35fa5ac98..faadd6450 100644
--- a/views/default/input/timepicker.php
+++ b/views/default/input/timepicker.php
@@ -1,6 +1,6 @@
<?php
-$time_format = get_plugin_setting('timeformat', 'event_calendar');
+$time_format = elgg_get_plugin_setting('timeformat', 'event_calendar');
if (!$time_format) {
$time_format = 24;
}
@@ -32,7 +32,7 @@ for($i=0;$i<60;$i=$i+5) {
$minutes[$i+1] = sprintf("%02d",$i);
}
-echo elgg_view('input/pulldown',array('internalname'=>$vars['internalname'].'_h','value'=>$hour,'options_values'=>$hours));
-echo elgg_view('input/pulldown',array('internalname'=>$vars['internalname'].'_m','value'=>$minute,'options_values'=>$minutes));
+echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_h','value'=>$hour,'options_values'=>$hours));
+echo elgg_view('input/dropdown',array('name'=>$vars['name'].'_m','value'=>$minute,'options_values'=>$minutes));
?> \ No newline at end of file
diff --git a/views/default/object/event_calendar.php b/views/default/object/event_calendar.php
index 97829e7c2..43e7847dc 100644
--- a/views/default/object/event_calendar.php
+++ b/views/default/object/event_calendar.php
@@ -36,7 +36,7 @@ if ($vars['full']) {
'class' => 'elgg-menu-hz',
));
- $tags = elgg_view('output/tags', array('tags' => $event->event_tags));
+ $tags = elgg_view('output/tags', array('tags' => $event->tags));
$params = array(
'entity' => $event,
@@ -73,14 +73,18 @@ if ($vars['full']) {
$info = '';
}
- $metadata = elgg_view_menu('entity', array(
- 'entity' => $event,
- 'handler' => 'event_calendar',
- 'sort_by' => 'priority',
- 'class' => 'elgg-menu-hz',
- ));
+ if (elgg_in_context('widgets')) {
+ $metadata = '';
+ } else {
+ $metadata = elgg_view_menu('entity', array(
+ 'entity' => $event,
+ 'handler' => 'event_calendar',
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+ ));
+ }
- $tags = elgg_view('output/tags', array('tags' => $event->event_tags));
+ $tags = elgg_view('output/tags', array('tags' => $event->tags));
$params = array(
'entity' => $event,