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

@ -2769,7 +2769,7 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0)
* @param int $addlink 0=no link, 1=email has a html email link (+ link to create action if constant AGENDA_ADDACTIONFOREMAIL is on)
* @param int $max Max number of characters to show
* @param int $showinvalid 1=Show warning if syntax email is wrong
* @param int $withpicto Show picto
* @param int|string $withpicto Show picto
* @return string HTML Link
*/
function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $showinvalid = 1, $withpicto = 0)
@ -2818,7 +2818,7 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64,
}
//$rep = '<div class="nospan" style="margin-right: 10px">';
$rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, 'object_email.png').' ' : '').$newemail;
$rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto)).' ' : '').$newemail;
//$rep .= '</div>';
if ($hookmanager) {
$parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto);
@ -3732,7 +3732,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes',
'currency', 'multicurrency',
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice',
'edit', 'ellipsis-h', 'email', 'entity', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt',
'edit', 'ellipsis-h', 'email', 'entity', 'envelope', 'eraser', 'establishment', 'expensereport', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus',
'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group',
'help', 'holiday',
@ -4576,19 +4576,19 @@ function img_searchclear($titlealt = 'default', $other = '')
* @param string $textfordropdown Show a text to click to dropdown the info box.
* @return string String with info text
*/
function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = '', $textfordropdown = '')
function info_admin($text, $infoonimgalt = 0, $nodiv = 0, $admin = '1', $morecss = 'hideonsmartphone', $textfordropdown = '')
{
global $conf, $langs;
if ($infoonimgalt) {
$result = img_picto($text, 'info', 'class="hideonsmartphone'.($morecss ? ' '.$morecss : '').'"');
$result = img_picto($text, 'info', 'class="'.($morecss ? ' '.$morecss : '').'"');
} else {
if (empty($conf->use_javascript_ajax)) {
$textfordropdown = '';
}
$class = (empty($admin) ? 'undefined' : ($admin == '1' ? 'info' : $admin));
$result = ($nodiv ? '' : '<div class="'.$class.' hideonsmartphone'.($morecss ? ' '.$morecss : '').($textfordropdown ? ' hidden' : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
$result = ($nodiv ? '' : '<div class="'.$class.($morecss ? ' '.$morecss : '').($textfordropdown ? ' hidden' : '').'">').'<span class="fa fa-info-circle" title="'.dol_escape_htmltag($admin ? $langs->trans('InfoAdmin') : $langs->trans('Note')).'"></span> '.$text.($nodiv ? '' : '</div>');
if ($textfordropdown) {
$tmpresult = '<span class="'.$class.'text opacitymedium cursorpointer">'.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').'</span>';

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')) {

View File

@ -177,7 +177,7 @@ $arrayofjs = array();
$arrayofcss = array();
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1);
llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1);
print '<span id="dolpaymentspan"></span>'."\n";
@ -217,8 +217,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb
if ($urllogo) {
print '<div class="backgreypublicpayment">';
print '<div class="logopublicpayment">';
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
print '>';
print '<img id="dolpaymentlogo" src="'.$urllogo.'">';
print '</div>';
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
@ -249,7 +248,7 @@ if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) {
if (empty($text)) {
$text .= '<tr><td class="textpublicpayment"><br>'.$langs->trans("JobOfferToBeFilled", $mysoc->name);
$text .= ' &nbsp; - &nbsp; <strong>'.$mysoc->name.'</strong>';
$text .= ' &nbsp; - &nbsp; <span class="fa fa-calendar secondary"></span> '.dol_print_date($object->date_creation);
$text .= ' &nbsp; - &nbsp; <span class="nowraponall"><span class="fa fa-calendar secondary"></span> '.dol_print_date($object->date_creation).'</span>';
$text .= '</td></tr>'."\n";
$text .= '<tr><td class="textpublicpayment"><h1>'.$object->label.'</h1><br></td></tr>'."\n";
}
@ -300,7 +299,7 @@ if (empty($emailforcontact)) {
}
print '<b class="wordbreak">';
print $tmpuser->getFullName(-1);
print ' - '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 1);
print ' &nbsp; '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope');
print '</b>';
print '</b><br>';

View File

@ -1668,21 +1668,6 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
width: 175px;
}
.logopublicpayment #dolpaymentlogo {
max-width: 260px;
}
#tablepublicpayment {
width: auto !important;
}
.poweredbypublicpayment {
float: unset !important;
top: unset !important;
bottom: 8px;
position: relative !important;
}
.poweredbyimg {
width: 48px;
}
input.buttonpayment, button.buttonpayment, div.buttonpayment {
min-width: 270px;
}
@ -1834,9 +1819,9 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
}
*/
input.buttonpayment {
input.buttonpayment {
min-width: 300px;
}
}
}
.linkobject { cursor: pointer; }
@ -7270,6 +7255,24 @@ div.clipboardCPValue.hidewithsize {
}
td.widthpictotitle { width: 30px; }
.logopublicpayment #dolpaymentlogo {
max-width: 260px;
}
#tablepublicpayment {
width: auto !important;
border: none !important;
}
.poweredbypublicpayment {
float: unset !important;
top: unset !important;
/* bottom: 8px; */
right: -10px !important;
position: relative !important;
}
.poweredbyimg {
width: 48px;
}
}
@media only screen and (max-width: 1024px)