Merge https://github.com/redmatrix/hubzilla into pending_merge
This commit is contained in:
		| @@ -21,35 +21,37 @@ function format_event_html($ev) { | |||||||
|  |  | ||||||
| 	$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8:01 AM | 	$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8:01 AM | ||||||
|  |  | ||||||
|  | 	//todo: move this to template | ||||||
|  |  | ||||||
| 	$o = '<div class="vevent">' . "\r\n"; | 	$o = '<div class="vevent">' . "\r\n"; | ||||||
|  |  | ||||||
| 	$o .= '<p class="summary event-summary">' . bbcode($ev['summary']) .  '</p>' . "\r\n"; | 	$o .= '<div class="event-title"><h3><i class="icon-calendar"></i> ' . bbcode($ev['summary']) .  '</h3></div>' . "\r\n"; | ||||||
|  |  | ||||||
| 	$o .= '<p class="description event-description">' . bbcode($ev['description']) .  '</p>' . "\r\n"; | 	$o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span> <span class="dtstart" title="' | ||||||
|  |  | ||||||
| 	$o .= '<p class="event-start">' . t('Starts:') . ' <abbr class="dtstart" title="' |  | ||||||
| 		. datetime_convert('UTC', 'UTC', $ev['start'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) | 		. datetime_convert('UTC', 'UTC', $ev['start'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) | ||||||
| 		. '" >'  | 		. '" >'  | ||||||
| 		. (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),  | 		. (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),  | ||||||
| 			$ev['start'] , $bd_format )) | 			$ev['start'] , $bd_format )) | ||||||
| 			:  day_translate(datetime_convert('UTC', 'UTC',  | 			:  day_translate(datetime_convert('UTC', 'UTC',  | ||||||
| 			$ev['start'] , $bd_format))) | 			$ev['start'] , $bd_format))) | ||||||
| 		. '</abbr></p>' . "\r\n"; | 		. '</span></div>' . "\r\n"; | ||||||
|  |  | ||||||
| 	if(! $ev['nofinish']) | 	if(! $ev['nofinish']) | ||||||
| 		$o .= '<p class="event-end" >' . t('Finishes:') . ' <abbr class="dtend" title="' | 		$o .= '<div class="event-end" ><span class="event-label">' . t('Finishes:') . '</span> <span class="dtend" title="' | ||||||
| 			. datetime_convert('UTC','UTC',$ev['finish'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) | 			. datetime_convert('UTC','UTC',$ev['finish'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' )) | ||||||
| 			. '" >'  | 			. '" >'  | ||||||
| 			. (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),  | 			. (($ev['adjust']) ? day_translate(datetime_convert('UTC', date_default_timezone_get(),  | ||||||
| 				$ev['finish'] , $bd_format )) | 				$ev['finish'] , $bd_format )) | ||||||
| 				:  day_translate(datetime_convert('UTC', 'UTC',  | 				:  day_translate(datetime_convert('UTC', 'UTC',  | ||||||
| 				$ev['finish'] , $bd_format ))) | 				$ev['finish'] , $bd_format ))) | ||||||
| 			. '</abbr></p>'  . "\r\n"; | 			. '</span></div>'  . "\r\n"; | ||||||
|  |  | ||||||
|  | 	$o .= '<div class="event-description">' . bbcode($ev['description']) .  '</div>' . "\r\n"; | ||||||
|  |  | ||||||
| 	if(strlen($ev['location'])) | 	if(strlen($ev['location'])) | ||||||
| 		$o .= '<p class="event-location"> ' . t('Location:') . ' <span class="location">'  | 		$o .= '<div class="event-location"><span class="event-label"> ' . t('Location:') . '</span> <span class="location">'  | ||||||
| 			. bbcode($ev['location']) | 			. bbcode($ev['location']) | ||||||
| 			. '</span></p>' . "\r\n"; | 			. '</span></div>' . "\r\n"; | ||||||
|  |  | ||||||
| 	$o .= '</div>' . "\r\n"; | 	$o .= '</div>' . "\r\n"; | ||||||
|  |  | ||||||
| @@ -887,7 +889,7 @@ function event_store_item($arr, $event) { | |||||||
| 		$item_arr['verb']            = ACTIVITY_POST; | 		$item_arr['verb']            = ACTIVITY_POST; | ||||||
| 		$item_arr['item_wall']       = $item_wall; | 		$item_arr['item_wall']       = $item_wall; | ||||||
| 		$item_arr['item_origin']     = $item_origin; | 		$item_arr['item_origin']     = $item_origin; | ||||||
| 		$item_arr['item_thread_top'] = $item_thread_top;; | 		$item_arr['item_thread_top'] = $item_thread_top; | ||||||
|  |  | ||||||
| 		$attach = array(array( | 		$attach = array(array( | ||||||
| 			'href' => z_root() . '/events/ical/' .  urlencode($event['event_hash']), | 			'href' => z_root() . '/events/ical/' .  urlencode($event['event_hash']), | ||||||
|   | |||||||
| @@ -91,7 +91,11 @@ function events_post(&$a) { | |||||||
| 	linkify_tags($a, $location, local_channel()); | 	linkify_tags($a, $location, local_channel()); | ||||||
|  |  | ||||||
| 	$action = ($event_hash == '') ? 'new' : "event/" . $event_hash; | 	$action = ($event_hash == '') ? 'new' : "event/" . $event_hash; | ||||||
| 	$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; |  | ||||||
|  | 	//fixme: this url gives a wsod if there is a linebreak detected in one of the variables ($desc or $location) | ||||||
|  | 	//$onerror_url = $a->get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish&type=$type"; | ||||||
|  | 	$onerror_url = $a->get_baseurl() . "/events"; | ||||||
|  |  | ||||||
| 	if(strcmp($finish,$start) < 0 && !$nofinish) { | 	if(strcmp($finish,$start) < 0 && !$nofinish) { | ||||||
| 		notice( t('Event can not end before it has started.') . EOL); | 		notice( t('Event can not end before it has started.') . EOL); | ||||||
| 		if(intval($_REQUEST['preview'])) { | 		if(intval($_REQUEST['preview'])) { | ||||||
| @@ -366,7 +370,7 @@ function events_content(&$a) { | |||||||
|  |  | ||||||
| 		$sdt = ((x($orig_event)) ? $orig_event['start'] : 'now'); | 		$sdt = ((x($orig_event)) ? $orig_event['start'] : 'now'); | ||||||
|  |  | ||||||
| 		$fdt = ((x($orig_event)) ? $orig_event['finish'] : 'now'); | 		$fdt = ((x($orig_event)) ? $orig_event['finish'] : '+1 hour'); | ||||||
|  |  | ||||||
| 		$tz = date_default_timezone_get(); | 		$tz = date_default_timezone_get(); | ||||||
| 		if(x($orig_event)) | 		if(x($orig_event)) | ||||||
| @@ -380,8 +384,12 @@ function events_content(&$a) { | |||||||
| 		$smonth = datetime_convert('UTC', $tz, $sdt, 'm'); | 		$smonth = datetime_convert('UTC', $tz, $sdt, 'm'); | ||||||
| 		$sday = datetime_convert('UTC', $tz, $sdt, 'd'); | 		$sday = datetime_convert('UTC', $tz, $sdt, 'd'); | ||||||
|  |  | ||||||
| 		$shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : '00'); | //		$shour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'H') : '00'); | ||||||
| 		$sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : '00'); | //		$sminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $sdt, 'i') : '00'); | ||||||
|  |  | ||||||
|  | 		$shour = datetime_convert('UTC', $tz, $sdt, 'H'); | ||||||
|  | 		$sminute = datetime_convert('UTC', $tz, $sdt, 'i'); | ||||||
|  |  | ||||||
| 		$stext = datetime_convert('UTC',$tz,$sdt); | 		$stext = datetime_convert('UTC',$tz,$sdt); | ||||||
| 		$stext = substr($stext,0,14) . "00:00"; | 		$stext = substr($stext,0,14) . "00:00"; | ||||||
|  |  | ||||||
| @@ -393,8 +401,12 @@ function events_content(&$a) { | |||||||
| 		$fmonth = datetime_convert('UTC', $tz, $fdt, 'm'); | 		$fmonth = datetime_convert('UTC', $tz, $fdt, 'm'); | ||||||
| 		$fday = datetime_convert('UTC', $tz, $fdt, 'd'); | 		$fday = datetime_convert('UTC', $tz, $fdt, 'd'); | ||||||
|  |  | ||||||
| 		$fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : '00'); | //		$fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : '00'); | ||||||
| 		$fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : '00'); | //		$fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : '00'); | ||||||
|  |  | ||||||
|  | 		$fhour = datetime_convert('UTC', $tz, $fdt, 'H'); | ||||||
|  | 		$fminute = datetime_convert('UTC', $tz, $fdt, 'i'); | ||||||
|  |  | ||||||
| 		$ftext = datetime_convert('UTC',$tz,$fdt); | 		$ftext = datetime_convert('UTC',$tz,$fdt); | ||||||
| 		$ftext = substr($ftext,0,14) . "00:00"; | 		$ftext = substr($ftext,0,14) . "00:00"; | ||||||
| 		$type = ((x($orig_event)) ? $orig_event['type'] : 'event'); | 		$type = ((x($orig_event)) ? $orig_event['type'] : 'event'); | ||||||
|   | |||||||
| @@ -245,3 +245,19 @@ a.wall-item-name-link { | |||||||
| 	color: #FF0000; | 	color: #FF0000; | ||||||
| 	font-size: 1em !important; | 	font-size: 1em !important; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /* event item */ | ||||||
|  |  | ||||||
|  | .event-title h3 { | ||||||
|  | 	font-weight: bold; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .event-title, | ||||||
|  | .event-end, | ||||||
|  | .event-description { | ||||||
|  | 	padding-bottom: 10px; | ||||||
|  | } | ||||||
|  |  | ||||||
|  | .event-label { | ||||||
|  | 	font-weight: bold; | ||||||
|  | } | ||||||
|   | |||||||
| @@ -857,41 +857,10 @@ nav .acpopup { | |||||||
| 	border-color: #ccc !important; | 	border-color: #ccc !important; | ||||||
| } | } | ||||||
|  |  | ||||||
| .eventcal { |  | ||||||
| 	float: left; |  | ||||||
| 	font-size: 20px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| #event-summary-text { | #event-summary-text { | ||||||
| 	margin-top: 15px; | 	margin-top: 15px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .event-wrapper { |  | ||||||
| 	width: 400px; |  | ||||||
| 	height: auto; |  | ||||||
| 	padding: 10px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .vevent { |  | ||||||
| 	max-width: 100%;  |  | ||||||
| 	margin: 10px; |  | ||||||
| 	padding: 10px; |  | ||||||
| 	border: 1px solid #CCCCCC; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .vevent .event-summary { |  | ||||||
| 	margin: 10px; |  | ||||||
| 	font-weight: bold; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .vevent .event-description, .vevent .event-location { |  | ||||||
| 	margin-left: 10px; |  | ||||||
| 	margin-right: 10px; |  | ||||||
| } |  | ||||||
| .vevent .event-start { |  | ||||||
| 	margin-left: 10px; |  | ||||||
| 	margin-right: 10px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| #new-event-link { | #new-event-link { | ||||||
| 	margin-bottom: 10px; | 	margin-bottom: 10px; | ||||||
| @@ -904,29 +873,13 @@ nav .acpopup { | |||||||
| 	margin-bottom: 15px; | 	margin-bottom: 15px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .event-description:before { |  | ||||||
| 	content: url('../../../../images/calendar.png'); |  | ||||||
| 	margin-right: 15px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .event-start, .event-end { |  | ||||||
| 	margin-left: 10px; |  | ||||||
| 	width: 300px; |  | ||||||
| 	clear: both; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .event-owner img { | .event-owner img { | ||||||
| 	padding: 10px; | 	padding-bottom: 10px; | ||||||
|  | 	padding-right: 10px; | ||||||
| } | } | ||||||
|  |  | ||||||
| .event-buttons { | .event-buttons { | ||||||
| 	margin-top: 10px; | 	margin-top: 10px; | ||||||
| 	margin-left: 10px; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| .event-start .dtstart, .event-end .dtend { |  | ||||||
| 	float: right; |  | ||||||
| 	margin-right: 10px; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| .event-list-date { | .event-list-date { | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| 	<div class="event-wrapper"> | 	<div class="event-wrapper"> | ||||||
| 		<div class="event"> | 		<div class="event"> | ||||||
| 			<div class="event-owner"> | 			<div class="event-owner"> | ||||||
| 				{{if $event.item.author.xchan_name}}<a href="{{$event.item.author.xchan_url}}" ><img src="{{$event.item.author.xchan_photo_s}}" height="64" width="64" />{{$event.item.author.xchan_name}}</a>{{/if}} | 				{{if $event.item.author.xchan_name}}<a href="{{$event.item.author.xchan_url}}" ><img src="{{$event.item.author.xchan_photo_s}}">{{$event.item.author.xchan_name}}</a>{{/if}} | ||||||
| 			</div> | 			</div> | ||||||
| 			{{$event.html}} | 			{{$event.html}} | ||||||
| 			<div class="event-buttons"> | 			<div class="event-buttons"> | ||||||
|   | |||||||
| @@ -97,7 +97,7 @@ | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			 | 			 | ||||||
| 		}) | 		}); | ||||||
| 		 | 		 | ||||||
| 		// center on date | 		// center on date | ||||||
| 		var args=location.href.replace(baseurl,"").split("/"); | 		var args=location.href.replace(baseurl,"").split("/"); | ||||||
| @@ -113,6 +113,20 @@ | |||||||
| 		var view = $('#events-calendar').fullCalendar('getView'); | 		var view = $('#events-calendar').fullCalendar('getView'); | ||||||
| 		$('#title').text(view.title); | 		$('#title').text(view.title); | ||||||
|  |  | ||||||
|  | 		// shift the finish time date on start time date change automagically | ||||||
|  | 		var origsval = $('#id_start_text').val(); | ||||||
|  | 		$('#id_start_text').change(function() { | ||||||
|  | 			var origfval = $('#id_finish_text').val(); | ||||||
|  | 			if(origfval) { | ||||||
|  | 				var sval = $('#id_start_text').val(); | ||||||
|  | 				var diff = moment(sval).diff(origsval); | ||||||
|  | 				var fval = moment(origfval).add(diff, 'millisecond').format("YYYY-MM-DD HH:mm"); | ||||||
|  | 				$('#id_finish_text').val(fval); | ||||||
|  | 				origsval = sval; | ||||||
|  | 			} | ||||||
|  | 		}); | ||||||
|  |  | ||||||
|  | 		// ACL | ||||||
| 		$('#id_share').change(function() { | 		$('#id_share').change(function() { | ||||||
|  |  | ||||||
| 			if ($('#id_share').is(':checked')) {  | 			if ($('#id_share').is(':checked')) {  | ||||||
| @@ -123,7 +137,6 @@ | |||||||
| 			} | 			} | ||||||
| 		}).trigger('change'); | 		}).trigger('change'); | ||||||
|  |  | ||||||
|  |  | ||||||
| 		$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { | 		$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { | ||||||
| 			var selstr; | 			var selstr; | ||||||
| 			$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { | 			$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user