mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 22:48:45 +02:00
N°3379 - Introduce more modern tooltip lib. in the backoffice
- Allow usage of quotes, especially in attributes description - Allow line breaks, especially in attributes description - Allow better positioning (automatic) when close to the screen limits - Allow HTML (careful about XSS), content is sanitized by default
This commit is contained in:
@@ -882,8 +882,14 @@ EOF
|
||||
$aArgs).'';
|
||||
}
|
||||
$aFieldsMap[$sAttCode] = $sInputId;
|
||||
|
||||
// Attribute description
|
||||
$sDescription = $oAttDef->GetDescription();
|
||||
$sDescriptionForHTMLTag = utils::HtmlEntities($sDescription);
|
||||
$sDescriptionHTMLTag = (empty($sDescriptionForHTMLTag)) ? '' : 'class="ibo-has-description" data-tooltip-content="'.$sDescriptionForHTMLTag.'"';
|
||||
|
||||
$val = array(
|
||||
'label' => '<span title="'.$oAttDef->GetDescription().'">'.$oAttDef->GetLabel().'</span>',
|
||||
'label' => '<span '.$sDescriptionHTMLTag.' >'.$oAttDef->GetLabel().'</span>',
|
||||
'value' => $sHTMLValue,
|
||||
'comments' => $sComments,
|
||||
'infos' => $sInfos,
|
||||
@@ -892,8 +898,13 @@ EOF
|
||||
}
|
||||
else
|
||||
{
|
||||
// Attribute description
|
||||
$sDescription = $oAttDef->GetDescription();
|
||||
$sDescriptionForHTMLTag = utils::HtmlEntities($sDescription);
|
||||
$sDescriptionHTMLTag = (empty($sDescriptionForHTMLTag)) ? '' : 'class="ibo-has-description" data-tooltip-content="'.$sDescriptionForHTMLTag.'"';
|
||||
|
||||
$val = array(
|
||||
'label' => '<span title="'.$oAttDef->GetDescription().'">'.$oAttDef->GetLabel().'</span>',
|
||||
'label' => '<span '.$sDescriptionHTMLTag.' >'.$oAttDef->GetLabel().'</span>',
|
||||
'value' => "<span id=\"field_{$sInputId}\">".$this->GetAsHTML($sAttCode)."</span>",
|
||||
'comments' => $sComments,
|
||||
'infos' => $sInfos,
|
||||
@@ -3240,9 +3251,14 @@ EOF
|
||||
$sDisplayValue = $this->GetAsHTML($sAttCode);
|
||||
}
|
||||
}
|
||||
|
||||
// Attribute description
|
||||
$sDescription = $oAttDef->GetDescription();
|
||||
$sDescriptionForHTMLTag = utils::HtmlEntities($sDescription);
|
||||
$sDescriptionHTMLTag = (empty($sDescriptionForHTMLTag)) ? '' : 'class="ibo-has-description" data-tooltip-content="'.$sDescriptionForHTMLTag.'"';
|
||||
|
||||
$retVal = array(
|
||||
'label' => '<span title="'.MetaModel::GetDescription($sClass,
|
||||
$sAttCode).'">'.MetaModel::GetLabel($sClass, $sAttCode).'</span>',
|
||||
'label' => '<span '.$sDescriptionHTMLTag.' >'.MetaModel::GetLabel($sClass, $sAttCode).'</span>',
|
||||
'value' => $sDisplayValue,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user