trans('Host').': '.$conf->db->host.'
';
$info .= $langs->trans('Port').': '.$conf->db->port.'
';
$info .= $langs->trans('Name').': '.$conf->db->name.'
';
$info .= $langs->trans('User').': '.$conf->db->user.'
';
$info .= $langs->trans('Type').': '.$conf->db->type.'
';
$info .= $langs->trans('Prefix').': '.$conf->db->prefix.'
';
$info .= $langs->trans('Charset').': '.$conf->db->character_set.'';
return $info;
}
/**
* Return dolibarr info as an HTML string
*
* @return string HTML string
*/
protected function getDolibarrInfo()
{
global $conf, $langs;
global $dolibarr_main_prod, $dolibarr_nocsrfcheck;
$info = $langs->trans('Version').': '.DOL_VERSION.'
';
$info .= $langs->trans('Theme').': '.$conf->theme.'
';
$info .= $langs->trans('Locale').': '.$conf->global->MAIN_LANG_DEFAULT.'
';
$info .= $langs->trans('Currency').': '.$conf->currency.'
';
$info .= $langs->trans('Entity').': '.$conf->entity.'
';
$info .= $langs->trans('MaxSizeList').': '.($conf->liste_limit ?: $conf->global->MAIN_SIZE_LISTE_LIMIT).'
';
$info .= $langs->trans('MaxSizeForUploadedFiles').': '.$conf->global->MAIN_UPLOAD_DOC.'
';
$info .= '$dolibarr_main_prod = '.$dolibarr_main_prod.'
';
$info .= '$dolibarr_nocsrfcheck = '.$dolibarr_nocsrfcheck.'
';
$info .= 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.$conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN.'
';
$info .= 'MAIN_FEATURES_LEVEL = '.$conf->global->MAIN_FEATURES_LEVEL.'
';
return $info;
}
/**
* Return mail info as an HTML string
*
* @return string HTML string
*/
protected function getMailInfo()
{
global $conf, $langs;
global $dolibarr_mailing_limit_sendbyweb, $dolibarr_mailing_limit_sendbycli, $dolibarr_mailing_limit_sendbyday;
$info = $langs->trans('Method').': '.getDolGlobalString("MAIN_MAIL_SENDMODE").'
';
$info .= $langs->trans('Server').': '.getDolGlobalString("MAIN_MAIL_SMTP_SERVER").'
';
$info .= $langs->trans('Port').': '.getDolGlobalString("MAIN_MAIL_SMTP_PORT").'
';
$info .= $langs->trans('ID').': '.getDolGlobalString("MAIN_MAIL_SMTPS_IDT").'
';
$info .= $langs->trans('Pwd').': '.preg_replace('/./', '*', getDolGlobalString("MAIN_MAIL_SMTPS_PW")).'
';
$info .= $langs->trans('TLS/STARTTLS').': '.getDolGlobalString("MAIN_MAIL_EMAIL_TLS").' / '.getDolGlobalString("MAIN_MAIL_EMAIL_STARTTLS").'
';
$info .= $langs->trans('MAIN_DISABLE_ALL_MAILS').': '.(empty($conf->global->MAIN_DISABLE_ALL_MAILS) ? $langs->trans('No') : $langs->trans('Yes')).'
';
$info .= 'dolibarr_mailing_limit_sendbyweb = '.$dolibarr_mailing_limit_sendbyweb.'
';
$info .= 'dolibarr_mailing_limit_sendbycli = '.$dolibarr_mailing_limit_sendbycli.'
';
$info .= 'dolibarr_mailing_limit_sendbyday = '.$dolibarr_mailing_limit_sendbyday.'
';
return $info;
}
/**
* Return widget settings
*
* @return array Array
*/
public function getWidgets()
{
return array(
"database_info" => array(
"icon" => "database",
"indicator" => "PhpDebugBar.DebugBar.TooltipIndicator",
"tooltip" => array(
"html" => $this->getDatabaseInfo(),
"class" => "tooltip-wide"
),
"map" => "",
"default" => ""
),
"dolibarr_info" => array(
"icon" => "desktop",
"indicator" => "PhpDebugBar.DebugBar.TooltipIndicator",
"tooltip" => array(
"html" => $this->getDolibarrInfo(),
"class" => "tooltip-wide"
),
"map" => "",
"default" => ""
),
"mail_info" => array(
"icon" => "envelope",
"indicator" => "PhpDebugBar.DebugBar.TooltipIndicator",
"tooltip" => array(
"html" => $this->getMailInfo(),
"class" => "tooltip-extra-wide"
),
"map" => "",
"default" => ""
)
);
}
/**
* Return collector assests
*
* @return array Array
*/
public function getAssets()
{
return array(
'base_url' => dol_buildpath('/debugbar', 1),
'js' => 'js/widgets.js'
);
}
}