Internationalisation of events/Move events to the navigation bar
This commit is contained in:
parent
1c19bcd322
commit
c33957a6e9
4 changed files with 85 additions and 12 deletions
|
@ -138,6 +138,8 @@ function nav_info(&$a) {
|
|||
elseif(get_config('system','community_page_style') == CP_GLOBAL_COMMUNITY)
|
||||
$nav['community'] = array('community', t('Community'), "", t('Conversations on the network'));
|
||||
|
||||
$nav['events'] = Array('events', t('Events'), "", t('Events and Calendar'));
|
||||
|
||||
$nav['directory'] = array($gdirpath, t('Directory'), "", t('People directory'));
|
||||
|
||||
$nav['about'] = Array('friendica', t('Information'), "", t('Information about this friendica instance'));
|
||||
|
|
|
@ -184,9 +184,60 @@ function events_content(&$a) {
|
|||
if( feature_enabled(local_user(), 'richtext') )
|
||||
$editselect = 'textareas';
|
||||
|
||||
// First day of the week (0 = Sunday)
|
||||
// To-Do: Needs to be configurable
|
||||
$firstDay = 0;
|
||||
|
||||
$i18n = array(
|
||||
"firstDay" => $firstDay,
|
||||
"Sun" => t("Sun"),
|
||||
"Mon" => t("Mon"),
|
||||
"Tue" => t("Tue"),
|
||||
"Wed" => t("Wed"),
|
||||
"Thu" => t("Thu"),
|
||||
"Fri" => t("Fri"),
|
||||
"Sat" => t("Sat"),
|
||||
"Sunday" => t("Sunday"),
|
||||
"Monday" => t("Monday"),
|
||||
"Tuesday" => t("Tuesday"),
|
||||
"Wednesday" => t("Wednesday"),
|
||||
"Thursday" => t("Thursday"),
|
||||
"Friday" => t("Friday"),
|
||||
"Saturday" => t("Saturday"),
|
||||
"Jan" => t("Jan"),
|
||||
"Feb" => t("Feb"),
|
||||
"Mar" => t("Mar"),
|
||||
"Apr" => t("Apr"),
|
||||
"May" => t("May"),
|
||||
"Jun" => t("Jun"),
|
||||
"Jul" => t("Jul"),
|
||||
"Aug" => t("Aug"),
|
||||
"Sep" => t("Sept"),
|
||||
"Oct" => t("Oct"),
|
||||
"Nov" => t("Nov"),
|
||||
"Dec" => t("Dec"),
|
||||
"January" => t("January"),
|
||||
"February" => t("February"),
|
||||
"March" => t("March"),
|
||||
"April" => t("April"),
|
||||
"May" => t("May"),
|
||||
"June" => t("June"),
|
||||
"July" => t("July"),
|
||||
"August" => t("August"),
|
||||
"September" => t("September"),
|
||||
"October" => t("October"),
|
||||
"November" => t("November"),
|
||||
"December" => t("December"),
|
||||
"today" => t("today"),
|
||||
"month" => t("month"),
|
||||
"week" => t("week"),
|
||||
"day" => t("day"),
|
||||
);
|
||||
|
||||
$htpl = get_markup_template('event_head.tpl');
|
||||
$a->page['htmlhead'] .= replace_macros($htpl,array(
|
||||
'$baseurl' => $a->get_baseurl(),
|
||||
'$i18n' => $i18n,
|
||||
'$editselect' => $editselect
|
||||
));
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
<link rel='stylesheet' type='text/css' href='{{$baseurl}}/library/fullcalendar/fullcalendar.css' />
|
||||
<script language="javascript" type="text/javascript"
|
||||
src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
|
||||
src="{{$baseurl}}/library/fullcalendar/fullcalendar.min.js"></script>
|
||||
|
||||
<script>
|
||||
function showEvent(eventid) {
|
||||
|
@ -13,17 +13,32 @@
|
|||
);
|
||||
}
|
||||
|
||||
function doEventPreview() {
|
||||
$('#event-edit-preview').val(1);
|
||||
$.post('events',$('#event-edit-form').serialize(), function(data) {
|
||||
$.colorbox({ html: data });
|
||||
});
|
||||
$('#event-edit-preview').val(0);
|
||||
function doEventPreview() {
|
||||
$('#event-edit-preview').val(1);
|
||||
$.post('events',$('#event-edit-form').serialize(), function(data) {
|
||||
$.colorbox({ html: data });
|
||||
});
|
||||
$('#event-edit-preview').val(0);
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#events-calendar').fullCalendar({
|
||||
firstDay: {{$i18n.firstDay}},
|
||||
monthNames: ['{{$i18n.January}}','{{$i18n.February}}','{{$i18n.March}}','{{$i18n.April}}','{{$i18n.May}}','{{$i18n.June}}','{{$i18n.July}}','{{$i18n.August}}','{{$i18n.September}}','{{$i18n.October}}','{{$i18n.November}}','{{$i18n.December}}'],
|
||||
monthNamesShort: ['{{$i18n.Jan}}','{{$i18n.Feb}}','{{$i18n.Mar}}','{{$i18n.Apr}}','{{$i18n.May}}','{{$i18n.Jun}}','{{$i18n.Jul}}','{{$i18n.Aug}}','{{$i18n.Sep}}','{{$i18n.Oct}}','{{$i18n.Nov}}','{{$i18n.Dec}}'],
|
||||
dayNames: ['{{$i18n.Sunday}}','{{$i18n.Monday}}','{{$i18n.Tuesday}}','{{$i18n.Wednesday}}','{{$i18n.Thursday}}','{{$i18n.Friday}}','{{$i18n.Saturday}}'],
|
||||
dayNamesShort: ['{{$i18n.Sun}}','{{$i18n.Mon}}','{{$i18n.Tue}}','{{$i18n.Wed}}','{{$i18n.Thu}}','{{$i18n.Fri}}','{{$i18n.Sat}}'],
|
||||
buttonText: {
|
||||
prev: "<span class='fc-text-arrow'>‹</span>",
|
||||
next: "<span class='fc-text-arrow'>›</span>",
|
||||
prevYear: "<span class='fc-text-arrow'>«</span>",
|
||||
nextYear: "<span class='fc-text-arrow'>»</span>",
|
||||
today: '{{$i18n.today}}',
|
||||
month: '{{$i18n.month}}',
|
||||
week: '{{$i18n.week}}',
|
||||
day: '{{$i18n.day}}'
|
||||
},
|
||||
events: '{{$baseurl}}/events/json/',
|
||||
header: {
|
||||
left: 'prev,next today',
|
||||
|
@ -34,7 +49,7 @@
|
|||
eventClick: function(calEvent, jsEvent, view) {
|
||||
showEvent(calEvent.id);
|
||||
},
|
||||
loading: function(isLoading, view) {
|
||||
loading: function(isLoading, view) {
|
||||
if(!isLoading) {
|
||||
$('td.fc-day').dblclick(function() { window.location.href='/events/new?start='+$(this).data('date'); });
|
||||
}
|
||||
|
@ -91,7 +106,7 @@
|
|||
|
||||
{{if $editselect != 'none'}}
|
||||
<script language="javascript" type="text/javascript"
|
||||
src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
|
||||
src="{{$baseurl}}/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
|
||||
|
@ -123,7 +138,7 @@
|
|||
}
|
||||
|
||||
});
|
||||
{{else}}
|
||||
{{else}}
|
||||
<script language="javascript" type="text/javascript">
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
<span id="net-update" class="nav-notify"></span>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{if $nav.events}}
|
||||
<li role="menuitem" id="nav-events-link" class="nav-menu {{$sel.events}}">
|
||||
<a accesskey="e" class="{{$nav.events.2}}" href="{{$nav.events.0}}" title="{{$nav.events.3}}" >{{$nav.events.1}}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{if $nav.community}}
|
||||
<li role="menuitem" id="nav-community-link" class="nav-menu {{$sel.community}}">
|
||||
<a accesskey="c" class="{{$nav.community.2}}" href="{{$nav.community.0}}" title="{{$nav.community.3}}" >{{$nav.community.1}}</a>
|
||||
|
|
Loading…
Reference in a new issue