Ejemplo n.º 1
0
 function toRooArray()
 {
     $ret = $this->toArray();
     // update return the code.!!!
     if (isset($_SERVER["REQUEST_METHOD"]) && $_SERVER["REQUEST_METHOD"] == 'POST') {
         require_once 'Pman/Builder/Code.php';
         $x = new Pman_Builder_Code();
         $ret['code'] = $x->toJSFile(json_decode($this->json), $this->json);
     }
     return $ret;
 }
Ejemplo n.º 2
0
 function writeCopy($path, $roo)
 {
     die("needs fixing");
     if (!file_exists($path)) {
         return;
     }
     require_once 'Pman/Builder/Code.php';
     $x = new Pman_Builder_Code();
     $this->_new_file = false;
     if (!file_exists($path . '/' . $this->module . '.js')) {
         $this->_new_file = true;
     }
     if (!$this->_new_file && !is_writable($path . '/' . $this->module . '.js')) {
         $roo->jerr("Can not write to " . $path . '/' . $this->module . '.js');
         return;
     }
     if ($this->_new_file && !is_writable($path)) {
         $roo->jerr("Can not write to " . $path);
         return;
     }
     file_put_contents($path . '/' . $this->module . '.js', $x->toJSFile(json_decode($this->json)));
     return $path . '/' . $this->module . '.js';
 }