public function __construct($ttype) { $this->setSize(80, 1); $this->setId('mainMenu'); $this->setTType($ttype); $textArea = new TSTextArea(3, 1, 6, 1); $textArea->setId('admins'); $textArea->setOptions(TS_OPT_ISSELECTABLE | TS_OPT_ISSELECTED); $textArea->setText(VT100_STYLE_BOLD . 'A' . VT100_STYLE_RESET . 'dmins'); $this->add($textArea); $textArea = new TSTextArea(16, 0, 5, 1); $textArea->setId('hosts'); $textArea->setOptions(TS_OPT_ISSELECTABLE); $textArea->setText(VT100_STYLE_BOLD . 'H' . VT100_STYLE_RESET . 'osts'); $this->add($textArea); $textArea = new TSTextArea(26, 0, 7, 1); $textArea->setId('plugins'); $textArea->setOptions(TS_OPT_ISSELECTABLE); $textArea->setText(VT100_STYLE_BOLD . 'P' . VT100_STYLE_RESET . 'lugins'); $this->add($textArea); $l = strlen('Prism v' . PHPInSimMod::VERSION); $textArea = new TSTextArea(80 - ($l + 1), 0, $l, 1); $textArea->setId('prismVersion'); $textArea->setText(VT100_STYLE_GREEN . VT100_STYLE_BOLD . 'Prism v' . PHPInSimMod::VERSION . VT100_STYLE_RESET); $this->add($textArea); $line = new TSHLine(2, 2, $this->getWidth() - 2); $line->setTType($this->getTType()); $this->add($line); }
private function createAdminContent() { if ($this->actionType == TS_AACTION_ADD) { // New username $textArea = new TSTextInput(30, 5, 30, 3); $textArea->setId('adminUsername'); $textArea->setTType($this->getTType()); $textArea->setMaxLength(23); $textArea->setText(''); $textArea->setOptions(TS_OPT_ISSELECTABLE | TS_OPT_ISEDITABLE); $textArea->setBorder(TS_BORDER_REGULAR); $textArea->setCaption('LFS Username (exact match)'); $this->add($textArea); // New password $textArea = new TSTextInput(30, 9, 30, 3); $textArea->setId('adminPassword'); $textArea->setTType($this->getTType()); $textArea->setMaxLength(23); $textArea->setText(''); $textArea->setOptions(TS_OPT_ISSELECTABLE | TS_OPT_ISEDITABLE); $textArea->setBorder(TS_BORDER_REGULAR); $textArea->setCaption('Prism Password'); $this->add($textArea); // Admin flags $textArea = new TSTextInput(30, 13, 30, 3); $textArea->setId('adminFlags'); $textArea->setTType($this->getTType()); $textArea->setMaxLength(26); $textArea->setText('abcdetc'); $textArea->setOptions(TS_OPT_ISSELECTABLE | TS_OPT_ISEDITABLE); $textArea->setBorder(TS_BORDER_REGULAR); $textArea->setCaption('Permission flags'); $this->add($textArea); // Save $textArea = new TSTextArea(30, 17, 12, 3); $textArea->setId('adminSave'); $textArea->setTType($this->getTType()); $textArea->setText('Save admin'); $textArea->setOptions(TS_OPT_ISSELECTABLE); $textArea->setBorder(TS_BORDER_REGULAR); $this->add($textArea); } else { // New password $textArea = new TSTextInput(30, 5, 30, 3); $textArea->setId('adminPassword'); $textArea->setTType($this->getTType()); $textArea->setText(''); $textArea->setOptions(TS_OPT_ISSELECTABLE | TS_OPT_ISEDITABLE); $textArea->setBorder(TS_BORDER_REGULAR); $textArea->setCaption('Prism Password'); $this->add($textArea); // Admin flags $textArea = new TSTextInput(30, 9, 30, 3); $textArea->setId('adminFlags'); $textArea->setTType($this->getTType()); $textArea->setText(flagsToString($this->userDetails['accessFlags'])); $textArea->setOptions(TS_OPT_ISSELECTABLE | TS_OPT_ISEDITABLE); $textArea->setBorder(TS_BORDER_REGULAR); $textArea->setCaption('Permission flags'); $this->add($textArea); // Save $textArea = new TSTextArea(30, 13, 12, 3); $textArea->setId('adminSave'); $textArea->setTType($this->getTType()); $textArea->setText('Save admin'); $textArea->setOptions(TS_OPT_ISSELECTABLE); $textArea->setBorder(TS_BORDER_REGULAR); $this->add($textArea); // Delete $textArea = new TSTextArea(30, 17, 14, 3); $textArea->setId('adminDelete'); $textArea->setTType($this->getTType()); $textArea->setText('Delete admin'); $textArea->setOptions(TS_OPT_ISSELECTABLE); $textArea->setBorder(TS_BORDER_REGULAR); $this->add($textArea); } }