public function display()
 {
     $manialink = $this->request->createLink('/rent/');
     $ui = new \ManiaLib\Gui\Cards\Navigation\Menu();
     $ui->title->setText(\ManiaHost\Config::getInstance()->appName);
     $ui->quitButton->setManialink($manialink);
     $ui->subTitle->setText('Admin panel');
     $manialink = $this->request->createLink('/admin/');
     $ui->addItem();
     $ui->lastItem->text->setText('Incomes');
     $ui->lastItem->icon->setSubStyle(Icons128x128_1::Coppers);
     $ui->lastItem->setManialink($manialink);
     $ui->addItem();
     $ui->lastItem->text->setText('Servers Audience');
     $ui->lastItem->icon->setSubStyle(Icons128x128_1::Statistics);
     $ui->lastItem->setSelected();
     $ui->save();
     Manialink::beginFrame(32, 40);
     $ui = new Panel(100, 90);
     $ui->setHalign('center');
     +$ui->title->setText('Server list');
     $ui->save();
     $ui = new Label(100);
     $ui->setHalign('center');
     $ui->setPosition(0, -23, 0.1);
     $ui->setStyle(Label::TextTips);
     $ui->setText('Choose a server');
     $ui->save();
     $layout = new \ManiaLib\Gui\Layouts\VerticalFlow(30, 50);
     Manialink::beginFrame(-40, -30, 0.1, 1, $layout);
     foreach ($this->response->servers as $server) {
         $this->request->set('serverLogin', $server);
         $manialink = $this->request->createLink('../server-audience/');
         $this->request->restore('serverLogin');
         $ui = new Label(30, 7);
         $ui->setText($server);
         $ui->setStyle(Label::TextCardMedium);
         $ui->setManialink($manialink);
         $ui->save();
     }
     Manialink::endFrame();
     $ui = $this->response->multipage;
     $ui->pageNavigator->setPosition(0, -85, 0.1);
     $ui->savePageNavigator();
     Manialink::endFrame();
 }
示例#2
0
文件: Error.php 项目: kremsy/manialib
 function display()
 {
     Manialink::load();
     $ui = new Panel($this->width, $this->height);
     $ui->setAlign('center', 'center');
     $ui->title->setStyle(Label::TextTitleError);
     $ui->titleBg->setSubStyle(Bgs1::BgTitle2);
     $ui->title->setText('Error');
     $ui->save();
     $ui = new Label($this->width - 4);
     $ui->enableAutonewline();
     $ui->setAlign('center', 'center');
     $ui->setPosition(0, -5, 1);
     $ui->setText($this->message);
     $ui->save();
     $ui = new Button();
     $ui->setText($this->response->errorButtonMessage ?: 'Back');
     $ui->setManiazone($this->response->errorManialink ?: $this->response->backLink);
     $ui->setPosition(0, -($this->height / 2) + 12, 1);
     $ui->setHalign('center');
     $ui->save();
     Manialink::render();
 }