Example #1
0
 public function toString()
 {
     $html = "<!DOCTYPE html>";
     $html .= "\n" . "<html lang=\"" . "en" . "\">";
     $html .= _hx_string_or_null($this->head->toString());
     $_g = 0;
     $_g1 = $this->scripts;
     while ($_g < $_g1->length) {
         $script = $_g1[$_g];
         ++$_g;
         if ($script->path !== null) {
             $this->body->add("<script type=\"text/javascript\" src=\"" . _hx_string_or_null($script->path) . "\"></script>");
         } else {
             $this->body->add("<script type=\"text/javascript\">" . _hx_string_or_null($script->code) . "</script>");
         }
         unset($script);
     }
     if ($this->swfobjects->length > 0) {
         $this->body->add("<script type=\"text/javascript\" src=\"" . "/js" . "swfobject.js\"></script>");
         $this->body->add("<script type=\"text/javascript\">");
         $_g2 = 0;
         $_g11 = $this->swfobjects;
         while ($_g2 < $_g11->length) {
             $swfobject = $_g11[$_g2];
             ++$_g2;
             $this->body->add("\t" . "swfobject.embedSWF(\"" . _hx_string_or_null($swfobject->path) . "\", \"" . _hx_string_or_null($swfobject->id) . "\", \"" . _hx_string_or_null($swfobject->width) . "\", \"" . _hx_string_or_null($swfobject->height) . "\", \"" . "9" . "\", \"" . "/swf" . "expressInstall.swf\", " . _hx_string_or_null(haxe_Json::phpJsonEncode($swfobject->flashvars, null, null)) . " );");
             unset($swfobject);
         }
         $this->body->add("</script>");
     }
     $html .= _hx_string_or_null($this->body->toString());
     $html .= "\n" . "</html>";
     return $html;
 }
Example #2
0
 public function remoteCall($callData)
 {
     $call = haxe_Json::phpJsonDecode($callData);
     $remote = new zcale_core_web_httpRemote_targets_ServerHttpRemote($this->eventData);
     $remote->event->addListener($remote->eventKeys->complete, isset($this->onRemoteComplete) ? $this->onRemoteComplete : array($this, "onRemoteComplete"));
     $remote->event->addListener($remote->eventKeys->error, isset($this->onRemoteError) ? $this->onRemoteError : array($this, "onRemoteError"));
     $remote->call($call->classPath, $call->methodName, $call->arguments);
 }
Example #3
0
 static function phpJsonEncode($val)
 {
     $json = json_encode(haxe_Json::convertBeforeEncode($val));
     if ($json === false) {
         haxe_Json_0($json, $val);
     } else {
         return $json;
     }
 }
Example #4
0
 static function phpJsonEncode($val, $replacer = null, $space = null)
 {
     if (null !== $replacer || null !== $space) {
         return haxe_format_JsonPrinter::hprint($val, $replacer, $space);
     }
     $json = json_encode(haxe_Json::convertBeforeEncode($val));
     if ($json === false) {
         throw new HException("invalid json");
     } else {
         return $json;
     }
 }
Example #5
0
 static function main()
 {
     $files = sys_FileSystem::readDirectory("../images");
     $validimages = new _hx_array(array());
     $_g = 0;
     while ($_g < $files->length) {
         $it = $files[$_g];
         ++$_g;
         if (StringTools::endsWith($it, ".jpg") === true) {
             $validimages->push($it);
         } else {
             if (StringTools::endsWith($it, ".png") === true) {
                 $validimages->push($it);
             } else {
                 if (StringTools::endsWith($it, ".gif") === true) {
                     $validimages->push($it);
                 }
             }
         }
         unset($it);
     }
     php_Lib::println(haxe_Json::stringify($validimages, null));
 }
Example #6
0
 static function dump($d)
 {
     if (!S::$headerSent) {
         header("Content-Type" . ": " . "application/json");
         S::$headerSent = true;
     }
     php_Lib::println(haxe_Json::phpJsonEncode($d, null, null));
 }