Пример #1
0
 public function run()
 {
     if (!$this->toFlavor('pro')) {
         return;
     }
     require_once 'ModuleInstall/ModuleInstaller.php';
     $this->putFile($this->cacheDir('config.js'), ModuleInstaller::getJSConfig(ModuleInstaller::getBaseConfig()));
 }
Пример #2
0
 /**
  * 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);
     }
 }