public function __construct() { $this->frame = new GtkFrame(); $frameBox = new GtkVBox(false, 10); $frameBox->set_border_width(10); $titleBox = new GtkHBox(false, 10); $titleLabel = new GtkLabel("User Profile"); $titleLabel->set_markup("<span weight='bold'>User Profile</span>"); $titleLabel->set_alignment(0, 0.5); $this->statusLabel = new GtkLabel(""); $this->statusLabel->set_alignment(1, 0.5); $titleBox->pack_start($titleLabel, true, true, 0); $titleBox->pack_end($this->statusLabel, true, true, 0); $frameBox->pack_start($titleBox, false, false, 0); $this->frame->add($frameBox); $this->userFormTable = new GtkTable(3, 7); list($labelFname, $this->entryFname) = $this->createLabelText('First Name', true); list($labelLname, $this->entryLname) = $this->createLabelText('Last Name', true); list($labelEmail, $this->entryEmail) = $this->createLabelText('Email', true); list($labelUsername, $this->entryUsername) = $this->createLabelText('Username', true); list($labelPassword, $this->entryPassword) = $this->createLabelText('Password', false); list($labelConfirm, $this->entryConfirm) = $this->createLabelText('Confirm Password', false); $this->deptComboStore = new GtkRefListStore(Gobject::TYPE_STRING); $this->deptComboStore->refInsert(DeptEnum::getList()); $this->comboDept = new GtkRefComboBox($this->deptComboStore); $cellDept = new GtkCellRendererText(); $cellDept->set_property('ellipsize', Pango::ELLIPSIZE_END); $this->comboDept->pack_start($cellDept); $this->comboDept->set_attributes($cellDept, 'text', 0); $labelDept = new GtkLabel('Department'); $labelDept->set_alignment(1, 0.5); $this->attachLabelText($labelFname, $this->entryFname, false, 0); $this->attachLabelText($labelLname, $this->entryLname, false, 1); $this->attachLabelText($labelEmail, $this->entryEmail, false, 2); $this->attachLabelText($labelUsername, $this->entryUsername, true, 3); $this->attachLabelText($labelPassword, $this->entryPassword, true, 4); $this->attachLabelText($labelConfirm, $this->entryConfirm, true, 5); $this->attachLabelText($labelDept, $this->comboDept, true, 6); $this->entryUsername->connect('key-release-event', array($this, 'enableSubmit')); $this->entryPassword->connect('key-release-event', array($this, 'enableSubmit')); $this->entryConfirm->connect('key-release-event', array($this, 'enableSubmit')); $this->comboDept->connect('changed', array($this, 'enableSubmit')); $subFrame = new GtkFrame(); $subFrameBox = new GtkVBox(false, 0); $subFrameBox->set_border_width(12); $subFrame->add($subFrameBox); $subFrameBox->pack_start($this->userFormTable, false, false, 0); $frameBox->pack_start($subFrame, false, false, 0); $buttonBox = new GtkHBox(false, 8); $this->submitButton = new GtkButton($this->mode == self::MODE_ADD ? 'Add User' : 'Update Profile'); $this->submitButton->connect('clicked', array($this, 'submit')); $this->cancelButton = new GtkButton("Cancel"); $buttonBox->pack_end($this->cancelButton, false, false, 0); $buttonBox->pack_end($this->submitButton, false, false, 0); $frameBox->pack_end($buttonBox, true, true, 0); $this->enableForm(false); }
private function getUserStoreArray(UserVO $user) { return array($user->username, $user->fname, $user->lname, $user->email, DeptEnum::getValue($user->department)); }