/** * @see ApplicationView::createUserInterface() */ protected function createUserInterface() { parent::createUserInterface(); //Recupera o título da página de erro $title = Application::getInstance()->getBundle()->getString('ERROR_TITLE'); //Define o título da página $this->setTitle($title); //Adiciona as informações sobre o erro $this->contentPanel->addChild(new Heading(2))->addChild(new Text($title)); $this->contentPanel->addChild(new Paragraph())->addChild(new Text($this->errorMessage)); }
/** * @see ApplicationView::createUserInterface() */ protected function createUserInterface() { parent::createUserInterface(); $this->addStyle('/css/home.css'); $resourceBundle = Application::getInstance()->getBundle(); $products = $this->products->getProducts(); if (count($products) == 0) { $this->contentPanel->addChild(new Heading(2))->addChild(new Text($resourceBundle->getString('NO_PRODUCT'))); } else { $this->contentPanel->addChild(new ProductList())->setProductList($products); } }
/** * @see ApplicationView::createUserInterface() */ protected function createUserInterface() { parent::createUserInterface(); $this->addStyle('/css/cart.css'); $resourceBundle = Application::getInstance()->getBundle(); $products = $this->cart->getProducts(); if (count($products) == 0) { $this->contentPanel->addChild(new Heading(2))->addChild(new Text($resourceBundle->getString('CART_NO_PRODUCT'))); } else { $this->contentPanel->addChild(new CartList())->setProductList($products); $totalParagraph = $this->contentPanel->addChild(new Paragraph())->addStyle('cart-total'); //Total do carrinho $totalParagraph->addChild(new Strong())->addChild(new Text($resourceBundle->getString('CART_TOTAL'))); $totalParagraph->addChild(new Span())->addChild(new Text(money_format($resourceBundle->getString('MONEY_FORMAT'), $this->cart->getTotal()))); //Botão de checkout $totalParagraph->addChild(new Anchor('/?c=cart&a=checkout'))->addStyle('checkout')->addChild(new Text($resourceBundle->getString('CART_CHECKOUT'))); } }