diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/css/elements/forms/datepicker_multi.php | 39 | ||||
-rw-r--r-- | views/default/event_calendar/css.php | 41 | ||||
-rw-r--r-- | views/default/event_calendar/datetime_edit.php | 13 | ||||
-rw-r--r-- | views/default/event_calendar/filter_menu.php | 4 | ||||
-rw-r--r-- | views/default/event_calendar/full_calendar_view.php | 81 | ||||
-rw-r--r-- | views/default/event_calendar/repeat_form_element.php | 49 | ||||
-rw-r--r-- | views/default/event_calendar/share_section.php | 6 | ||||
-rw-r--r-- | views/default/forms/event_calendar/edit.php | 50 | ||||
-rw-r--r-- | views/default/js/event_calendar/event_calendar.php | 23 | ||||
-rw-r--r-- | views/default/river/object/event_calendar/create.php | 23 | ||||
-rw-r--r-- | views/default/river/object/event_calendar/update.php | 19 |
11 files changed, 191 insertions, 157 deletions
diff --git a/views/default/css/elements/forms/datepicker_multi.php b/views/default/css/elements/forms/datepicker_multi.php new file mode 100644 index 000000000..4a18bdad1 --- /dev/null +++ b/views/default/css/elements/forms/datepicker_multi.php @@ -0,0 +1,39 @@ +<?php + +?> + +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + margin-bottom: 0.4em; + margin-left: auto; + margin-right: auto; + margin-top: 0; + width: 95%; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { + border-left-width-ltr-source: physical; + border-left-width-rtl-source: physical; + border-left-width-value: 0; +} +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width-ltr-source: physical; + border-left-width-rtl-source: physical; + border-left-width-value: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} diff --git a/views/default/event_calendar/css.php b/views/default/event_calendar/css.php index c1dbf4633..00cfd6cbb 100644 --- a/views/default/event_calendar/css.php +++ b/views/default/event_calendar/css.php @@ -38,6 +38,10 @@ ul#calendarmenu li a:hover, ul#calendarmenu li.sys_selected a{ background: <?php echo $highlight_colour; ?>; } +.event-calendar-ical { + width: 200px; +} + td.ui-datepicker-unselectable { background-color: #FFFFFF !important; color: #888888 !important; @@ -171,39 +175,12 @@ li.event-calendar-filter-menu-show-only { margin-right: 10px; } -.event-calendar-medium-text { - width: 500px !important; -} - -.event-calendar-edit-form-block label { - float: left; - width: 90px; - margin-top: 5px; -} - -.event-calendar-long-text { - width: 500px !important; -} - -.event-calendar-edit-form-other-block .mceLayout { - width: 500px !important; -} - -.event-calendar-edit-form { - background-color: #FFFFFF; -} - -.event-calendar-edit-form-block { - width: 90%; - background-color: #DDDDDD; - border-width:1px; - border-style:solid; - border-color:#bfbfbf; - padding: 5px; - margin-bottom: 10px; - clear: both; +fieldset > legend { + font-weight: bold; + font-size: 1.2em; + line-height: 1.1em; + padding-bottom: 5px; } - .event-calendar-repeating-wrapper { padding: 0; margin-top: 5px; diff --git a/views/default/event_calendar/datetime_edit.php b/views/default/event_calendar/datetime_edit.php index 64af30f53..2e0830167 100644 --- a/views/default/event_calendar/datetime_edit.php +++ b/views/default/event_calendar/datetime_edit.php @@ -8,20 +8,17 @@ if ($event_calendar_times != 'no') { if ($event_calendar_hide_end != 'yes') { $body .= '<p><label>'.elgg_echo('event_calendar:from_label').'</label>'; } - $body .= elgg_view("event_calendar/input/date_local",array( - //'timestamp'=>TRUE, - 'autocomplete'=>'off', + $body .= elgg_view("input/date", array( 'class'=>'event-calendar-compressed-date', 'name' => 'start_date', - 'value'=>$vars['start_date'])); + 'value'=>$vars['start_date'], + )); $body .= '<span id="event-calendar-start-time-wrapper">'; $body .= elgg_view("input/timepicker",array('name' => 'start_time','value'=>$vars['start_time'])); $body .= '</span>'; if ($event_calendar_hide_end != 'yes') { $body .= '</p><p id="event-calendar-to-time-wrapper"><label>'.elgg_echo('event_calendar:to_label').'</label>'; - $body .= elgg_view("event_calendar/input/date_local",array( - //'timestamp'=>TRUE, - 'autocomplete'=>'off', + $body .= elgg_view("input/date", array( 'class'=>'event-calendar-compressed-date', 'name' => 'end_date', 'value'=>$vars['end_date'], @@ -30,7 +27,7 @@ if ($event_calendar_times != 'no') { $body .= elgg_view("input/timepicker",array('name' => 'end_time','value'=>$vars['end_time'])); $body .= '</span>'; } - $body .= '</p></span>'; + $body .= '</p>'; } else { $body .= '<p><label>'.elgg_echo("event_calendar:start_date_label").'<br />'; diff --git a/views/default/event_calendar/filter_menu.php b/views/default/event_calendar/filter_menu.php index 926a29d0d..1364902a8 100644 --- a/views/default/event_calendar/filter_menu.php +++ b/views/default/event_calendar/filter_menu.php @@ -30,9 +30,6 @@ if (elgg_is_logged_in()) { 'selected' => ($filter_context == 'friends'), 'priority' => 400, ); - $text_bit = '<li class="event-calendar-filter-menu-show-only">'.elgg_echo('event_calendar:show_only').'</li>'; -} else { - $text_bit = ''; } $tab_rendered = array(); @@ -66,7 +63,6 @@ $menu = <<<__MENU <ul class="elgg-menu elgg-menu-filter elgg-menu-hz elgg-menu-filter-default"> {$tab_rendered['open']} {$tab_rendered['all']} - $text_bit {$tab_rendered['mine']} {$tab_rendered['friend']} </ul> diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php index 3e0c583ce..1a58321b5 100644 --- a/views/default/event_calendar/full_calendar_view.php +++ b/views/default/event_calendar/full_calendar_view.php @@ -1,7 +1,7 @@ <?php elgg_load_js('elgg.full_calendar'); -elgg_load_js('lightbox'); -elgg_load_css('lightbox'); + +$timeformat = elgg_get_plugin_setting('timeformat', 'event_calendar') == 24 ? 'H(:mm)' : 'h(:mm)t'; // TODO: is there an easy way to avoid embedding JS? ?> @@ -11,13 +11,8 @@ var goToDateFlag = 0; handleEventClick = function(event) { if (event.url) { - if (event.is_event_poll) { - window.location.href = event.url; - } else { - //window.location.href = event.url; - $.fancybox({'href':event.url}); - } - return false; + window.location.href = event.url; + event.preventDefault(); } }; @@ -149,25 +144,57 @@ handleViewDisplay = function(view) { //$(".fc-widget-content[data-date='20120105']") } -$(document).ready(function() { - $('#calendar').fullCalendar({ - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>, - ignoreTimezone: true, - editable: true, - slotMinutes: 15, - eventRender: handleEventRender, - eventDrop: handleEventDrop, - eventClick: handleEventClick, - dayClick: handleDayClick, - events: handleGetEvents, - viewDisplay: handleViewDisplay, +fullcalendarInit = function() { + + var loadFullCalendar = function() { + var locale = $.datepicker.regional[elgg.get_language()]; + if (!locale) { + locale = $.datepicker.regional['']; + } + $('#calendar').fullCalendar({ + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + month: <?php echo date('n',strtotime($vars['start_date']))-1; ?>, + ignoreTimezone: true, + editable: true, + slotMinutes: 15, + eventRender: handleEventRender, + eventDrop: handleEventDrop, + eventClick: handleEventClick, + dayClick: handleDayClick, + events: handleGetEvents, + viewDisplay: handleViewDisplay, + + isRTL: locale.isRTL, + firstDay: locale.firstDay, + monthNames: locale.monthNames, + monthNamesShort: locale.monthNamesShort, + dayNames: locale.dayNames, + dayNamesShort: locale.dayNamesShort, + buttonText: { + today: locale.currentText, + month: elgg.echo('event_calendar:month_label'), + week: elgg.echo('event_calendar:week_label'), + day: elgg.echo('event_calendar:day_label') + }, + timeFormat: "<?php echo $timeformat; ?>", + }); + } + + elgg.get({ + url: elgg.config.wwwroot + 'vendors/jquery/i18n/jquery.ui.datepicker-'+ elgg.get_language() +'.js', + dataType: "script", + cache: true, + success: loadFullCalendar, + error: loadFullCalendar, // english language is already loaded. }); -}); +} + +elgg.register_hook_handler('init', 'system', fullcalendarInit); + </script> <div id='calendar'></div> <input type="hidden" id="event-calendar-selected-date" /> diff --git a/views/default/event_calendar/repeat_form_element.php b/views/default/event_calendar/repeat_form_element.php index 45fdabfa1..5de858caf 100644 --- a/views/default/event_calendar/repeat_form_element.php +++ b/views/default/event_calendar/repeat_form_element.php @@ -1,6 +1,8 @@ <?php $event = $vars['event']; $fd = $vars['form_data']; +$days = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); + if ($fd['repeats'] == 'yes') { echo elgg_view('input/checkbox',array('name'=>'repeats','value'=>'yes','checked'=>'checked')); } else { @@ -10,34 +12,21 @@ echo elgg_echo('event_calendar:repeat_interval_label').' '; echo elgg_view('input/dropdown',array('name'=>'repeat_interval','value'=>$fd['repeat_interval'],'options_values'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8'))); echo ' '.elgg_echo('event_calendar:repeat_weeks'); echo ' '.elgg_echo('event_calendar:on_these_days'); -?> -<div class="event-calendar-repeating-wrapper"> -<a id="event-calendar-repeating-monday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:monday'); ?> + +echo '<div class="event-calendar-repeating-wrapper">'; + +foreach($days as $day) { + $label = elgg_echo("event_calendar:day_abbrev:$day"); + echo <<<HTML +<a id="event-calendar-repeating-$day" href="javascript:void(0);" class="event-calendar-repeating-unselected"> + $label </a> -<a id="event-calendar-repeating-tuesday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:tuesday'); ?> -</a> -<a id="event-calendar-repeating-wednesday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:wednesday'); ?> -</a> -<a id="event-calendar-repeating-thursday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:thursday'); ?> -</a> -<a id="event-calendar-repeating-friday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:friday'); ?> -</a> -<a id="event-calendar-repeating-saturday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:saturday'); ?> -</a> -<a id="event-calendar-repeating-sunday" href="javascript:void(0);" class="event-calendar-repeating-unselected"> - <?php echo elgg_echo('event_calendar:day_abbrev:sunday'); ?> -</a> -</div> -<input type="hidden" name="event-calendar-repeating-monday-value" value="<?php echo $fd['event-calendar-repeating-monday-value']; ?>"> -<input type="hidden" name="event-calendar-repeating-tuesday-value" value="<?php echo $fd['event-calendar-repeating-tuesday-value']; ?>"> -<input type="hidden" name="event-calendar-repeating-wednesday-value" value="<?php echo $fd['event-calendar-repeating-wednesday-value']; ?>"> -<input type="hidden" name="event-calendar-repeating-thursday-value" value="<?php echo $fd['event-calendar-repeating-thursday-value']; ?>"> -<input type="hidden" name="event-calendar-repeating-friday-value" value="<?php echo $fd['event-calendar-repeating-friday-value']; ?>"> -<input type="hidden" name="event-calendar-repeating-saturday-value" value="<?php echo $fd['event-calendar-repeating-saturday-value']; ?>"> -<input type="hidden" name="event-calendar-repeating-sunday-value" value="<?php echo $fd['event-calendar-repeating-sunday-value']; ?>"> +HTML; + +} + +echo '</div>'; + +foreach($days as $day) { + echo elgg_view('input/hidden', array('name' => "event-calendar-repeating-$day-value", 'value' => $fd["event-calendar-repeating-$day-value"])); +}
\ No newline at end of file diff --git a/views/default/event_calendar/share_section.php b/views/default/event_calendar/share_section.php index 134f07656..c4f6cf45f 100644 --- a/views/default/event_calendar/share_section.php +++ b/views/default/event_calendar/share_section.php @@ -1,8 +1,8 @@ <?php $fd = $vars['form_data']; $event_calendar_hide_access = elgg_get_plugin_setting('hide_access', 'event_calendar'); -$body = '<div class="event-calendar-edit-form-block event-calendar-edit-form-share-block">'; -$body .= '<h2>'.elgg_echo('event_calendar:permissions:header').'</h2>'; +$body = '<fieldset>'; +$body .= '<legend>'.elgg_echo('event_calendar:permissions:header').'</legend>'; if($event_calendar_hide_access == 'yes') { $event_calendar_default_access = elgg_get_plugin_setting('default_access', 'event_calendar'); if($event_calendar_default_access) { @@ -21,6 +21,6 @@ if (elgg_plugin_exists('entity_admins')) { $body .= elgg_echo('event_calendar:share_ownership:description'); $body .= elgg_view('input/entity_admins_dropdown',array('entity'=>$vars['event'])); } -$body .= '</div>'; +$body .= '</fieldset>'; echo $body; diff --git a/views/default/forms/event_calendar/edit.php b/views/default/forms/event_calendar/edit.php index c2210c5f8..747dae0f0 100644 --- a/views/default/forms/event_calendar/edit.php +++ b/views/default/forms/event_calendar/edit.php @@ -70,30 +70,38 @@ $all_day = $fd['all_day']; $schedule_type = $fd['schedule_type']; $long_description = $fd['long_description']; -$body = '<div class="event-calendar-edit-form">'; +$body = '<div>'; $body .= elgg_view('input/hidden',array('name'=>'event_action', 'value'=>$event_action)); $body .= elgg_view('input/hidden',array('name'=>'event_guid', 'value'=>$event_guid)); -$body .= '<div class="event-calendar-edit-form-block event-calendar-edit-form-top-block">'; +$body .= '<fieldset>'; +$body .= '<legend>' . elgg_echo('event_calendar:basic:header') . '</legend>'; $body .= '<p><label>'.elgg_echo("event_calendar:title_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'title','class'=>'event-calendar-medium-text','value'=>$title)); +$body .= elgg_view("input/text",array('name' => 'title', 'value' => $title)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['title'].elgg_echo('event_calendar:title_description').'</p>'; $body .= '<p><label>'.elgg_echo("event_calendar:venue_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'venue','class'=>'event-calendar-medium-text','value'=>$venue)); +$body .= elgg_view("input/text",array('name' => 'venue', 'value' => $venue)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['venue'].elgg_echo('event_calendar:venue_description').'</p>'; -$body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'</label>'; -$body .= elgg_view("input/text",array('name' => 'description','class'=>'event-calendar-medium-text','value'=>$brief_description)); -$body .= '</p>'; -$body .= '<p class="event-calendar-description">'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'</p>'; +if ($event_calendar_fewer_fields != 'yes') { + $body .= '<p><label>'.elgg_echo("event_calendar:brief_description_label").'</label>'; + $body .= elgg_view("input/text",array('name' => 'description', 'value' => $brief_description)); + $body .= '</p>'; + $body .= '<p class="event-calendar-description">'.$prefix['brief_description'].elgg_echo('event_calendar:brief_description_description').'</p>'; + +} else { + $body .= '<label>'.elgg_echo("event_calendar:long_description_label").'</label>'; + $body .= elgg_view("input/longtext",array('name' => 'long_description', 'value' => $long_description)); + $body .= '<p class="event-calendar-description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; +} $body .= '<p><label>'.elgg_echo("event_calendar:event_tags_label").'</label>'; -$body .= elgg_view("input/tags",array('name' => 'tags','class'=>'event-calendar-medium-text','value'=>$event_tags)); +$body .= elgg_view("input/tags",array('name' => 'tags', 'value' => $event_tags)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['event_tags'].elgg_echo('event_calendar:event_tags_description').'</p>'; @@ -117,11 +125,11 @@ if($event_calendar_bbb_server_url) { $body .= '</p>'; } -$body .= '</div>'; +$body .= '</fieldset>'; -$body .= '<div class="event-calendar-edit-form-block event-calendar-edit-form-schedule-block">'; -$body .= '<h2>'.elgg_echo('event_calendar:schedule:header').'</h2>'; -$body .= elgg_view('input/radio',array('id'=>'event-calendar-edit-schedule-type','name'=>'schedule_type','value'=>$schedule_type,'options'=>$schedule_options)); +$body .= '<fieldset>'; +$body .= '<legend>'.elgg_echo('event_calendar:schedule:header').'</legend>'; +$body .= elgg_view('input/radio',array('name'=>'schedule_type','value'=>$schedule_type,'options'=>$schedule_options)); $vars['prefix'] = $prefix; @@ -129,20 +137,20 @@ $body .= elgg_view('event_calendar/schedule_section',$vars); if ($event_calendar_spots_display == 'yes') { $body .= '<p><label>'.elgg_echo("event_calendar:spots_label").'<br />'; - $body .= elgg_view("input/text",array('name' => 'spots','class'=>'event-calendar-medium-text','value'=>$spots)); + $body .= elgg_view("input/text",array('name' => 'spots', 'value' => $spots)); $body .= '</label></p>'; $body .= '<p class="event-calendar-description">'.$prefix['spots'].elgg_echo('event_calendar:spots_description').'</p>'; } $body .= '<div class="event-calendar-edit-bottom"></div>'; -$body .= '</div>'; +$body .= '</fieldset>'; $body .= elgg_view('event_calendar/personal_manage_section',$vars); $body .= elgg_view('event_calendar/share_section',$vars); if ($event_calendar_region_display == 'yes' || $event_calendar_type_display == 'yes' || $event_calendar_fewer_fields != 'yes') { - $body .= '<div class="event-calendar-edit-form-block event-calendar-edit-form-other-block">'; + $body .= '<fieldset>'; if ($event_calendar_region_display == 'yes') { $region_list = trim(elgg_get_plugin_setting('region_list', 'event_calendar')); @@ -195,27 +203,27 @@ if ($event_calendar_region_display == 'yes' || $event_calendar_type_display == ' if ($event_calendar_fewer_fields != 'yes') { $body .= '<p><label>'.elgg_echo("event_calendar:fees_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'fees','class'=>'event-calendar-medium-text','value'=>$fees)); + $body .= elgg_view("input/text",array('name' => 'fees', 'value' => $fees)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['fees'].elgg_echo('event_calendar:fees_description').'</p>'; $body .= '<p><label>'.elgg_echo("event_calendar:contact_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'contact','class'=>'event-calendar-medium-text','value'=>$contact)); + $body .= elgg_view("input/text",array('name' => 'contact', 'value' => $contact)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['contact'].elgg_echo('event_calendar:contact_description').'</p>'; $body .= '<p><label>'.elgg_echo("event_calendar:organiser_label").'</label>'; - $body .= elgg_view("input/text",array('name' => 'organiser','class'=>'event-calendar-medium-text','value'=>$organiser)); + $body .= elgg_view("input/text",array('name' => 'organiser', 'value' => $organiser)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['organiser'].elgg_echo('event_calendar:organiser_description').'</p>'; $body .= '<p><label>'.elgg_echo("event_calendar:long_description_label").'</label>'; - $body .= elgg_view("input/longtext",array('name' => 'long_description','class'=>'event-calendar-long-text','value'=>$long_description)); + $body .= elgg_view("input/longtext",array('name' => 'long_description', 'value' => $long_description)); $body .= '</p>'; $body .= '<p class="event-calendar-description">'.$prefix['long_description'].elgg_echo('event_calendar:long_description_description').'</p>'; } - $body .= '</div>'; + $body .= '</fieldset>'; } $body .= elgg_view('input/submit', array('name'=>'submit','value'=>elgg_echo('event_calendar:submit'))); diff --git a/views/default/js/event_calendar/event_calendar.php b/views/default/js/event_calendar/event_calendar.php index 65c4d2952..efa1dc1dd 100644 --- a/views/default/js/event_calendar/event_calendar.php +++ b/views/default/js/event_calendar/event_calendar.php @@ -10,7 +10,7 @@ elgg.event_calendar.init = function () { $('.event-calendar-repeating-unselected').live('click',elgg.event_calendar.handleRepeatingSelect); $('.event-calendar-repeating-selected').live('click',elgg.event_calendar.handleRepeatingUnselect); $('#event-calendar-edit').submit(elgg.event_calendar.handleEditFormSubmit); - $('#event-calendar-edit-schedule-type').click(elgg.event_calendar.handleScheduleType); + $('input.elgg-input-radio[name="schedule_type"]').click(elgg.event_calendar.handleScheduleType); elgg.event_calendar.handleScheduleType(); var all_day_field = $('[name="all_day"][type="checkbox"]'); @@ -21,10 +21,16 @@ elgg.event_calendar.init = function () { $('#event-calendar-end-time-wrapper').attr('disabled','disabled'); } all_day_field.change(elgg.event_calendar.handleAllDayField); + + $('.elgg-input-date[name="start_date"], .elgg-input-date[name="end_date"]').datepicker({ + dateFormat: 'yy-mm-dd', + numberOfMonths: 3, + onSelect: elgg.event_calendar.handleDateRangeSelect, + }); } elgg.event_calendar.handleScheduleType = function(e) { - var st = $('#event-calendar-edit-schedule-type:checked').val(); + var st = $('input.elgg-input-radio[name="schedule_type"]:checked').val(); if (st == 'poll') { $(".event-calendar-edit-date-wrapper").hide(); $(".event-calendar-edit-reminder-wrapper").hide(); @@ -61,6 +67,14 @@ elgg.event_calendar.handleAllDayField = function(e) { } } +elgg.event_calendar.handleDateRangeSelect = function(selectedDate) { + if (this.name == 'start_date') { + $('.elgg-input-date[name="end_date"]').datepicker("option", "minDate", selectedDate); + } else { + $('.elgg-input-date[name="start_date"]').datepicker("option", "maxDate", selectedDate); + } +} + elgg.event_calendar.handleEditFormSubmit = function(e) { if ($.trim($('[name="title"]').val()) == '') { alert(elgg.echo('event_calendar:edit_form:error:missing_title')); @@ -96,9 +110,8 @@ elgg.event_calendar.handleRegionChange = function(e) { } elgg.event_calendar.handleIcalPopup = function(e) { - var message = elgg.echo('event_calendar:ical_popup_message')+"\n"+this.href; - alert(message); - return false; + this.href = '#event-calendar-ical'; + e.preventDefault(); } elgg.event_calendar.handlePagedPersonalCalendarToggle = function() { diff --git a/views/default/river/object/event_calendar/create.php b/views/default/river/object/event_calendar/create.php index e74a8f891..515389411 100644 --- a/views/default/river/object/event_calendar/create.php +++ b/views/default/river/object/event_calendar/create.php @@ -1,22 +1,13 @@ <?php - - /*$performed_by = get_entity($vars['item']->subject_guid); - $object = get_entity($vars['item']->object_guid); - - $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; - $string = sprintf(elgg_echo("event_calendar:river:created"),$url) . " "; - $string .= elgg_echo("event_calendar:river:create")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";*/ - /** - * Event calendar river view. + * Event river view. */ +elgg_load_library('elgg:event_calendar'); + $object = $vars['item']->getObjectEntity(); -$excerpt = strip_tags($object->description); -$vars['excerpt'] = elgg_get_excerpt($excerpt); -echo elgg_view('page/components/image_block', array( - 'image' => '<img src="'.$vars['url'] . 'mod/event_calendar/images/event_icon.gif" />', - 'body' => elgg_view('river/elements/body', $vars), - 'class' => 'elgg-river-item', -));
\ No newline at end of file +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'message' => event_calendar_get_formatted_time($object), +)); diff --git a/views/default/river/object/event_calendar/update.php b/views/default/river/object/event_calendar/update.php index f4526cd2a..515389411 100644 --- a/views/default/river/object/event_calendar/update.php +++ b/views/default/river/object/event_calendar/update.php @@ -1,16 +1,13 @@ <?php +/** + * Event river view. + */ + +elgg_load_library('elgg:event_calendar'); - /*$performed_by = get_entity($vars['item']->subject_guid); - $object = get_entity($vars['item']->object_guid); - - $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>"; - $string = sprintf(elgg_echo("event_calendar:river:updated"),$url) . " "; - $string .= elgg_echo("event_calendar:river:the_event")." <a href=\"" . $object->getURL() . "\">" . $object->title . "</a>";*/ - $object = $vars['item']->getObjectEntity(); -echo elgg_view('page/components/image_block', array( - 'image' => '<img src="'.$vars['url'] . 'mod/event_calendar/images/event_icon.gif" />', - 'body' => elgg_view('river/elements/body', $vars), - 'class' => 'elgg-river-item', +echo elgg_view('river/elements/layout', array( + 'item' => $vars['item'], + 'message' => event_calendar_get_formatted_time($object), )); |