';
// Define link to login card
$appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
$appli = $conf->global->MAIN_APPLICATION_TITLE;
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
}
} else {
$appli .= " ".DOL_VERSION;
}
} else {
$appli .= " ".DOL_VERSION;
}
if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
$appli .= "
".$langs->trans("LevelOfFeature").': '.getDolGlobalInt('MAIN_FEATURES_LEVEL');
}
$logouttext = '';
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
//$logouthtmltext=$appli.'
';
if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') {
$logouthtmltext .= $langs->trans("Logout").'
';
} else {
$logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]);
$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1);
}
}
print '
'."\n";
// Add login user link
$toprightmenu .= '
';
// Login name with photo and tooltip
$mode = -1;
$toprightmenu .= '
';
$toprightmenu .= $user->getNomUrl($mode, '', -1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin');
$toprightmenu .= '
';
$toprightmenu .= '
'."\n";
$toprightmenu .= '
';
// Execute hook printTopRightMenu (hooks should output string like '
')
$parameters = array();
$result = $hookmanager->executeHooks('printTopRightMenu', $parameters); // Note that $action and $object may have been modified by some hooks
if (is_numeric($result)) {
if (empty($result)) {
$toprightmenu .= $hookmanager->resPrint; // add
} else {
$toprightmenu = $hookmanager->resPrint; // replace
}
} else {
$toprightmenu .= $result; // For backward compatibility
}
if (!isset($form) || !is_object($form)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form = new Form($db);
}
// Link to module builder
if (!empty($conf->modulebuilder->enabled)) {
$text = '
';
//$text.= img_picto(":".$langs->trans("ModuleBuilder"), 'printer_top.png', 'class="printer"');
$text .= '';
$text .= '';
$toprightmenu .= $form->textwithtooltip('', $langs->trans("ModuleBuilder"), 2, 1, $text, 'login_block_elem', 2);
}
// Link to print main content area
/*
if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $conf->browser->layout != 'phone')
{
$qs=dol_escape_htmltag($_SERVER["QUERY_STRING"]);
if (is_array($_POST))
{
foreach($_POST as $key=>$value) {
if ($key!=='action' && $key!=='password' && !is_array($value)) $qs.='&'.$key.'='.urlencode($value);
}
}
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
$text ='
';
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
$text.='';
$text.='';
$toprightmenu .= $form->textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
}
*/
// Link to Dolibarr wiki pages
/*
if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$langs->load("help");
$helpbaseurl='';
$helppage='';
$mode='';
if (empty($helppagename)) $helppagename='EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios';
// Get helpbaseurl, helppage and mode from helppagename and langs
$arrayres=getHelpParamFor($helppagename,$langs);
$helpbaseurl=$arrayres['helpbaseurl'];
$helppage=$arrayres['helppage'];
$mode=$arrayres['mode'];
// Link to help pages
if ($helpbaseurl && $helppage)
{
$text='';
$title=$appli.'
';
$title.=$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage');
if ($mode == 'wiki') $title.=' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage,'_',' ')).'"';
$text.='
';
//$text.=img_picto('', 'helpdoc_top').' ';
$text.='';
//$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help');
//if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')';
$text.='';
//$toprightmenu.='
'."\n";
$toprightmenu .= $form->textwithtooltip('',$title,2,1,$text,'login_block_elem',2);
}
}
*/
// Logout link
if (GETPOST('withlogout', 'int')) {
$toprightmenu .= $form->textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem', 2);
}
$toprightmenu .= '