* @internal * @since 3.0.0 */ interface iUIBlock { /** * Return the relative path (from /templates/) of the global template (HTML, JS, CSS) to use or null if it's not provided. Should not be used to often as JS/CSS files would be duplicated making the browser parsing time way longer. * * @return string|null */ public static function GetGlobalTemplateRelPath(); /** * Return the relative path (from /templates/) of the HTML template to use or null if no HTML to render * * @return string|null */ public static function GetHtmlTemplateRelPath(); /** * Return the relative path (from /templates/) of the JS template to use or null if there is no inline JS to render * * @return string|null */ public static function GetJsTemplateRelPath(); /** * Return an array of the relative paths (from /) of the JS files to use for the block itself * * @return array */ public static function GetJsFilesRelPaths(); /** * Return the relative path (from /templates/) of the CSS template to use or null if there is no inline CSS to render * * @return string|null */ public static function GetCssTemplateRelPath(); /** * Return an array of the relative paths (from /) of the CSS files to use for the block itself * * @return array */ public static function GetCssFilesRelPaths(); /** * Return the ID of the block * * @return string */ public function GetId(); /** * Return an array iUIBlock embedded in this iUIBlock * Must be an associative array ( => ) * * @return \Combodo\iTop\Application\UI\iUIBlock[] */ public function GetSubBlocks(); /** * Return an array of the JS files URL necessary for the block and all its sub blocks. * URLs are relative unless the $bAbsolutePath is set to true. * * @param bool $bAbsoluteUrl * * @return string[] */ public function GetJsFilesUrlRecursively(bool $bAbsoluteUrl = false); /** * Return an array of the CSS files URL necessary for the block and all its sub blocks. * URLs are relative unless the $bAbsolutePath is set to true. * * @param bool $bAbsoluteUrl * * @return string[] * @throws \Exception */ public function GetCssFilesUrlRecursively(bool $bAbsoluteUrl = false); /** * Add HTML code to the current block * * @param string $sHTML * * @return $this */ public function AddHtml(string $sHTML); /** * Return block specific parameters * * @return array */ public function GetParameters(): array; }