mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-09 19:18:22 +01:00
Merge branch 'theme_top_menu' of github.com:atm-john/dolibarr into theme_badge_status
This commit is contained in:
@@ -7971,7 +7971,7 @@ function dolGetBadge($label, $html = '', $type = 'primary', $mode = '', $url = '
|
||||
$TCompiledAttr[] = $key.'="'.$value.'"';
|
||||
}
|
||||
|
||||
$compiledAttributes = !empty($TCompiledAttr)?implode(' ',$TCompiledAttr):'';
|
||||
$compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
|
||||
|
||||
$tag = !empty($url)?'a':'span';
|
||||
|
||||
@@ -8043,14 +8043,12 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
else{ // $displayMode >= 6
|
||||
$return = $htmlLabel .' '. $htmlImg;
|
||||
}
|
||||
|
||||
}
|
||||
// Use new badge
|
||||
elseif(!empty($conf->global->MAIN_STATUS_USES_CSS) && !empty($displayMode)){
|
||||
|
||||
$statusLabelShort = !empty($statusLabelShort)?$statusLabelShort:$statusLabel;
|
||||
|
||||
|
||||
if($displayMode == 3){
|
||||
$return = dolGetBadge($statusLabel, '', $statusType, 'dot');
|
||||
}
|
||||
@@ -8060,7 +8058,6 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
||||
else{
|
||||
$return = dolGetBadge($statusLabel, $html, $statusType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $return;
|
||||
@@ -8128,7 +8125,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
||||
$TCompiledAttr[] = $key.'="'.$value.'"';
|
||||
}
|
||||
|
||||
$compiledAttributes = !empty($TCompiledAttr)?implode(' ',$TCompiledAttr):'';
|
||||
$compiledAttributes = !empty($TCompiledAttr)?implode(' ', $TCompiledAttr):'';
|
||||
|
||||
$tag = !empty($attr['href'])?'a':'span';
|
||||
|
||||
|
||||
@@ -2200,11 +2200,11 @@ function colorStringToArray($stringcolor, $colorifnotfound = array(88,88,88))
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $color
|
||||
* @param boolean $allow_white
|
||||
* @param string $color the color you need to valid
|
||||
* @param boolean $allow_white in case of white isn't valid
|
||||
* @return boolean
|
||||
*/
|
||||
function colorValidateHex($color, $allow_white = false)
|
||||
function colorValidateHex($color, $allow_white = true)
|
||||
{
|
||||
|
||||
if(!$allow_white && ($color === '#fff' || $color === '#ffffff') ) return false;
|
||||
@@ -2218,8 +2218,8 @@ function colorValidateHex($color, $allow_white = false)
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hex
|
||||
* @param integer $steps
|
||||
* @param string $hex color in hex
|
||||
* @param integer $steps Steps should be between -255 and 255. Negative = darker, positive = lighter
|
||||
* @return string
|
||||
*/
|
||||
function colorAdjustBrightness($hex, $steps)
|
||||
@@ -2230,7 +2230,7 @@ function colorAdjustBrightness($hex, $steps)
|
||||
// Normalize into a six character long hex string
|
||||
$hex = str_replace('#', '', $hex);
|
||||
if (strlen($hex) == 3) {
|
||||
$hex = str_repeat(substr($hex,0,1), 2).str_repeat(substr($hex,1,1), 2).str_repeat(substr($hex,2,1), 2);
|
||||
$hex = str_repeat(substr($hex, 0, 1), 2).str_repeat(substr($hex, 1, 1), 2).str_repeat(substr($hex, 2, 1), 2);
|
||||
}
|
||||
|
||||
// Split into three parts: R, G and B
|
||||
@@ -2239,7 +2239,7 @@ function colorAdjustBrightness($hex, $steps)
|
||||
|
||||
foreach ($color_parts as $color) {
|
||||
$color = hexdec($color); // Convert to decimal
|
||||
$color = max(0,min(255,$color + $steps)); // Adjust color
|
||||
$color = max(0, min(255, $color + $steps)); // Adjust color
|
||||
$return .= str_pad(dechex($color), 2, '0', STR_PAD_LEFT); // Make two char hex code
|
||||
}
|
||||
|
||||
@@ -2247,7 +2247,7 @@ function colorAdjustBrightness($hex, $steps)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hex
|
||||
* @param string $hex color in hex
|
||||
* @param integer $percent 0 to 100
|
||||
* @return string
|
||||
*/
|
||||
@@ -2258,7 +2258,7 @@ function colorDarker($hex, $percent)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $hex
|
||||
* @param string $hex color in hex
|
||||
* @param integer $percent 0 to 100
|
||||
* @return string
|
||||
*/
|
||||
@@ -2270,9 +2270,9 @@ function colorLighten($hex, $percent)
|
||||
|
||||
|
||||
/**
|
||||
* @param string $hex
|
||||
* @param string $hex color in hex
|
||||
* @param float $alpha 0 to 1
|
||||
* @param bool $returnArray :
|
||||
* @param bool $returnArray
|
||||
* @return string
|
||||
*/
|
||||
function colorHexToRgb($hex, $alpha = false, $returnArray = false)
|
||||
@@ -2286,10 +2286,10 @@ function colorHexToRgb($hex, $alpha = false, $returnArray = false)
|
||||
$rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0));
|
||||
if ( $alpha !== false ) {
|
||||
$rgb['a'] = floatval($alpha);
|
||||
$string = 'rgba('.implode(',', $rgb ).')';
|
||||
$string = 'rgba('.implode(',', $rgb).')';
|
||||
}
|
||||
else{
|
||||
$string = 'rgb('.implode(',', $rgb ).')';
|
||||
$string = 'rgb('.implode(',', $rgb).')';
|
||||
}
|
||||
|
||||
if($returnArray){
|
||||
|
||||
@@ -294,21 +294,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
||||
?>
|
||||
<h4>Using hidden global conf MAIN_STATUS_USES_CSS=1</h4>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4') ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',1) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',2) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',3) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',4) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',5) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',6) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 1) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 2) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 3) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 4) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 5) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 6) ?></p>
|
||||
|
||||
<?php $conf->global->MAIN_STATUS_USES_CSS = 0; ?>
|
||||
<h4>Disabled hidden global conf : MAIN_STATUS_USES_CSS=0</h4>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',1) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',2) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',3) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',4) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',5) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',6) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 1) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 2) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 3) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 4) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 5) ?></p>
|
||||
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 6) ?></p>
|
||||
|
||||
<?php $conf->global->MAIN_STATUS_USES_CSS = $saveGlobalConf; ?>
|
||||
|
||||
|
||||
@@ -76,5 +76,3 @@ $badgeStatus6='#cad2d2';
|
||||
$badgeStatus7='#baa32b';
|
||||
$badgeStatus8='#be3013';
|
||||
$badgeStatus9='#e7f0f0';
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user