mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02: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->sMenuId = $sMenuId;
|
||||||
$this->iParentIndex = $iParentIndex;
|
$this->iParentIndex = $iParentIndex;
|
||||||
$this->aReflectionProperties = array();
|
$this->aReflectionProperties = array();
|
||||||
if (strlen($sEnableClass) > 0)
|
if (utils::StrLen($sEnableClass) > 0)
|
||||||
{
|
{
|
||||||
$this->aReflectionProperties['enable_class'] = $sEnableClass;
|
$this->aReflectionProperties['enable_class'] = $sEnableClass;
|
||||||
$this->aReflectionProperties['enable_action'] = $iActionCode;
|
$this->aReflectionProperties['enable_action'] = $iActionCode;
|
||||||
|
|||||||
@@ -461,7 +461,7 @@ abstract class MetaModel
|
|||||||
$oStyle = self::$m_aClassParams[$sClass]['style'];
|
$oStyle = self::$m_aClassParams[$sClass]['style'];
|
||||||
$sIcon = $oStyle->GetIconAsAbsUrl();
|
$sIcon = $oStyle->GetIconAsAbsUrl();
|
||||||
}
|
}
|
||||||
if (strlen($sIcon) == 0) {
|
if (utils::StrLen($sIcon) == 0) {
|
||||||
$sParentClass = self::GetParentPersistentClass($sClass);
|
$sParentClass = self::GetParentPersistentClass($sClass);
|
||||||
if (strlen($sParentClass) > 0) {
|
if (strlen($sParentClass) > 0) {
|
||||||
return self::GetClassIcon($sParentClass, $bImgTag, $sMoreStyles);
|
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");
|
$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
|
// all the parameters are set, no need to search in the parent classes
|
||||||
return $oStyle;
|
return $oStyle;
|
||||||
}
|
}
|
||||||
@@ -504,18 +504,18 @@ abstract class MetaModel
|
|||||||
while (strlen($sParentClass) > 0) {
|
while (strlen($sParentClass) > 0) {
|
||||||
$oParentStyle = self::GetClassStyle($sParentClass);
|
$oParentStyle = self::GetClassStyle($sParentClass);
|
||||||
if (!is_null($oParentStyle)) {
|
if (!is_null($oParentStyle)) {
|
||||||
if (strlen($oStyle->GetMainColor()) == 0) {
|
if (utils::StrLen($oStyle->GetMainColor()) == 0) {
|
||||||
$oStyle->SetMainColor($oParentStyle->GetMainColor());
|
$oStyle->SetMainColor($oParentStyle->GetMainColor());
|
||||||
$oStyle->SetStyleClass($oParentStyle->GetStyleClass());
|
$oStyle->SetStyleClass($oParentStyle->GetStyleClass());
|
||||||
}
|
}
|
||||||
if (strlen($oStyle->GetComplementaryColor()) == 0) {
|
if (utils::StrLen($oStyle->GetComplementaryColor()) == 0) {
|
||||||
$oStyle->SetComplementaryColor($oParentStyle->GetComplementaryColor());
|
$oStyle->SetComplementaryColor($oParentStyle->GetComplementaryColor());
|
||||||
$oStyle->SetAltStyleClass($oParentStyle->GetAltStyleClass());
|
$oStyle->SetAltStyleClass($oParentStyle->GetAltStyleClass());
|
||||||
}
|
}
|
||||||
if (strlen($oStyle->GetIconAsRelPath()) == 0) {
|
if (utils::StrLen($oStyle->GetIconAsRelPath()) == 0) {
|
||||||
$oStyle->SetIcon($oParentStyle->GetIconAsRelPath());
|
$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
|
// all the parameters are set, no need to search in the parent classes
|
||||||
return $oStyle;
|
return $oStyle;
|
||||||
}
|
}
|
||||||
@@ -523,7 +523,7 @@ abstract class MetaModel
|
|||||||
$sParentClass = self::GetParentPersistentClass($sParentClass);
|
$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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -423,11 +423,11 @@ class ButtonUIBlockFactory extends AbstractUIBlockFactory
|
|||||||
$oButton->SetActionType($sActionType)
|
$oButton->SetActionType($sActionType)
|
||||||
->SetColor($sColor);
|
->SetColor($sColor);
|
||||||
|
|
||||||
if (strlen($sValue) > 0) {
|
if (utils::StrLen($sValue) > 0) {
|
||||||
$oButton->SetValue($sValue);
|
$oButton->SetValue($sValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($sName) > 0) {
|
if (utils::StrLen($sName) > 0) {
|
||||||
$oButton->SetName($sName);
|
$oButton->SetName($sName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user