Merge remote-tracking branch 'origin/support/2.7' into support/3.0

# Conflicts:
#	lib/composer/installed.php
#	setup/licenses/community-licenses.xml
#	setup/setuputils.class.inc.php
#	sources/application/TwigBase/Controller/Controller.php
This commit is contained in:
Pierre Goiffon
2022-02-14 08:41:33 +01:00
416 changed files with 6638 additions and 2444 deletions

View File

@@ -74,6 +74,10 @@ abstract class Controller
private $m_aBlockParams;
/** @var string */
private $m_sAccessTokenConfigParamId = null;
/** @var boolean false to disable breadcrumb */
private $m_bIsBreadCrumbEnabled = true;
/** @var array contains same parameters as {@see iTopWebPage::SetBreadCrumbEntry()} */
private $m_aBreadCrumbEntry = [];
/**
* Controller constructor.
@@ -598,6 +602,22 @@ abstract class Controller
$this->m_aBlockParams = $aBlockParams;
}
/**
* @since 2.7.7 3.0.1 3.1.0 N°4760 method creation
* @see Controller::SetBreadCrumbEntry() to set breadcrumb content (by default will be title)
*/
public function DisableBreadCrumb() {
$this->m_bIsBreadCrumbEnabled = false;
}
/**
* @since 2.7.7 3.0.1 3.1.0 N°4760 method creation
* @see iTopWebPage::SetBreadCrumbEntry()
*/
public function SetBreadCrumbEntry($sId, $sLabel, $sDescription, $sUrl = '', $sIcon = '') {
$this->m_aBreadCrumbEntry = [$sId, $sLabel, $sDescription, $sUrl, $sIcon];
}
/**
* @param $aParams
* @param $sName
@@ -638,6 +658,16 @@ abstract class Controller
case self::ENUM_PAGE_TYPE_HTML:
$this->m_oPage = new iTopWebPage($this->GetOperationTitle(), false);
$this->m_oPage->add_xframe_options();
if ($this->m_bIsBreadCrumbEnabled) {
if (count($this->m_aBreadCrumbEntry) > 0) {
list($sId, $sTitle, $sDescription, $sUrl, $sIcon) = $this->m_aBreadCrumbEntry;
$this->m_oPage->SetBreadCrumbEntry($sId, $sTitle, $sDescription, $sUrl, $sIcon);
}
} else {
$this->m_oPage->DisableBreadCrumb();
}
break;
case self::ENUM_PAGE_TYPE_BASIC_HTML: