sPlaceholderRelPath = $sPlaceholderRelPath; } /** * @param string $sUrl * * @return $this */ public function SetUrl(string $sUrl) { $this->sUrl = $sUrl; return $this; } /** * @return string */ public function GetUrl(): string { return $this->sUrl; } /** * Set whether the tab should should be cached by the browser or always refreshed * * @param bool $bCache * * @return $this */ public function SetCache(bool $bCache) { $this->bCache = $bCache; return $this; } /** * Return whether the tab should should be cached by the browser or always refreshed * * @return string */ public function GetCache(): string { return $this->bCache ? 'true' : 'false'; } /** * * @param string $sPlaceholderRelPath * * @return $this */ public function SetPlaceholderRelPath(string $sPlaceholderRelPath) { $this->sPlaceholderRelPath = $sPlaceholderRelPath; return $this; } /** * * @return string */ public function GetPlaceholderRelPath(): string { return $this->sPlaceholderRelPath; } /** * * @return string * @throws \Exception */ public function GetPlaceholderAbsPath(): string { return utils::GetAbsoluteUrlAppRoot().$this->sPlaceholderRelPath; } //------------------------------- // iUIBlock implementation //------------------------------- /** * @inheritDoc */ public function GetParameters(): array { $aParams = parent::GetParameters(); $aParams['sURL'] = $this->GetUrl(); $aParams['sCache'] = $this->GetCache() ? 'true' : 'false'; return $aParams; } //------------------------------- // iUIContentBlock implementation //------------------------------- /** * @inheritDoc * @throws \Combodo\iTop\Application\UI\Base\UIException */ public function AddHtml(string $sHtml) { throw new UIException($this, Dict::Format('UIBlock:Error:AddBlockForbidden', $this->GetId())); } /** * @inheritDoc * @throws \Combodo\iTop\Application\UI\Base\UIException */ public function AddSubBlock(?iUIBlock $oSubBlock) { throw new UIException($this, Dict::Format('UIBlock:Error:AddBlockForbidden', $this->GetId())); } /** * @inheritDoc */ public function GetSubBlocks(): array { return []; } }