Esempio n. 1
0
 public function index()
 {
     if (!is_file(APP_PATH . "/Data/install.lock")) {
         //            $this->display("install");
         return;
     }
     $this->assign("isDebug", APP_DEBUG ? 'true' : 'false');
     $this->assign("APP_DEBUG", APP_DEBUG);
     $this->assign("siteTitle", DBC("site.title"));
     $loadedApps = F("loadedApp");
     $loadedApps = array_merge($loadedApps, getPrimaryApps(true));
     unset($loadedApps["install"]);
     $this->assign("loadedAppsStr", json_encode($loadedApps));
     //静态资源
     import("@.ORG.staticRuntime");
     $runtime = new FrontEndRuntime($loadedApps);
     if (!APP_DEBUG) {
         $javascripts = array(U('FrontendRuntime/read?compileJS=compile.js'));
     } else {
         $javascripts = $runtime->getJavascripts();
     }
     $javascripts[] = U('FrontendRuntime/read?js=common/base/app.js');
     $this->assign("javascripts", $javascripts);
     if ($this->isLogin()) {
         $this->assign("APP_PATH", str_replace("index.php", "", __APP__));
         $this->assign("userInfo", json_encode($this->user));
         $this->display("app");
     } else {
         $this->display("login");
     }
 }
 public function read()
 {
     import("@.ORG.staticRuntime");
     $loadedApps = F("loadedApp");
     $runtime = new FrontEndRuntime($loadedApps);
     if (isset($_GET["compileJS"])) {
         import("@.ORG.staticRuntime");
         $runtime = new FrontEndRuntime($loadedApps);
         $javascripts = $runtime->getJavascripts();
         foreach ($javascripts as $js) {
             $runtime->echoJS($js);
         }
     } else {
         if (isset($_GET["js"])) {
             $file = $_GET["js"];
             $runtime->echoJS($file);
         }
     }
 }