m_sRootUrl = $this->GetAbsoluteUrlAppRoot(); parent::__construct($s_title, $bPrintable); $this->LoadTheme(); $oKpi->ComputeStats(get_class($this).' creation', 'NiceWebPage'); } /** * @inheritDoc * @since 3.0.0 */ protected function InitializeScripts(): void { parent::InitializeScripts(); $sAbsURLAppRoot = addslashes($this->m_sRootUrl); $sAbsURLModulesRoot = addslashes($this->GetAbsoluteUrlModulesRoot()); $sEnvironment = addslashes(utils::GetCurrentEnvironment()); $sAppContext = addslashes($this->GetApplicationContext()); $this->add_script( << 0) { if (sURL.indexOf('?') == -1) { return sURL+'?'+sContext; } return sURL+'&'+sContext; } return sURL; } JS ); } /** * @inheritDoc * @since 3.0.0 */ protected function InitializeLinkedScripts(): void { parent::InitializeLinkedScripts(); // Used throughout the app. $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/jquery/dist/jquery.min.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.blockUI.js'); if (utils::IsDevelopmentEnvironment()) // Needed since many other plugins still rely on oldies like $.browser { $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.dev-params.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.dev.js'); } else { $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery-migrate.prod.min.js'); } $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/jquery-ui-dist/jquery-ui.min.js'); // Used throughout the app. $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/utils.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/latinise/latinise.min.js'); } /** * @inheritDoc * @since 3.0.0 */ protected function InitializeDictEntries(): void { parent::InitializeDictEntries(); $this->add_dict_entries('UI:Combo'); } public function SetRootUrl($sRootUrl) { $this->m_sRootUrl = $sRootUrl; } public function small_p($sText) { $this->add("

$sText

\n"); } public function GetAbsoluteUrlAppRoot() { return utils::GetAbsoluteUrlAppRoot(); } public function GetAbsoluteUrlModulesRoot() { return utils::GetAbsoluteUrlModulesRoot(); } function GetApplicationContext() { $oAppContext = new ApplicationContext(); return $oAppContext->GetForLink(); } // By Rom, used by CSVImport and Advanced search public function MakeClassesSelect($sName, $sDefaultValue, $iWidthPx, $iActionCode = null) { // $aTopLevelClasses = array('bizService', 'bizContact', 'logInfra', 'bizDocument'); // These are classes wich root class is cmdbAbstractObject ! $this->add(""); } // By Rom, used by Advanced search public function add_select($aChoices, $sName, $sDefaultValue, $iWidthPx) { $this->add(""); } /** * @inheritDoc * @throws \Exception */ protected function LoadTheme() { // TODO 3.0.0: Remove light-grey when development of Full Moon is done. // TODO 3.0.0: Reuse theming mechanism for Full Moon $sCssThemeUrl = ThemeHandler::GetCurrentThemeUrl(); $this->add_linked_stylesheet($sCssThemeUrl); } protected function GetReadyScriptsStartedTrigger(): ?string { return <<