2
0
forked from Wavyzz/dolibarr

NEW Add param to keep the robot=index meta tag on public pages

This commit is contained in:
Laurent Destailleur
2022-05-01 11:48:11 +02:00
parent 8023e1b0cd
commit 7c058c9ae6
4 changed files with 38 additions and 34 deletions

View File

@@ -1340,15 +1340,16 @@ if (!function_exists("llxHeader")) {
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
* @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'.
* @param string $replacemainareaby Replace call to main_area() by a print of this string
* @param int $disablenofollow Disable the "nofollow" on page
* @param int $disablenofollow Disable the "nofollow" on meta robot header
* @param int $disablenoindex Disable the "noindex" on meta robot header
* @return void
*/
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0)
function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0)
{
global $conf;
// html header
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow);
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow, $disablenoindex);
$tmpcsstouse = 'sidebar-collapse'.($morecssonbody ? ' '.$morecssonbody : '');
// If theme MD and classic layer, we open the menulayer by default.
@@ -1461,10 +1462,11 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @param int $disableforlogin Do not load heavy js and css for login pages
* @param int $disablenofollow Disable no follow tag
* @param int $disablenofollow Disable nofollow tag for meta robots
* @param int $disablenoindex Disable noindex tag for meta robots
* @return void
*/
function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disableforlogin = 0, $disablenofollow = 0)
function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disableforlogin = 0, $disablenofollow = 0, $disablenoindex = 0)
{
global $db, $conf, $langs, $user, $mysoc, $hookmanager;
@@ -1495,7 +1497,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
// Displays meta
print '<meta charset="utf-8">'."\n";
print '<meta name="robots" content="noindex'.($disablenofollow ? '' : ',nofollow').'">'."\n"; // Do not index
print '<meta name="robots" content="'.($disablenoindex ? 'index' : 'noindex').($disablenofollow ? ',follow' : ',nofollow').'">'."\n"; // Do not index
print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n"; // Scale for mobile device
print '<meta name="author" content="Dolibarr Development Team">'."\n";
if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {