3 class UserView
extends AOOSModule
{
4 static public function dependencies() {
5 return array("Paginator", "Form", "Reciever");
8 public function add() {
9 $f = $this->core()->getModule("Form")->getWidget("Form");
10 $r = $this->core()->getModule("Reciever");
11 if ($row = $r->getRow("POST")) {
12 $this->parent()->createUser($row);
14 $f->setFields(array("username", "password", "email"));
15 $f->setModel($this->parent()->dataModel("USER"));
19 public function edit() {
20 if (!$this->parent()->online()) {
23 $f = $this->core()->getModule("Form")->getWidget("Form");
24 $r = $this->core()->getModule("Reciever");
25 if ($row = $r->getRow("POST")) {
26 $this->parent()->updateUser($row);
28 $f->setModel($this->parent()->dataModel("USER"));
32 public function show() {
33 $r = $this->core()->getModule("Reciever");
34 if ($row = $r->getRow("POST")) {
35 $this->parent()->login($row);
37 if (!$this->parent()->online()) {
38 $f = $this->core()->getModule("Form")->getWidget("Form");
39 $f->setFields(array("username", "password"));
40 $f->setModel($this->parent()->dataModel("USER"));
43 return "Hi ".$this->parent()->userInfo()->username
;