From abf4b1da30e7fabebfa5e36cfc5c1fe691320a1e Mon Sep 17 00:00:00 2001 From: msquare Date: Tue, 26 Dec 2017 20:41:35 +0100 Subject: check if logged in before sign up --- includes/pages/user_shifts.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'includes/pages') diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index 2d294ff4..2c30c86a 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -248,12 +248,7 @@ function view_user_shifts() . _('Description of the jobs.') . '', 'shifts_table' => msg() . $shiftCalendarRenderer->render(), - 'ical_text' => '

' . _('iCal export') . '

' . sprintf( - _('Export of shown shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key).'), - page_link_to('ical', ['key' => $user['api_key']]), - page_link_to('shifts_json_export', ['key' => $user['api_key']]), - page_link_to('user_myshifts', ['reset' => 1]) - ) . '

', + 'ical_text' => ical_hint(), 'filter' => _('Filter'), 'set_yesterday' => _('Yesterday'), 'set_today' => _('Today'), @@ -271,6 +266,22 @@ function view_user_shifts() ]); } +/** + * Returns a hint for the user how the ical feature works. + */ +function ical_hint() { + global $user; + + return heading( + _('iCal export'), 2) + . '

' . sprintf( + _('Export of shown shifts. iCal format or JSON format available (please keep secret, otherwise reset the api key).'), + page_link_to('ical', ['key' => $user['api_key']]), + page_link_to('shifts_json_export', ['key' => $user['api_key']]), + page_link_to('user_myshifts', ['reset' => 1]) + ) . '

'; +} + /** * @param array $array * @return array -- cgit v1.2.3-54-g00ecf