add_linked_script("../js/jquery.blockUI.js"); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/@popperjs/core/dist/umd/popper.js'); $this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/dist/tippy-bundle.umd.js'); $this->add_linked_script("../setup/setup.js"); $this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-awesome/css/all.min.css'); $this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'css/font-combodo/font-combodo.css'); $this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/dist/tippy.css'); $this->add_linked_stylesheet(utils::GetAbsoluteUrlAppRoot().'node_modules/tippy.js/animations/shift-away-subtle.css'); $this->LoadTheme(); $this->add_saas("css/setup.scss"); } /** * Overriden because the application is not fully loaded when the setup is being run */ public function GetAbsoluteUrlAppRoot() { return '../'; } /** * Overriden because the application is not fully loaded when the setup is being run */ public function GetAbsoluteUrlModulesRoot() { return $this->GetAbsoluteUrlAppRoot().utils::GetCurrentEnvironment(); } /** * Overriden because the application is not fully loaded when the setup is being run */ function GetApplicationContext() { return ''; } public function info($sText, $sTextForLog = null) { $this->add("

$sText

\n"); SetupLog::Info($sTextForLog ?? $sText); } public function ok($sText, $sTextForLog = null) { $this->add("
Success:$sText
"); SetupLog::Ok($sTextForLog ?? $sText); } public function warning($sText, $sTextForLog = null) { $this->add("
Warning:$sText
"); SetupLog::Warning($sTextForLog ?? $sText); } public function error($sText, $sTextForLog = null) { $this->add("
$sText
"); SetupLog::Error($sTextForLog ?? $sText); } public function form($aData) { $this->add("\n"); foreach ($aData as $aRow) { $this->add("\n"); if (isset($aRow['label']) && isset($aRow['input']) && isset($aRow['help'])) { $this->add("\n"); $this->add("\n"); $this->add("\n"); } else { if (isset($aRow['label']) && isset($aRow['help'])) { $this->add("\n"); $this->add("\n"); } else { if (isset($aRow['label']) && isset($aRow['input'])) { $this->add("\n"); $this->add("\n"); } else { if (isset($aRow['label'])) { $this->add("\n"); } } } } $this->add("\n"); } $this->add("
{$aRow['label']}{$aRow['input']}{$aRow['help']}{$aRow['label']}{$aRow['help']}{$aRow['label']}{$aRow['input']}{$aRow['label']}
\n"); } public function collapsible($sId, $sTitle, $aItems, $bOpen = true) { $this->add("

$sTitle

"); $this->p(''); $this->add_ready_script("$('#{$sId}').on('click', function() { $(this).toggleClass('open'); $('#{$sId}_list').toggle();} );\n"); if (!$bOpen) { $this->add_ready_script("$('#{$sId}').toggleClass('open'); $('#{$sId}_list').toggle();\n"); } } public function output() { $sLogo = utils::GetAbsoluteUrlAppRoot().'/images/logos/logo-itop-simple-dark.svg?t='.utils::GetCacheBusterTimestamp(); $oSetupPage = UIContentBlockUIBlockFactory::MakeStandard(); $oHeader = UIContentBlockUIBlockFactory::MakeStandard('header', ['ibo-setup--header']); $oSetupPage->AddSubBlock($oHeader); $oTitle = TitleUIBlockFactory::MakeForPageWithIcon($this->s_title, $sLogo, Title::DEFAULT_ICON_COVER_METHOD, false); $oHeader->AddSubBlock($oTitle); $oSetup = UIContentBlockUIBlockFactory::MakeStandard('setup', ['ibo-setup--body']); $oSetupPage->AddSubBlock($oSetup); $oSetup->AddSubBlock($this->oContentLayout); $this->oContentLayout = $oSetupPage; return parent::output(); } /** * @inheritDoc */ protected function LoadTheme() { // Do nothing } /** * @inheritDoc */ protected function GetFaviconAbsoluteUrl() { return utils::GetAbsoluteUrlAppRoot().'setup/favicon.ico'; } }