function render($data) { if ($this->get('edit')) { $this->body->set('headline', 'Edit user profile'); $this->body->set('action', 'base.usersEdit'); $this->body->set('edit', true); } else { $this->body->set('headline', 'Add a new user profile'); $this->body->set('action', 'base.usersAdd'); } //page title $this->t->set('page_title', 'User Profile'); $this->body->set_template('users_addoredit.tpl'); $this->body->set('roles', owa_coreAPI::getAllRoles()); $this->body->set('user', $this->get('profile')); }
function render($data) { $user = $this->get('profile'); $this->body->set('isAdmin', false); if ($this->get('edit')) { $this->body->set('headline', 'Edit user profile'); $this->body->set('action', 'base.usersEdit'); $this->body->set('edit', true); $userEntity = owa_coreAPI::entityFactory('base.user'); $userEntity->load($user['id']); $this->body->set('isAdmin', $userEntity->isOWAAdmin()); } else { $this->body->set('headline', 'Add a new user profile'); $this->body->set('action', 'base.usersAdd'); $this->body->set('edit', false); } //page title $this->t->set('page_title', 'User Profile'); $this->body->set_template('users_addoredit.tpl'); $this->body->set('roles', owa_coreAPI::getAllRoles()); $this->body->set('user', $user); }