From 7c058c9ae60d74d42aeb8779ef17c6eaf29a1623 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 May 2022 11:48:11 +0200 Subject: [PATCH] NEW Add param to keep the robot=index meta tag on public pages --- htdocs/core/lib/functions.lib.php | 12 +++++----- htdocs/main.inc.php | 14 ++++++----- htdocs/public/recruitment/view.php | 9 ++++---- htdocs/theme/eldy/global.inc.php | 37 ++++++++++++++++-------------- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 51741179753..5eef1b43bec 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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 = '
'; - $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 .= '
'; 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 ? '' : '
').' '.$text.($nodiv ? '' : '
'); + $result = ($nodiv ? '' : '
').' '.$text.($nodiv ? '' : '
'); if ($textfordropdown) { $tmpresult = ''.$langs->trans($textfordropdown).' '.img_picto($langs->trans($textfordropdown), '1downarrow').''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 11c057152bd..7e2cb072913 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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 ''."\n"; - print ''."\n"; // Do not index + print ''."\n"; // Do not index print ''."\n"; // Scale for mobile device print ''."\n"; if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index d105632abe8..227900ebbb0 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -177,7 +177,7 @@ $arrayofjs = array(); $arrayofcss = array(); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); +llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1); print ''."\n"; @@ -217,8 +217,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb if ($urllogo) { print '
'; print '
'; - print ''; + print ''; print '
'; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; @@ -249,7 +248,7 @@ if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) { if (empty($text)) { $text .= '
'.$langs->trans("JobOfferToBeFilled", $mysoc->name); $text .= '   -   '.$mysoc->name.''; - $text .= '   -   '.dol_print_date($object->date_creation); + $text .= '   -   '.dol_print_date($object->date_creation).''; $text .= ''."\n"; $text .= '

'.$object->label.'


'."\n"; } @@ -300,7 +299,7 @@ if (empty($emailforcontact)) { } print ''; print $tmpuser->getFullName(-1); -print ' - '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 1); +print '   '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope'); print ''; print '
'; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c12f71d6f79..5fc9ea92c5b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -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)