From 70432578967279c40df82d459117205805dcfae9 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 15 Jun 2013 12:14:33 +0200 Subject: [PATCH] cal: added user config --- cal/cal.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cal/cal.php b/cal/cal.php index f38239681..adef464be 100644 --- a/cal/cal.php +++ b/cal/cal.php @@ -45,11 +45,30 @@ function cal_addon_settings_post ( &$a, &$b ) { if (! local_user()) return; + + if (!x($_POST,'cal-submit')) + return; + + set_pconfig(local_user(),'cal','enable',intval($_POST['cal-enable'])); } function cal_addon_settings ( &$a, &$s ) { if (! local_user()) return; + + $enabled = get_pconfig(local_user(), 'cal', 'enable'); + $checked = (($enabled) ? ' checked="checked" ' : ''); + $url = $a->get_baseurl().'/cal/'.$a->user['nickname'].'/export/ical'; + + $s .= '

'.t('Export Events').'

'; + $s .= '

'.t('If this is enabled, you public events will be available at').' '.$url.'

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + $s .= '
'; + $s .= '
'; + } ?>