diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index a0cc58eb24f..2b8c75ebba7 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -4345,4 +4345,86 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= } } +/** + * Print common footer : + * conf->global->MAIN_HTML_FOOTER + * conf->global->MAIN_GOOGLE_AN_ID + * DOL_TUNING + * conf->logbuffer + * + * @param string $zone 'private' (for private pages) or 'public' (for public pages) + * @return void + */ +function printCommonFooter($zone='private') +{ + global $conf; + + if ($zone == 'private') print "\n".''."\n"; + else print "\n".''."\n"; + + if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n"; + + // Google Analytics (need Google module) + if (! empty($conf->global->MAIN_GOOGLE_AN_ID)) + { + print "\n"; + print ''."\n"; + } + + // End of tuning + if (! empty($_SERVER['DOL_TUNING'])) + { + $micro_end_time=dol_microtime_float(true); + print "\n".''."\n"; + + // Add Xdebug coverage of code + if (defined('XDEBUGCOVERAGE')) { + var_dump(xdebug_get_code_coverage()); + } + } + + // If there is some logs in buffer to show + if (count($conf->logbuffer)) + { + print "\n"; + print "\n"; + } + +} + ?> \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 54ccf671c4b..4bdba0edc70 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1624,50 +1624,7 @@ if (! function_exists("llxFooter")) print "\n"; if ($foot) print ''."\n"; - if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n"; - - - // If there is some logs in buffer to show - if (count($conf->logbuffer)) - { - print "\n"; - print "\n"; - } - - // End of tuning - if (! empty($_SERVER['DOL_TUNING'])) - { - $micro_end_time=dol_microtime_float(true); - print "\n".''."\n"; - - // Add Xdebug coverage of code - if (defined('XDEBUGCOVERAGE')) { var_dump(xdebug_get_code_coverage()); } - } + printCommonFooter(); print "\n"; print "\n"; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index a1497438088..a72497616b4 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -337,8 +337,13 @@ if (! empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && ! empty($conf->global->MAIN llxFooterVierge(); - - +/** + * Show header for demo + * + * @param string $title + * @param string $head + * @return void + */ function llxHeaderVierge($title, $head = "") { global $user, $conf, $langs; @@ -368,9 +373,14 @@ function llxHeaderVierge($title, $head = "") print ''."\n"; } +/** + * Show footer for demo + * + * @return void + */ function llxFooterVierge() { - printCommonFooter(); + printCommonFooter('public'); print "\n"; print "\n"; diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index df04061e4bb..c85942d07fe 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -25,10 +25,7 @@ define("NOLOGIN",1); // This means this output page does not require to be logg define("NOCSRFCHECK",1); // We accept to go on this page from external web site. // C'est un wrapper, donc header vierge -function llxHeaderVierge() { - header("Content-type: text/html; charset=".$conf->file->character_set_client); - print 'Export agenda cal'; -} +function llxHeaderVierge() { print 'Export agenda cal'; } function llxFooterVierge() { print ''; } require("../../main.inc.php"); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 913b80327b2..5575e87a1d1 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -67,7 +67,13 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC)) } -// Function for page HTML header +/** + * Show header for new member + * + * @param string $title + * @param string $head + * @return void + */ function llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='') { global $user, $conf, $langs, $mysoc; @@ -97,11 +103,17 @@ function llxHeaderVierge($title, $head="", $disablejs=0, $disablehead=0, $arrayo print '
'; } -// Function for page HTML footer +/** + * Show footer for new member + * + * @return void + */ function llxFooterVierge() { print '
'; + printCommonFooter('public'); + print "\n"; print "\n"; } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 7c6083f5cad..284b67825e5 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -115,8 +115,14 @@ $db->close(); llxFooterVierge(); -/* Functions header and footer */ +/** + * Show header for card member + * + * @param string $title + * @param string $head + * @return void + */ function llxHeaderVierge($title, $head = "") { global $user, $conf, $langs; @@ -130,8 +136,15 @@ function llxHeaderVierge($title, $head = "") print "\n"; } +/** +* Show footer for card member +* +* @return void +*/ function llxFooterVierge() { + printCommonFooter('public'); + print "\n"; print "\n"; } diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 1dc2f154f3f..cec6d3e1896 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -38,6 +38,13 @@ $langs->load("companies"); $langs->load("other"); +/** + * Show header for member list + * + * @param string $title + * @param string $head + * @return void + */ function llxHeaderVierge($title, $head = "") { global $user, $conf, $langs; @@ -51,9 +58,18 @@ function llxHeaderVierge($title, $head = "") print "\n"; } +/** +* Show footer for member list +* +* @param string $title +* @param string $head +* @return void +*/ function llxFooterVierge() { - print "\n"; + printCommonFooter('public'); + + print "\n"; print "\n"; }