diff options
author | Mario Vavti <mario@mariovavti.com> | 2015-11-21 15:33:57 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2015-11-21 15:33:57 +0100 |
commit | d726c921eb5902483dfeb82383829e9309f6b65c (patch) | |
tree | 4083b26b9aeacd3f45ff5024236a575a926a8db4 | |
parent | fabf7081d39481bb22ee27c4beaf96e5529168eb (diff) | |
download | volse-hubzilla-d726c921eb5902483dfeb82383829e9309f6b65c.tar.gz volse-hubzilla-d726c921eb5902483dfeb82383829e9309f6b65c.tar.bz2 volse-hubzilla-d726c921eb5902483dfeb82383829e9309f6b65c.zip |
make calendar week start (sun or mon) configurable
-rwxr-xr-x | mod/events.php | 5 | ||||
-rw-r--r-- | mod/settings.php | 5 | ||||
-rwxr-xr-x | view/tpl/event_head.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/settings.tpl | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/mod/events.php b/mod/events.php index c3731bf1c..af5a9fc66 100755 --- a/mod/events.php +++ b/mod/events.php @@ -280,11 +280,14 @@ function events_content(&$a) { // $plaintext = false; + $first_day = get_pconfig(local_channel(),'system','cal_first_day'); + $htpl = get_markup_template('event_head.tpl'); $a->page['htmlhead'] .= replace_macros($htpl,array( '$baseurl' => $a->get_baseurl(), '$editselect' => (($plaintext) ? 'none' : 'textareas'), - '$lang' => $a->language + '$lang' => $a->language, + '$first_day' => (($first_day) ? $first_day : 0) )); $o =""; diff --git a/mod/settings.php b/mod/settings.php index 9a18d8e48..339f83cfe 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -405,7 +405,6 @@ function settings_post(&$a) { $allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0); - $blocktags = (((x($_POST,'blocktags')) && (intval($_POST['blocktags']) == 1)) ? 0: 1); // this setting is inverted! $unkmail = (((x($_POST,'unkmail')) && (intval($_POST['unkmail']) == 1)) ? 1: 0); $cntunkmail = ((x($_POST,'cntunkmail')) ? intval($_POST['cntunkmail']) : 0); @@ -416,6 +415,8 @@ function settings_post(&$a) { $post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0); $adult = (($_POST['adult'] == 1) ? 1 : 0); + $cal_first_day = (((x($_POST,'first_day')) && (intval($_POST['first_day']) == 1)) ? 1: 0); + $channel = $a->get_channel(); $pageflags = $channel['channel_pageflags']; $existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0); @@ -503,6 +504,7 @@ function settings_post(&$a) { set_pconfig(local_channel(),'system','evdays',$evdays); set_pconfig(local_channel(),'system','photo_path',$photo_path); set_pconfig(local_channel(),'system','attach_path',$attach_path); + set_pconfig(local_channel(),'system','cal_first_day',$cal_first_day); $r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d", dbesc($username), @@ -1110,6 +1112,7 @@ function settings_content(&$a) { '$removeme' => t('Remove Channel'), '$removechannel' => t('Remove this channel.'), '$firefoxshare' => t('Firefox Share $Projectname provider'), + '$cal_first_day' => array('first_day', t('Start calendar week on monday'), ((get_pconfig(local_channel(),'system','cal_first_day')) ? 1 : ''), '', $yes_no), )); call_hooks('settings_form',$o); diff --git a/view/tpl/event_head.tpl b/view/tpl/event_head.tpl index 346dfb154..ae5f21234 100755 --- a/view/tpl/event_head.tpl +++ b/view/tpl/event_head.tpl @@ -39,6 +39,8 @@ events: '{{$baseurl}}/events/json', header: false, lang: '{{$lang}}', + firstDay: {{$first_day}}, + eventLimit: 3, height: 'auto', diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index 7c1f4578d..2c71c64fb 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -159,6 +159,7 @@ {{/foreach}} </select> </div> + {{include file="field_checkbox.tpl" field=$cal_first_day}} <div class="settings-submit-wrapper" > <button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button> </div> |