mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4517 - PHP 8.1: Replace strlen() usages with utils::StrLen() for compatibility
This commit is contained in:
@@ -655,7 +655,7 @@ abstract class MenuNode
|
||||
$this->sMenuId = $sMenuId;
|
||||
$this->iParentIndex = $iParentIndex;
|
||||
$this->aReflectionProperties = array();
|
||||
if (strlen($sEnableClass) > 0)
|
||||
if (utils::StrLen($sEnableClass) > 0)
|
||||
{
|
||||
$this->aReflectionProperties['enable_class'] = $sEnableClass;
|
||||
$this->aReflectionProperties['enable_action'] = $iActionCode;
|
||||
|
||||
@@ -461,7 +461,7 @@ abstract class MetaModel
|
||||
$oStyle = self::$m_aClassParams[$sClass]['style'];
|
||||
$sIcon = $oStyle->GetIconAsAbsUrl();
|
||||
}
|
||||
if (strlen($sIcon) == 0) {
|
||||
if (utils::StrLen($sIcon) == 0) {
|
||||
$sParentClass = self::GetParentPersistentClass($sClass);
|
||||
if (strlen($sParentClass) > 0) {
|
||||
return self::GetClassIcon($sParentClass, $bImgTag, $sMoreStyles);
|
||||
@@ -494,7 +494,7 @@ abstract class MetaModel
|
||||
$oStyle = new ormStyle("ibo-class-style--$sClass", "ibo-class-style-alt--$sClass");
|
||||
}
|
||||
|
||||
if ((strlen($oStyle->GetMainColor()) > 0) && (strlen($oStyle->GetComplementaryColor()) > 0) && (strlen($oStyle->GetIconAsRelPath()) > 0)) {
|
||||
if ((utils::StrLen($oStyle->GetMainColor()) > 0) && (utils::StrLen($oStyle->GetComplementaryColor()) > 0) && (utils::StrLen($oStyle->GetIconAsRelPath()) > 0)) {
|
||||
// all the parameters are set, no need to search in the parent classes
|
||||
return $oStyle;
|
||||
}
|
||||
@@ -504,18 +504,18 @@ abstract class MetaModel
|
||||
while (strlen($sParentClass) > 0) {
|
||||
$oParentStyle = self::GetClassStyle($sParentClass);
|
||||
if (!is_null($oParentStyle)) {
|
||||
if (strlen($oStyle->GetMainColor()) == 0) {
|
||||
if (utils::StrLen($oStyle->GetMainColor()) == 0) {
|
||||
$oStyle->SetMainColor($oParentStyle->GetMainColor());
|
||||
$oStyle->SetStyleClass($oParentStyle->GetStyleClass());
|
||||
}
|
||||
if (strlen($oStyle->GetComplementaryColor()) == 0) {
|
||||
if (utils::StrLen($oStyle->GetComplementaryColor()) == 0) {
|
||||
$oStyle->SetComplementaryColor($oParentStyle->GetComplementaryColor());
|
||||
$oStyle->SetAltStyleClass($oParentStyle->GetAltStyleClass());
|
||||
}
|
||||
if (strlen($oStyle->GetIconAsRelPath()) == 0) {
|
||||
if (utils::StrLen($oStyle->GetIconAsRelPath()) == 0) {
|
||||
$oStyle->SetIcon($oParentStyle->GetIconAsRelPath());
|
||||
}
|
||||
if ((strlen($oStyle->GetMainColor()) > 0) && (strlen($oStyle->GetComplementaryColor()) > 0) && (strlen($oStyle->GetIconAsRelPath()) > 0)) {
|
||||
if ((utils::StrLen($oStyle->GetMainColor()) > 0) && (utils::StrLen($oStyle->GetComplementaryColor()) > 0) && (utils::StrLen($oStyle->GetIconAsRelPath()) > 0)) {
|
||||
// all the parameters are set, no need to search in the parent classes
|
||||
return $oStyle;
|
||||
}
|
||||
@@ -523,7 +523,7 @@ abstract class MetaModel
|
||||
$sParentClass = self::GetParentPersistentClass($sParentClass);
|
||||
}
|
||||
|
||||
if ((strlen($oStyle->GetMainColor()) == 0) && (strlen($oStyle->GetComplementaryColor()) == 0) && (strlen($oStyle->GetIconAsRelPath()) == 0)) {
|
||||
if ((utils::StrLen($oStyle->GetMainColor()) == 0) && (utils::StrLen($oStyle->GetComplementaryColor()) == 0) && (utils::StrLen($oStyle->GetIconAsRelPath()) == 0)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -423,11 +423,11 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
|
||||
$oButton->SetActionType($sActionType)
|
||||
->SetColor($sColor);
|
||||
|
||||
if (strlen($sValue) > 0) {
|
||||
if (utils::StrLen($sValue) > 0) {
|
||||
$oButton->SetValue($sValue);
|
||||
}
|
||||
|
||||
if (strlen($sName) > 0) {
|
||||
if (utils::StrLen($sName) > 0) {
|
||||
$oButton->SetName($sName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user