CheckSyntax code cleanup
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jun 2009 09:35:07 +0000 (11:35 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jun 2009 09:35:07 +0000 (11:35 +0200)
web/js/communication.js
web/php/Plant.php
web/php/page/editplant.pg

index fffafa5..2b29ff7 100644 (file)
@@ -574,11 +574,7 @@ Lseed.Editor = function() {
        this.TestCallback = function() {
        };
        
-       this.CheckSyntax = function(plant, callback) {
-               if (typeof callback != 'undefined' && callback != null) {
-                       this.CheckSyntaxCallback = callback;
-               }
-               
+       this.CheckSyntax = function(plant) {
                communication.sendMessage(Lseed.MessageCommands.RPC, { 
                        func: 'CheckSyntax'
                        ,plant: plant.data.Name
index 3594e4a..0449c08 100644 (file)
@@ -73,7 +73,7 @@
                }
                
                public function Validate() {
-                       $arr =  $this->ValidateCode();
+                       $arr = $this->ValidateCode();
                        return $arr[1];
                }
 
                                $return_value = proc_close($process);
                                
                                //echo $return_value;
-                               if ($return_value == 0) {
-                                       $result = $output;
-                                       $result_ok = 1;
-                               }
+                               $result = $output;
+                               $result_ok = 1;
                        }
 
                        return array($result_ok, $result);
index 4c9f0d7..c70d490 100644 (file)
@@ -39,7 +39,7 @@
                        if (pdEditor && pnEditor) {
                                var name = pnEditor.getValue();
                                var code = pdEditor.getValue();
-                               editor.CheckSyntax({data:{Code:code, Name:name}}, editor.HandleSyntaxCheckAnswerForEditor); 
+                               editor.CheckSyntax({data:{Code:code, Name:name}}); 
                        } else {
                                console.error("Lseed.Editor.CheckSyntaxCallback_Callback: 'plantdefinitioneditor' Could not be found.");
                        }