コード例 #1
0
    if ($mime == "application/xml") {
        require dirname(__FILE__) . "/validators/validator_xml.php";
        $a = ValidateCode($filefullpath);
    } else {
        if ($mime == "text/html") {
            require dirname(__FILE__) . "/validators/validator_html.php";
            $a = ValidateCode($filefullpath);
        } else {
            $a = array("msg" => "Tipo de fichero no reconocido");
        }
    }
}
$msgbox = new jsO("msgbox", "parent", false);
if (is_array($a)) {
    $msgbox->jsO->value = "{$a["msg"]} {$a["line"]}";
    $editor = new jsO("editor", "parent", true);
    if ($a["line"]) {
        $editor->setMethod("jumpToLine", array($a["line"]));
    }
    $editor->jsMapO();
    $editor->jsMapM();
} else {
    $msgbox->jsO->value = "{$mime} : Syntaxis OK";
}
$msgbox->jsMapO();
$msgbox->jsMapM();
jsCodeFlush();
?>


コード例 #2
0
<?php

require dirname(__FILE__) . "/controller_base_js.php";
$data = file_get_contents(dirname(__FILE__) . "/../" . trim($file));
$e = new jsO("editor", "parent", true);
$e->setMethod("setCode", array("{$data}"));
if (substr($file, -3) == ".js") {
    $e->setMethod("setParser", array("JSParser" => "string"));
    $parser = "(JS parser)";
}
if (substr($file, -4) == ".xml" || substr($file, -4) == ".def") {
    $e->setMethod("setParser", array("XMLParser" => "string"));
    $parser = "(XML parser)";
}
$e->setMethod("reindent");
//$e->setMethod("grabKeys",array("docSave"=>"string","parent.filterSave"=>"literal"));
$e->jsMapO();
$e->jsMapM();
$textarea = new jsO("msgbox", "parent", false);
$textarea->jsO->value = "{$file} abierto. {$parser}";
$textarea->jsMapO();
$textarea->jsMapM();
jsCodeFlush();
?>