* @package Combodo\iTop\Application\UI\Component\Breadcrumbs * @internal * @since 2.8.0 */ class Breadcrumbs extends UIBlock { const BLOCK_CODE = 'ibo-breadcrumbs'; const HTML_TEMPLATE_REL_PATH = 'components/breadcrumbs/layout'; const JS_TEMPLATE_REL_PATH = 'components/breadcrumbs/layout'; const JS_FILES_REL_PATH = [ 'js/components/breadcrumbs.js', ]; /** @var array|null $aNewEntry */ protected $aNewEntry; /** * QuickCreate constructor. * * @param string $sId * @param array|null $aNewEntry */ public function __construct($sId = null, $aNewEntry = null) { parent::__construct($sId); $this->SetNewEntry($aNewEntry); } /** * The new breadcrumbs entry * * @param array|null $aNewEntry * * @return $this */ public function SetNewEntry($aNewEntry) { $this->aNewEntry = $aNewEntry; return $this; } /** * @return array|null */ public function GetNewEntry() { return $this->aNewEntry; } /** * @return array * @throws \ConfigException * @throws \CoreException * @throws \Exception */ public function GetJsWidgetOptions() { $aJsWidgetOptions = []; $iBreadCrumbMaxCount = utils::GetConfig()->Get('breadcrumb.max_count'); if ($iBreadCrumbMaxCount > 1) { $oConfig = MetaModel::GetConfig(); $siTopInstanceId = $oConfig->GetItopInstanceid(); $aJsWidgetOptions = [ 'itop_instance_id' => $siTopInstanceId, 'max_count' => $iBreadCrumbMaxCount, 'new_entry' => $this->GetNewEntry(), ]; } return $aJsWidgetOptions; } }