diff --git a/day.php b/day.php index 1766113e0..b43f07d87 100644 --- a/day.php +++ b/day.php @@ -68,12 +68,7 @@ } $eventinfo = ( ! empty ( $eventinfo )? $eventinfo : '' ); $trailerStr = print_trailer (); -$HeadX = ''; -if ( $AUTO_REFRESH == 'Y' && ! empty ( $AUTO_REFRESH_TIME ) ) { - $refresh = $AUTO_REFRESH_TIME * 60; // convert to seconds - $HeadX = "\n"; -} +$HeadX = generate_refresh_meta (); $INC = array('js/popups.php/true'); print_header($INC,$HeadX); diff --git a/includes/functions.php b/includes/functions.php index 66b58eca1..5fb57d5ce 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -6178,4 +6178,21 @@ function generate_application_name ( $custom=true ) { return htmlspecialchars ( $APPLICATION_NAME ); } } + +/** + * Generate Refresh Meta Tag + * + * @return HTML for Meta Tag + */ +function generate_refresh_meta () { + global $AUTO_REFRESH, $AUTO_REFRESH_TIME, $REQUEST_URI; + + $ret = ''; + if ( $AUTO_REFRESH == 'Y' && ! empty ( $AUTO_REFRESH_TIME ) && + ! empty ( $REQUEST_URI )) { + $refresh = $AUTO_REFRESH_TIME * 60; // convert to seconds + $ret .= ""; + } + return $ret; +} ?> diff --git a/includes/init.php b/includes/init.php index 7348f20b8..e6cdc8ba1 100644 --- a/includes/init.php +++ b/includes/init.php @@ -167,7 +167,7 @@ function print_header ( $includes = '', $HeadX = '', $BodyX = '', } // Do we need anything else inside the header tag? if ( $HeadX ) - $ret .= $HeadX . "\n"; + $ret .= "\n " . $HeadX; // Include the styles // Include CSS needed for the top menu if ( $MENU_ENABLED == 'Y' ) { @@ -207,12 +207,12 @@ function print_header ( $includes = '', $HeadX = '', $BodyX = '', ' : '' ) + . ( $login != '__public__' ? '?user=' . $login : '' ) . '" />' : '' ) . "\n" // Link to favicon - . '' + . ' '. "\n" . ( $MENU_ENABLED == 'Y' ? $menuScript : '' ) // Finish the header - . ' + . ' \n"; -} +$HeadX = generate_refresh_meta (); //make sure we return after editing an event via this page remember_this_view(); diff --git a/minical.php b/minical.php index 4ea991d93..5ac17d5bd 100644 --- a/minical.php +++ b/minical.php @@ -116,13 +116,7 @@ $startdate = mktime ( 0, 0, 0, $thismonth, 1, $thisyear ); $enddate = mktime ( 23, 59, 59, $thismonth + 1, 0, $thisyear ); - -$HeadX = ''; -if ( $AUTO_REFRESH == 'Y' && ! empty ( $AUTO_REFRESH_TIME ) ) { - $refresh = $AUTO_REFRESH_TIME * 60; // convert to seconds - $HeadX = "\n"; -} +$HeadX = generate_refresh_meta (); $INC = ''; $BodyX = ''; diff --git a/month.php b/month.php index 153ef9ba4..5566c946e 100644 --- a/month.php +++ b/month.php @@ -66,7 +66,7 @@ $navStr = display_navigation( 'month' ); $monthStr = display_month ( $thismonth, $thisyear ); $eventinfo = ( ! empty ( $eventinfo )? $eventinfo : '' ); -$HeadX = ''; + if ( empty ( $friendly ) ) { $unapprovedStr = display_unapproved_events ( ( $is_assistant || $is_nonuser_admin ? $user : $login ) ); @@ -74,12 +74,8 @@ } $trailerStr = print_trailer (); -if ( $AUTO_REFRESH == 'Y' && ! empty ( $AUTO_REFRESH_TIME ) ) { - $refresh = $AUTO_REFRESH_TIME * 60; // convert to seconds - $HeadX = "\n"; -} +$HeadX = generate_refresh_meta (); + $INC = array('js/popups.php/true', 'js/visible.php/true'); print_header($INC,$HeadX); diff --git a/week.php b/week.php index 4d9331583..7fdb1b468 100644 --- a/week.php +++ b/week.php @@ -268,14 +268,7 @@ $minical_tasks .= ''; }//end minical -$HeadX = ''; -if ( ! empty ( $AUTO_REFRESH ) && $AUTO_REFRESH == 'Y' && - ! empty ( $AUTO_REFRESH_TIME ) ) { - $refresh = $AUTO_REFRESH_TIME * 60; // convert to seconds - $HeadX = "\n"; -} +$HeadX = generate_refresh_meta (); $INC = array('js/popups.php/true'); print_header($INC,$HeadX); diff --git a/week_details.php b/week_details.php index c3e2bfe99..8434168ea 100644 --- a/week_details.php +++ b/week_details.php @@ -33,12 +33,7 @@ $end_ind = 6; } -$HeadX = ''; -if ( $AUTO_REFRESH == 'Y' && ! empty ( $AUTO_REFRESH_TIME ) ) { - $refresh = $AUTO_REFRESH_TIME * 60; // convert to seconds - $HeadX = "\n"; -} +$HeadX = generate_refresh_meta (); $printerStr = generate_printer_friendly ( 'week_details.php' ); $INC = array('js/popups.php/true');