protected function output_as_xml($res) { $data = array(); if (isset($_GET['parent'])) { $data["parent"] = $this->render->level_id($_GET[$this->parent_name], $this->render->get_level() - 1); } else { $data["parent"] = "0"; } $data["data"] = $this->render_set($res); $out = new OutputWriter(json_encode($data), ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output_as_xml($res) { $result = $this->render_set($res); if ($this->simple) { return $result; } $data = $this->xml_start() . json_encode($result) . $this->xml_end(); if ($this->as_string) { return $data; } $out = new OutputWriter($data, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output_as_xml($res) { $result = $this->render_set($res); if ($this->simple) { return $result; } $data = array(); $data["parent"] = $this->request->get_relation(); $data["data"] = $result; $data = json_encode($data); // return as string if ($this->as_string) { return $data; } // output direct to response $out = new OutputWriter($data, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output($res) { $out = new OutputWriter($res, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output_as_xml($res) { $start = "[\n"; $end = substr($this->render_set($res), 0, -2) . "\n]"; $out = new OutputWriter($start, $end); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output_as_xml($res) { $result = $this->render_set($res); if ($this->simple) { return $result; } $data = array(); if (!$this->rootId || $this->rootId != $this->request->get_relation()) { $data["parent"] = $this->request->get_relation(); } $data["data"] = $result; $this->fill_collections(); if (!empty($this->options)) { $data["collections"] = $this->options; } foreach ($this->attributes as $k => $v) { $data[$k] = $v; } $data = json_encode($data); // return as string if ($this->as_string) { return $data; } // output direct to response $out = new OutputWriter($data, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output_as_xml($res) { $data = array(); $data["parent"] = $this->request->get_relation(); $data["data"] = $this->render_set($res); $out = new OutputWriter(json_encode($data), ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }
protected function output_as_xml($res) { $data = $this->xml_start(); $data .= $this->render_set($res); $data .= $this->xml_end(); $out = new OutputWriter($data, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); }