diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-14 18:16:13 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-14 18:16:13 +0000 |
commit | bd1ec2df1fbd0a642b7f981742558b2ee4f8b5ff (patch) | |
tree | 437882c2bb3c64b7bd303e3487aff855d239f7be /modules/user/controllers/user.php | |
parent | d7745f2ad871b8e5ac29428f74344dcb41f93b6d (diff) |
The state of of the user registration functionality
Diffstat (limited to 'modules/user/controllers/user.php')
-rw-r--r-- | modules/user/controllers/user.php | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/modules/user/controllers/user.php b/modules/user/controllers/user.php index b2160cda..41cb9da5 100644 --- a/modules/user/controllers/user.php +++ b/modules/user/controllers/user.php @@ -24,14 +24,21 @@ class User_Controller extends REST_Controller { * @see Rest_Controller::_get($resource) */ public function _get($user) { - $template = new View("user_registration.html"); - - // @todo: this needs to be data-driven - $theme = new Theme("default", $template); - - $template->set_global('user', Session::instance()->get('user', null)); - - print $template->render(); + $userView = new View("user.html"); + if (empty($user)) { + // @todo remove this when rest_controller is changed to handle a post with no id + $user = ORM::factory("user"); + $user->save(); + // @todo remove this when rest_controller is changed to handle a post with no id ^ + $userView->user_id = $user->id; + $userView->action = _("User Registration"); + $userView->button_text = _("Register"); + } else { + $userView->user_id = $user->id; + $userView->action = _("User Modify"); + $userView->button_text = _("Modify"); + } + print $userView; } /** |