protected function getContent() { // Prepara formulário de pesquisa $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['page'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => 1]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.product')]]; $dataArr['btnSearch'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.search'), "class" => "primary", "icon" => "glyphicon-search"]]; $form = new Form("mySearch"); $form->setHorizontal(); $searchForm = $form->createForm($dataArr); ob_start(); ?> <div class="container"> <div class="row"> <a id="toogleFilter" class="pull-right" data-toggle="collapse" data-target="#collapseFilter" href="#"> <span class="text">Exibir Filtros </span><span class="glyphicon glyphicon-menu-down"></span> </a> <div id="collapseFilter" class="panel-body panel-collapse collapse"> <?php echo $searchForm; ?> </div> </div> </div> <div id="resultPanel" class="panel-body table-responsive"> <?php echo $this->result; ?> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formul‡rio $form = new Form("myDetail"); $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.name'), "length" => 100]]; $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.email'), "length" => 50]]; $dataArr['message'] = ["type" => Config::read('form.textarea'), "data" => (object) ["text" => Text::read('form.message')]]; $dataArr['btnSend'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.send'), "class" => "success btn-lg"]]; $messageForm = $form->createForm($dataArr); unset($dataArr); ob_start(); ?> <div class="container"> <div class="row cadastro"> <div class="col-md-4 col-md-offset-4"> <?php echo $messageForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.name'), "length" => 50]]; $dataArr['surname'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.surname'), "length" => 50]]; $dataArr['sex'] = ["type" => Config::read('form.radio'), "data" => (object) ["text" => Text::read('form.sex'), "value" => [(object) ["id" => 1, "text" => Text::read('form.man')], (object) ["id" => 2, "text" => Text::read('form.woman')]], "checked" => 1]]; $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.email'), "length" => 50]]; $dataArr['password'] = ["type" => Config::read('form.password'), "data" => (object) ["text" => Text::read('form.password'), "length" => 20]]; $dataArr['news'] = ["type" => Config::read('form.checkbox'), "data" => (object) ["text" => Text::read('form.newsletter'), "checked" => true]]; $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success btn-lg"]]; $accountForm = $form->createForm($dataArr); unset($dataArr); ob_start(); ?> <div class="container"> <div class="row cadastro"> <div class="col-md-4 col-md-offset-4"> <?php echo $accountForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Prepara o formulário de login $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['type'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => 1]]; $dataArr['user'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $_POST['user'], "text" => Text::read('form.user')]]; $dataArr['password'] = ["type" => Config::read('form.password'), "data" => (object) ["value" => $_POST['password'], "text" => Text::read('form.password')]]; $dataArr['btnLogin'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.login'), "class" => "default"]]; $form = new Form("myLogin"); $form->setHorizontal(); $loginForm = $form->createForm($dataArr); return '<div class="jumbotron">' . $loginForm . '</div>'; }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['title'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->title, "text" => Text::read('form.title'), "length" => 100]]; $detailForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.detail'); ?> </legend> <?php echo $detailForm; ?> </fieldset> <fieldset> <legend><span class="glyphicon glyphicon-camera"></span> <?php echo Text::read('form.photo'); ?> </legend> <?php echo $this->photoView->getContent(); ?> </fieldset> <br /> <?php $globalForm = ob_get_clean(); $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success", "icon" => "glyphicon-floppy-disk"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <div class="panel panel-primary"> <div class="panel-body"> <?php echo $detailForm; ?> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Prepara formulário de pesquisa $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['page'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => 1]]; $form = new Form("mySearch"); $searchForm = $form->createForm($dataArr); ob_start(); ?> <?php echo $searchForm; ?> <div id="resultPanel"> <?php echo $this->result; ?> </div> <?php return ob_get_clean(); }
protected function getContent() { // Prepara formulário de pesquisa $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['page'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => 1]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.name')]]; $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.email')]]; $dataArr['blocked'] = ["type" => Config::read('form.checkbox'), "data" => (object) ["value" => true, "text" => Text::read('form.only.blocked')]]; $dataArr['btnSearch'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.search'), "class" => "primary", "icon" => "glyphicon-search"]]; $form = new Form("mySearch"); $searchForm = $form->createForm($dataArr); ob_start(); ?> <div class="panel panel-primary"> <div class="panel-heading"> <div class="panel-title"> <a id="toogleFilter" class="pull-right" data-toggle="collapse" data-target="#collapseFilter" href="#"> <span class="text"></span><span class="glyphicon glyphicon-menu-right"></span> </a> </div> </div> <div id="collapseFilter" class="panel-body panel-collapse collapse in"> <?php echo $searchForm; ?> </div> </div> <div class="panel panel-primary"> <div id="resultPanel" class="panel-body table-responsive"> <h4><?php echo Text::read('table.empty'); ?> </h4> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->email, "text" => Text::read('form.email'), "length" => 40]]; $dataArr['btnConf'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.confirm'), "class" => "success btn-lg"]]; $passwordForm = $form->createForm($dataArr); unset($dataArr); ob_start(); ?> <div class="container"> <div class="row cadastro"> <div class="col-md-4 col-md-offset-4"> <?php echo $passwordForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); if (!$this->data->status) { $this->data->statusText = Text::read('product.status')['new']; } // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $productForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['shipping'] = ["type" => Config::read('form.radio'), "data" => (object) ["value" => Config::read('combo.shipping'), "text" => Text::read('form.shipping'), "checked" => 1]]; $shippingForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.product'); ?> </legend> <div class="row"> <div class="col-md-4 text-center"> <?php if ($this->data->photos[0]) { ?> <img style="width:200px;" src="<?php echo Config::read('url.photos') . '/' . $this->data->album . '/small-' . $this->data->photos[0]->url; ?> " draggable="false"> <?php } ?> </div> <div class="col-md-6"> <h4><?php echo $this->data->name; ?> </h4> <p><?php echo $this->data->text; ?> </p> </div> </div> </fieldset> <br /> <?php echo $productForm; ?> <fieldset> <legend><span class="glyphicon glyphicon-home"></span> <?php echo Text::read('form.shipping.address'); ?> </legend> <div id="addressCard" class="col-md-6"> <?php echo OrderDetailView::prepareAddressCard($this->data); ?> </div> <div class="col-md-6"> <a id="newAddress" class="btn btn-lg btn-info pull-right" href="#">+ Novo endereço de entrega</a> </div> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-piggy-bank"></span> <?php echo Text::read('form.price'); ?> </legend> <div class="col-md-4"> <?php echo $shippingForm; ?> </div> <div class="col-md-4"> <div class="row"> <div class="col-md-6"><b>Valor:</b></div> <div class="col-md-6">R$ <?php echo $this->data->price; ?> </div> </div> <div class="row"> <div class="col-md-6"><b>(-) Desconto:</b></div> <div class="col-md-6">R$ <?php echo $this->data->discount; ?> </div> </div> <div class="row"> <div class="col-md-6"><b>(+) Frete:</b></div> <div class="col-md-6">R$ 0,00</div> </div> <p>________________________________</p> <div class="row"> <div class="col-md-6"><b>TOTAL:</b></div> <div class="col-md-6">R$ <?php echo $this->data->price - $this->data->discount; ?> </div> </div> </div> </fieldset> <br /> <?php $globalForm = ob_get_clean(); $dataArr['btnPay'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success btn-lg", "icon" => "glyphicon-floppy-disk"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <!-- STATUS //--> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="stepwizard"> <div class="stepwizard-row setup-panel"> <div class="stepwizard-step"> <a href="#step-1" type="button" class="btn btn-primary btn-circle">1</a> <p>Dados de Entrega</p> </div> <div class="stepwizard-step"> <a href="#step-2" type="button" class="btn btn-default btn-circle" disabled="disabled">2</a> <p>Pagamento</p> </div> <div class="stepwizard-step"> <a href="#step-3" type="button" class="btn btn-default btn-circle" disabled="disabled">3</a> <p>Conclusão do Pedido</p> </div> </div> </div> </div> </div> <div class="container"> <div class="row cadastro"> <div class="col-md-8 col-md-offset-2"> <?php echo $detailForm; ?> </div> </div> </div> <!-- MODAL //--> <div class="modal fade" id="myShippingAddressModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4><?php echo Text::read('form.shipping.address'); ?> </h4> </div> <div class="modal-body"> <form id="myShippingAddress" method="POST" action="<?php echo Config::read('page.url.order.shipping.address'); ?> " class="form"> <?php echo $this->addressView->getContent(); ?> </form> </div> <div class="modal-footer"> <button type="button" id="sendShippingAddress" class="btn btn-primary"><?php echo Text::read('form.save'); ?> </button> </div> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.order'), "value" => $this->data->id, "disabled" => "true"]]; $orderForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <div class="col-md-6 col-md-offset-3"> <?php echo $orderForm; ?> </div> </fieldset> <?php $globalForm = ob_get_clean(); $dataArr['btnPay'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.pagseguro'), "class" => "success btn-lg", "icon" => "glyphicon-money"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <!-- STATUS //--> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="stepwizard"> <div class="stepwizard-row setup-panel"> <div class="stepwizard-step"> <a href="#step-1" type="button" class="btn btn-primary btn-circle">1</a> <p>Dados de Entrega</p> </div> <div class="stepwizard-step"> <a href="#step-2" type="button" class="btn btn-primary btn-circle">2</a> <p>Pagamento</p> </div> <div class="stepwizard-step"> <a href="#step-3" type="button" class="btn btn-default btn-circle" disabled="disabled">3</a> <p>Conclusão do Pedido</p> </div> </div> </div> </div> </div> <div class="container"> <div class="row cadastro"> <div class="col-md-8 col-md-offset-2"> <?php echo $detailForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; // Verifica cenários baseado no status e responsável if ($_SESSION['webLogin']) { switch ($_SESSION['webLogin']->getUserID()) { case $this->data->buyer: // Comprador if ($this->data->status == Config::read('order.status')['sent']) { $dataArr['status'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => Config::read('order.status')['received']]]; $dataArr['tracking'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.tracking'), "value" => $this->data->tracking, "disabled" => true]]; $dataArr['btnStat'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('order.status')['received'], "class" => "success btn-lg", "icon" => "glyphicon-envelope"]]; } break; case $this->data->vendor: // Vendedor if ($this->data->status == Config::read('order.status')['paid'] || $this->data->status == Config::read('order.status')['sent']) { $dataArr['status'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => Config::read('order.status')['sent']]]; $dataArr['tracking'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.tracking'), "value" => $this->data->tracking, "length" => 13]]; $dataArr['btnStat'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('order.status')['sent'], "class" => "success btn-lg", "icon" => "glyphicon-send"]]; } break; } } $detailForm = $form->createForm($dataArr); unset($dataArr); ob_start(); ?> <!-- STATUS //--> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="stepwizard"> <div class="stepwizard-row setup-panel"> <?php foreach (Config::read('order.status') as $key => $status) { $i++; ?> <div class="stepwizard-step"> <a href="#step-<?php echo $i; ?> " type="button" class="btn btn-<?php echo !$disabled ? Config::read('order.status.state')[$key] : "default"; ?> btn-circle" <?php echo $disabled; ?> ><?php echo $i; ?> </a> <?php if ($disabled) { ?> <p><?php echo Text::read('order.status')[$key]; ?> </p> <?php } else { ?> <b><p><?php echo Text::read('order.status')[$key]; ?> </p></b> <?php } ?> </div> <?php // Desabilita status superiores if ($this->data->status == $status) { $disabled = 'disabled="disabled"'; } } ?> </div> </div> </div> </div> <div class="container"> <div class="row cadastro"> <div class="col-md-8 col-md-offset-2"> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.product'); ?> </legend> <div class="row"> <div class="col-md-4 text-center"> <?php if ($this->data->product->photos[0]) { ?> <img style="width:200px;" src="<?php echo Config::read('url.photos') . '/' . $this->data->product->album . '/small-' . $this->data->product->photos[0]->url; ?> " draggable="false"> <?php } ?> </div> <div class="col-md-6"> <h4><?php echo $this->data->product->name; ?> </h4> <p><?php echo $this->data->product->text; ?> </p> </div> </div> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.detail'); ?> </legend> <div class="col-md-6"> <?php echo OrderDetailView::prepareOrderCard($this->data); ?> </div> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-home"></span> <?php echo Text::read('form.shipping.address'); ?> </legend> <div class="col-md-6"> <?php echo OrderDetailView::prepareAddressCard($this->data); ?> </div> </fieldset> <br /> <?php echo $detailForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formul�rio $form = new Form("myDetail"); if (!$this->data->status) { $this->data->statusText = Text::read('product.status')['new']; } // Prepara formul�rio de inser��o/atualiza��o de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['status'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->status]]; $dataArr['statText'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->statusText, "text" => Text::read('form.status'), "disabled" => true]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->name, "text" => Text::read('form.name'), "length" => 100, "disabled" => $this->globalDisabled]]; $dataArr['text'] = ["type" => Config::read('form.textarea'), "data" => (object) ["value" => $this->data->text, "text" => Text::read('form.description'), "disabled" => $this->globalDisabled]]; $dataArr['type'] = ["type" => Config::read('form.dropdown'), "data" => (object) ["value" => $this->comboType, "text" => Text::read('form.type'), "selected" => $this->data->type, "disabled" => $this->globalDisabled]]; $dataArr['subtype'] = ["type" => Config::read('form.dropdown'), "data" => (object) ["value" => $this->comboSubType, "text" => Text::read('form.subtype'), "selected" => $this->data->subtype, "disabled" => $this->globalDisabled]]; $dataArr['brand'] = ["type" => Config::read('form.dropdown'), "data" => (object) ["value" => $this->comboBrand, "text" => Text::read('form.brand'), "selected" => $this->data->brand, "disabled" => $this->globalDisabled]]; $firstForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['price'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->price, "text" => Text::read('form.price'), "disabled" => $this->globalDisabled]]; $dataArr['discount'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->discount, "text" => Text::read('form.discount')]]; if ($_SESSION['webLogin'] && $_SESSION['webLogin']->getUserID()) { $dataArr['account'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $_SESSION['webLogin']->getUserID()]]; // $dataArr['accName'] = ["type" => Config::read('form.input'), // "data" => (object)["value" => $_SESSION['webLogin']->getUserName( ), // "text" => Text::read('form.createdBy'), // "disabled" => true]]; } $lastForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <?php echo $firstForm; ?> <fieldset> <legend><span class="glyphicon glyphicon-camera"></span> <?php echo Text::read('form.photo'); ?> </legend> <?php echo $this->photoView->getContent(); ?> </fieldset> <?php echo $lastForm; ?> <?php $globalForm = ob_get_clean(); $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success btn-lg", "icon" => "glyphicon-floppy-disk"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <div class="container"> <div class="row cadastro"> <div class="col-md-8 col-md-offset-2"> <?php echo $detailForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
$pos = strpos($solution, $first); while ($pos !== false) { $pos2 = strpos($solution, $second); if ($pos2 !== false) { $mathTex = substr($solution, $pos + strlen($first), $pos2 - $pos - strlen($first)); $replace = false; $replace = texify('$' . $mathTex . '$'); if ($replace === false) { $replace = '<img src="http://latex.codecogs.com/gif.latex?' . rawurlencode($mathTex) . '">'; } $solution = substr($solution, 0, $pos) . $replace . substr($solution, $pos2 + strlen($second)); } $pos = strpos($solution, $first, $pos + strlen($first) + strlen($second)); } $formId = isset($subexercise['formId']) ? $subexercise['formId'] : null; $form = Form::createForm($formId, $exerciseId, $solution, $task, isset($subexercise['type']) ? $subexercise['type'] : null); $choiceText = $subexercise['choice']; $choices = array(); foreach ($choiceText as $tempKey => $choiceData) { $choice = new Choice(); $choice->SetText($choiceData); $choices[$tempKey] = $choice; } if (isset($subexercise['correct'])) { $choiceCorrect = $subexercise['correct']; foreach ($choiceCorrect as $tempKey => $choiceData) { $keykey = $choiceData; if ($keykey == '') { $keykey = $tempKey; } if (isset($choices[$keykey])) {
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['full'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.name'), "value" => $this->data->name, "length" => 50]]; $dataArr['surname'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.surname'), "value" => $this->data->surname, "length" => 50]]; $dataArr['sex'] = ["type" => Config::read('form.radio'), "data" => (object) ["text" => Text::read('form.sex'), "value" => [(object) ["id" => 1, "text" => Text::read('form.man')], (object) ["id" => 2, "text" => Text::read('form.woman')]], "checked" => $this->data->sex]]; $dataArr['cpf'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.cpf'), "value" => $this->data->cpf, "length" => 14]]; $accountForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['phone'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.phone'), "value" => $this->data->phone, "length" => 20]]; $dataArr['cellphone'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.cellphone'), "value" => $this->data->cellphone, "length" => 20]]; $dataArr['news'] = ["type" => Config::read('form.checkbox'), "data" => (object) ["text" => Text::read('form.newsletter'), "checked" => $this->data->news]]; $contactForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.email'), "value" => $this->data->email, "disabled" => true]]; $dataArr['password'] = ["type" => Config::read('form.password'), "data" => (object) ["text" => Text::read('form.password'), "length" => 20]]; $securityForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-camera"></span> <?php echo Text::read('form.photo'); ?> </legend> <?php echo $this->photoView->getContent(); ?> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.personal'); ?> </legend> <?php echo $accountForm; ?> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-lock"></span> <?php echo Text::read('form.contact'); ?> </legend> <?php echo $contactForm; ?> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-home"></span> <?php echo Text::read('form.address'); ?> </legend> <?php echo $this->addressView->getContent(); ?> </fieldset> <br /> <fieldset> <legend><span class="glyphicon glyphicon-lock"></span> <?php echo Text::read('form.security'); ?> </legend> <?php echo $securityForm; ?> </fieldset> <?php $globalForm = ob_get_clean(); $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success btn-lg"]]; $accountForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <div class="container"> <div class="row cadastro"> <div class="col-md-8 col-md-offset-2"> <?php echo $accountForm; ?> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->name, "text" => Text::read('form.name'), "length" => 60]]; $detailForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->email, "text" => Text::read('form.email'), "length" => 40]]; $dataArr['password'] = ["type" => Config::read('form.password'), "data" => (object) ["value" => $this->data->password, "text" => Text::read('form.password'), "length" => 20, "help" => Text::read('form.password.help')]]; $securityForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['blocked'] = ["type" => Config::read('form.checkbox'), "data" => (object) ["value" => true, "text" => Text::read('form.block.user'), "checked" => $this->data->blocked]]; $accessForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.detail'); ?> </legend> <?php echo $detailForm; ?> </fieldset> <fieldset> <legend><span class="glyphicon glyphicon-lock"></span> <?php echo Text::read('form.security'); ?> </legend> <?php echo $securityForm; ?> </fieldset> <?php if ($controlAccess) { ?> <fieldset> <legend><span class="glyphicon glyphicon-wrench"></span> <?php echo Text::read('form.access'); ?> </legend> <?php echo $accessForm; ?> </fieldset> <?php } else { ?> <?php echo $accessForm; ?> <?php } $globalForm = ob_get_clean(); $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success", "icon" => "glyphicon-floppy-disk"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <div class="panel panel-primary"> <div class="panel-body"> <?php echo $detailForm; ?> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Verifica se usuário possui permissão para alterar o Controle de Acessos foreach ($_SESSION['admLogin']->getRoles() as $role) { if ($role->rolePageID == str_replace('.detail', '', $this->pageId)) { $controlAccess = true; break; } } // Inicializa assistente de formulário $form = new Form("myDetail"); // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->name, "text" => Text::read('form.name'), "length" => 60]]; $dataArr['email'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->email, "text" => Text::read('form.email'), "length" => 40]]; $detailForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['login'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->login, "text" => Text::read('form.user'), "length" => 20]]; $dataArr['password'] = ["type" => Config::read('form.password'), "data" => (object) ["value" => $this->data->password, "text" => Text::read('form.password'), "length" => 20, "help" => Text::read('form.password.help')]]; $securityForm = $form->createFormFields($dataArr); unset($dataArr); if ($controlAccess) { $dataArr['roles'] = ["type" => Config::read('form.combobox'), "data" => (object) ["value" => $this->comboRoles, "text" => Text::read('form.modules'), "checked" => $this->data->roles]]; $dataArr['blocked'] = ["type" => Config::read('form.checkbox'), "data" => (object) ["value" => true, "text" => Text::read('form.block.user'), "checked" => $this->data->blocked]]; } else { $dataArr['blocked'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => false]]; } $accessForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.detail'); ?> </legend> <?php echo $detailForm; ?> </fieldset> <fieldset> <legend><span class="glyphicon glyphicon-lock"></span> <?php echo Text::read('form.security'); ?> </legend> <?php echo $securityForm; ?> </fieldset> <?php if ($controlAccess) { ?> <fieldset> <legend><span class="glyphicon glyphicon-wrench"></span> <?php echo Text::read('form.access'); ?> </legend> <?php echo $accessForm; ?> </fieldset> <?php } else { ?> <?php echo $accessForm; ?> <?php } $globalForm = ob_get_clean(); $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success", "icon" => "glyphicon-floppy-disk"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <div class="panel panel-primary"> <div class="panel-body"> <?php echo $detailForm; ?> </div> </div> <?php return ob_get_clean(); }
/** * @expectedException \RuntimeException */ public function testGetFormGroupWithNoExistingGroupForm() { $this->_form->createForm('noExistingGroup-action'); MockTest::callMockMethod($this->_form, 'getFormGroup'); }
protected function getContent() { // Inicializa assistente de formul�rio $form = new Form("myDetail"); // Prepara formul�rio de inser��o/atualiza��o de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['status'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->statusText, "text" => Text::read('form.status'), "disabled" => true]]; $dataArr['name'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->name, "text" => Text::read('form.name'), "disabled" => true]]; $dataArr['text'] = ["type" => Config::read('form.textarea'), "data" => (object) ["value" => $this->data->text, "text" => Text::read('form.description'), "disabled" => true]]; $dataArr['type'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->type, "text" => Text::read('form.type'), "disabled" => true]]; $dataArr['subtype'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->subtype, "text" => Text::read('form.subtype'), "disabled" => true]]; $dataArr['brand'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->brand, "text" => Text::read('form.brand'), "disabled" => true]]; $detailForm = $form->createFormFields($dataArr); unset($dataArr); $dataArr['price'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->price, "text" => Text::read('form.price'), "disabled" => true]]; $dataArr['discount'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->discount, "text" => Text::read('form.discount'), "disabled" => true]]; $dataArr['account'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->account]]; $dataArr['accName'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->accName, "text" => Text::read('form.createdBy'), "disabled" => true]]; $priceForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.detail'); ?> </legend> <?php echo $detailForm; ?> </fieldset> <fieldset> <legend><span class="glyphicon glyphicon-camera"></span> <?php echo Text::read('form.photo'); ?> </legend> <?php echo $this->photoView->getContent(); ?> </fieldset> <fieldset> <legend><span class="glyphicon glyphicon-usd"></span> <?php echo Text::read('form.price'); ?> </legend> <?php echo $priceForm; ?> </fieldset> <?php $globalForm = ob_get_clean(); $dataArr['btnApprove'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.approve'), "class" => "success", "icon" => "glyphicon-thumbs-up"]]; $dataArr['btnReprove'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.reprove'), "class" => "danger", "icon" => "glyphicon-thumbs-down"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); ob_start(); ?> <div class="panel panel-primary"> <div class="panel-body"> <?php echo $detailForm; ?> </div> </div> <!-- MODAL //--> <div class="modal fade" id="myReproveModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="exampleModalLabel"><?php echo Text::read('product.reproval.reason'); ?> </h4> </div> <div class="modal-body"> <form> <div class="form-group"> <label for="message-text" class="control-label"><?php echo Text::read('form.message'); ?> :</label> <textarea class="form-control" id="message-text"></textarea> </div> </form> </div> <div class="modal-footer"> <button type="button" id="sendReproveMessage" class="btn btn-primary"><?php echo Text::read('form.send'); ?> </button> </div> </div> </div> </div> <?php return ob_get_clean(); }
protected function getContent() { // Inicializa assistente de formulário $form = new Form("myDetail"); // Prepara formulário de inserção/atualização de dados $dataArr['ajax'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => true]]; $dataArr['id'] = ["type" => Config::read('form.hidden'), "data" => (object) ["value" => $this->data->id]]; $dataArr['title'] = ["type" => Config::read('form.input'), "data" => (object) ["value" => $this->data->title, "text" => Text::read('form.type'), "length" => 100]]; $dataArr['parent'] = ["type" => Config::read('form.dropdown'), "data" => (object) ["value" => $this->comboType, "text" => Text::read('form.subtype'), "selected" => $this->data->parent, "disabled" => $this->data->id ? true : false]]; $detailForm = $form->createFormFields($dataArr); unset($dataArr); ob_start(); ?> <fieldset> <legend><span class="glyphicon glyphicon-th-list"></span> <?php echo Text::read('form.detail'); ?> </legend> <?php echo $detailForm; ?> </fieldset> <fieldset> <legend><span class="glyphicon glyphicon-tags"></span> <?php echo Text::read('form.feature'); ?> </legend> <div id="featureContainer" <?php echo !$this->data->id ? 'style="display:none;"' : ''; ?> > <a tabindex="0" id="btnNewFeature" class="btn btn-info">+ Nova caracteristica</a> <br /> <ul id="features" class="list-group"> <?php echo $this->createFeaturesForm(); ?> </ul> </div> <div id="messageContainer" <?php echo $this->data->id ? 'style="display:none;"' : ''; ?> > <p>Grave o registro antes de adicionar características</p> </div> </fieldset> <?php $globalForm = ob_get_clean(); $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "success", "icon" => "glyphicon-floppy-disk"]]; $detailForm = $form->createForm($dataArr, $globalForm); unset($dataArr); // Inicializa assistente de formulário $form = new Form("myNewFeature"); // Prepara formulário de inserção/atualização de dados $dataArr['feature'] = ["type" => Config::read('form.input'), "data" => (object) ["text" => Text::read('form.name'), "length" => 60]]; $dataArr['btnSave'] = ["type" => Config::read('form.submit'), "data" => (object) ["text" => Text::read('form.save'), "class" => "primary", "icon" => "glyphicon-floppy-disk"]]; $form->setHorizontal(); $featureForm = $form->createForm($dataArr); unset($dataArr); ob_start(); ?> <div class="panel panel-primary"> <div class="panel-body"> <?php echo $detailForm; ?> </div> </div> <!-- MODAL //--> <div class="modal fade" id="newFeatureModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <h4 class="modal-title" id="exampleModalLabel"><?php echo Text::read('form.feature'); ?> </h4> </div> <div class="modal-body"> <div class="row"> <?php echo $featureForm; ?> </div> </div> </div> </div> </div> <?php return ob_get_clean(); }