/** * This method checks to see if the configuration file exists and, if not, creates one by default * */ public function preDisplay() { global $app_strings; //Rebuild config file if it doesn't exist if (!file_exists($this->configFile)) { ModuleInstaller::handleBaseConfig(); } $this->ss->assign("configFile", $this->configFile); $config = ModuleInstaller::getBaseConfig(); $this->ss->assign('configHash', md5(serialize($config))); $sugarSidecarPath = ensureJSCacheFilesExist(); $this->ss->assign("sugarSidecarPath", $sugarSidecarPath); // TODO: come up with a better way to deal with the various JS files // littered in sidecar.tpl. $voodooFile = 'custom/include/javascript/voodoo.js'; if (SugarAutoLoader::fileExists($voodooFile)) { $this->ss->assign('voodooFile', $voodooFile); } //Load sidecar theme css $theme = new SidecarTheme(); $this->ss->assign("css_url", $theme->getCSSURL()); $this->ss->assign("developerMode", inDeveloperMode()); //Loading label $this->ss->assign('LBL_LOADING', $app_strings['LBL_ALERT_TITLE_LOADING']); $this->ss->assign('LBL_ENABLE_JAVASCRIPT', $app_strings['LBL_ENABLE_JAVASCRIPT']); $slFunctionsPath = inDeveloperMode() ? "cache/Expressions/functions_cache_debug.js" : "cache/Expressions/functions_cache.js"; if (!is_file($slFunctionsPath)) { $GLOBALS['updateSilent'] = true; include "include/Expressions/updatecache.php"; } $this->ss->assign("SLFunctionsPath", $slFunctionsPath); if (!empty($this->authorization)) { $this->ss->assign('appPrefix', $config['env'] . ":" . $config['appId'] . ":"); $this->ss->assign('authorization', $this->authorization); } }
/** * Rebuilds the base Sidecar configuration file. */ public function repairBaseConfig() { require_once 'ModuleInstall/ModuleInstaller.php'; ModuleInstaller::handleBaseConfig(); }
$config_check = $mod_strings['MSG_CONFIG_FILE_READY_FOR_REBUILD']; $disable_config_rebuild = ''; $config_file_ready = true; } else { $config_check = $mod_strings['MSG_MAKE_CONFIG_FILE_WRITABLE']; } // only do the rebuild if config file checks out and user has posted back if (!empty($_POST['perform_rebuild']) && $config_file_ready) { // retrieve configuration from file so that contents of config_override.php // is not merged (bug #54403) $clean_config = loadCleanConfig(); if (rebuildConfigFile($clean_config, $sugar_version)) { $config_check = $mod_strings['MSG_CONFIG_FILE_REBUILD_SUCCESS']; $disable_config_rebuild = 'disabled="disabled"'; } else { $config_check = $mod_strings['MSG_CONFIG_FILE_REBUILD_FAILED']; } require_once 'ModuleInstall/ModuleInstaller.php'; ModuleInstaller::handleBaseConfig(); ModuleInstaller::handlePortalConfig(); } ///////////////////////////////////////////////////////////////////// // TEMPLATE ASSIGNING $xtpl = new XTemplate('modules/Administration/RebuildConfig.html'); $xtpl->assign('LBL_CONFIG_CHECK', $mod_strings['LBL_CONFIG_CHECK']); $xtpl->assign('CONFIG_CHECK', $config_check); $xtpl->assign('LBL_PERFORM_REBUILD', $lbl_rebuild_config); $xtpl->assign('DISABLE_CONFIG_REBUILD', $disable_config_rebuild); $xtpl->assign('BTN_PERFORM_REBUILD', $btn_rebuild_config); $xtpl->parse('main'); $xtpl->out('main');
function handleSidecarConfig() { require_once 'ModuleInstall/ModuleInstaller.php'; return ModuleInstaller::handleBaseConfig(); }