Example #1
0
    $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');
 /**
  * Saves Portal settings in the database.
  *
  * @param array $portalConfig an array containing Portal settings to save.
  */
 private function savePortalSettings(array $portalConfig)
 {
     //TODO: Remove after we resolve issues with test associated to this
     $GLOBALS['log']->info('Updating portal config');
     foreach ($portalConfig as $fieldKey => $fieldValue) {
         // TODO: category should be `support`, platform should be `portal`
         $admin = $this->getAdministrationBean();
         if (!$admin->saveSetting('portal', $fieldKey, json_encode($fieldValue), 'support')) {
             $GLOBALS['log']->fatal("Error saving portal config var {$fieldKey}, orig: {$fieldValue} , json:" . json_encode($fieldValue));
         }
     }
     // Verify the existence of the javascript config file
     if (!file_exists('portal2/config.js')) {
         require_once 'ModuleInstall/ModuleInstaller.php';
         ModuleInstaller::handlePortalConfig();
     }
 }
 /**
  * Rebuild the portal javascript config file.
  */
 public function repairPortalConfig()
 {
     require_once 'ModuleInstall/ModuleInstaller.php';
     ModuleInstaller::handlePortalConfig();
 }
Example #4
0
/**
 * handles portal config creation
 */
function handlePortalConfig()
{
    require_once 'ModuleInstall/ModuleInstaller.php';
    return ModuleInstaller::handlePortalConfig();
}