public function onBeforeRender() { $this->add(new \Meta\Field\Hidden(array('name' => 'id'))); $this->add(new \Meta\Field\Text(array('name' => 'name', 'label' => 'Name', 'isRequired' => true))); $this->add(new \Meta\Field\Email(array('name' => 'mail', 'label' => 'E-mail', 'isRequired' => true))); $this->add(new \Meta\Field\Password(array('name' => 'password_new', 'label' => 'Password'))); $this->add(new \Meta\Field\Image(array('name' => 'picture', 'label' => 'Picture'))); $this->add(new \Meta\Field\ButtonSave()); $this->add(new \Meta\Field\ButtonCancel()); if (!$this->hasSubmitted()) { $uid = \User\User::logged()->id; $this->setData(Db::loadRecord('users', $uid)->fetch()); } }
public function getEditRecord() { return Db::loadRecord($this->table, $this->getRecordId())->fetch(); }