Fix remove warnings

This commit is contained in:
Laurent Destailleur 2020-10-30 04:13:31 +01:00
parent 263b679af4
commit 1b5bcaccc6
5 changed files with 18 additions and 12 deletions

View File

@ -105,7 +105,7 @@ class HookManager
if (in_array($context, $arrayhooks) || in_array('all', $arrayhooks)) // We instantiate action class only if initialized hook is handled by module
{
// Include actions class overwriting hooks
if (! is_object($this->hooks[$context][$module])) // If set, class was already loaded
if (empty($this->hooks[$context][$module]) || !is_object($this->hooks[$context][$module])) // If set to an object value, class was already loaded
{
$path = '/'.$module.'/class/';
$actionfile = 'actions_'.$module.'.class.php';
@ -144,7 +144,7 @@ class HookManager
*/
public function executeHooks($method, $parameters = array(), &$object = '', &$action = '')
{
if (! is_array($this->hooks) || empty($this->hooks)) return '';
if (! is_array($this->hooks) || empty($this->hooks)) return 0;
$parameters['context']=join(':', $this->contextarray);
//dol_syslog(get_class($this).'::executeHooks method='.$method." action=".$action." context=".$parameters['context']);

View File

@ -238,6 +238,7 @@ if (!empty($conf->debugbar->enabled) && ! GETPOST('dol_use_jmobile') && empty($_
include_once DOL_DOCUMENT_ROOT.'/debugbar/class/DebugBar.php';
$debugbar = new DolibarrDebugBar();
$renderer = $debugbar->getRenderer();
if (empty($conf->global->MAIN_HTML_HEADER)) $conf->global->MAIN_HTML_HEADER = '';
$conf->global->MAIN_HTML_HEADER .= $renderer->renderHead();
$debugbar['time']->startMeasure('pageaftermaster', 'Page generation (after environment init)');
@ -904,7 +905,7 @@ elseif (!empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER))
}
// set MAIN_OPTIMIZEFORCOLORBLIND
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND) ? '' : $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
// Set terminal output option according to conf->browser.
if (GETPOST('dol_hide_leftmenu', 'int') || !empty($_SESSION['dol_hide_leftmenu'])) $conf->dol_hide_leftmenu = 1;
@ -1145,8 +1146,8 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
// // A default security policy that keep usage of js external component like ckeditor, stripe, google, working
// $contentsecuritypolicy = "font-src *; img-src *; style-src * 'unsafe-inline' 'unsafe-eval'; default-src 'self' *.stripe.com 'unsafe-inline' 'unsafe-eval'; script-src 'self' *.stripe.com 'unsafe-inline' 'unsafe-eval'; frame-src 'self' *.stripe.com; connect-src 'self';";
//}
//else $contentsecuritypolicy = $conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY;
$contentsecuritypolicy = $conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY;
//else
$contentsecuritypolicy = empty($conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY) ? '': $conf->global->MAIN_HTTP_CONTENT_SECURITY_POLICY;
if (!is_object($hookmanager)) $hookmanager = new HookManager($db);
$hookmanager->initHooks(array("main"));

View File

@ -34,12 +34,12 @@ global $stripearrayofkeysbyenv;
$stripearrayofkeysbyenv = array(
0=>array(
"secret_key" => $conf->global->STRIPE_TEST_SECRET_KEY,
"publishable_key" => $conf->global->STRIPE_TEST_PUBLISHABLE_KEY
"secret_key" => empty($conf->global->STRIPE_TEST_SECRET_KEY) ? '' : $conf->global->STRIPE_TEST_SECRET_KEY,
"publishable_key" => empty($conf->global->STRIPE_TEST_PUBLISHABLE_KEY) ? '' : $conf->global->STRIPE_TEST_PUBLISHABLE_KEY
),
1=>array(
"secret_key" => $conf->global->STRIPE_LIVE_SECRET_KEY,
"publishable_key" => $conf->global->STRIPE_LIVE_PUBLISHABLE_KEY
"secret_key" => empty($conf->global->STRIPE_LIVE_SECRET_KEY) ? '' : $conf->global->STRIPE_LIVE_SECRET_KEY,
"publishable_key" => empty($conf->global->STRIPE_LIVE_PUBLISHABLE_KEY) ? '' : $conf->global->STRIPE_LIVE_PUBLISHABLE_KEY
)
);

View File

@ -153,10 +153,15 @@ a.info-box-text{ text-decoration: none;}
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$prefix='';
//$prefix = 'background-';
if (! empty($conf->global->THEME_INFOBOX_COLOR_ON_BACKGROUND)) $prefix = 'background-';
if (! isset($conf->global->THEME_AGRESSIVENESS_RATIO) && $prefix) $conf->global->THEME_AGRESSIVENESS_RATIO=-50;
if (! isset($conf->global->THEME_AGRESSIVENESS_RATIO)) {
if ($prefix) {
$conf->global->THEME_AGRESSIVENESS_RATIO = -50;
} else {
$conf->global->THEME_AGRESSIVENESS_RATIO = 0;
}
}
if (GETPOSTISSET('THEME_AGRESSIVENESS_RATIO')) $conf->global->THEME_AGRESSIVENESS_RATIO=GETPOST('THEME_AGRESSIVENESS_RATIO', 'int');
//var_dump($conf->global->THEME_AGRESSIVENESS_RATIO);
?>

View File

@ -236,7 +236,7 @@ print 'fontsizesmaller='.$fontsizesmaller."\n";
print 'topMenuFontSize='.$topMenuFontSize."\n";
print 'toolTipBgColor='.$toolTipBgColor."\n";
print 'toolTipFontColor='.$toolTipFontColor."\n";
print 'conf->global->THEME_AGRESSIVENESS_RATIO='.$conf->global->THEME_AGRESSIVENESS_RATIO." (must be between -100 and +100)\n";
print 'conf->global->THEME_AGRESSIVENESS_RATIO='.(empty($conf->global->THEME_AGRESSIVENESS_RATIO) ? '' : $conf->global->THEME_AGRESSIVENESS_RATIO)." (must be between -100 and +100)\n";
print '*/'."\n";