本文整理汇总了PHP中TVBox类的典型用法代码示例。如果您正苦于以下问题:PHP TVBox类的具体用法?PHP TVBox怎么用?PHP TVBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TVBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
parent::setDatabase('samples');
// defines the database
parent::setActiveRecord('City');
// defines the active record
// creates the form
$this->form = new TQuickForm('form_City');
$this->form->class = 'tform';
// CSS class
$this->form->style = 'width: 500px';
// define the form title
$this->form->setFormTitle('Standard Form');
// create the form fields
$id = new TEntry('id');
$name = new TEntry('name');
$id->setEditable(FALSE);
// add the form fields
$this->form->addQuickField('ID', $id, 100);
$this->form->addQuickField('Name', $name, 100);
// define the form action
$this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'ico_save.png');
$this->form->addQuickAction('New', new TAction(array($this, 'onEdit')), 'ico_new.png');
$this->form->addQuickAction('Listing', new TAction(array('StandardDataGridView', 'onReload')), 'ico_datagrid.gif');
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->form = new TForm();
// creates one datagrid
$this->datagrid = new TQuickGrid();
$this->datagrid->disableDefaultClick();
// important!
$this->form->add($this->datagrid);
// add the columns
$this->datagrid->addQuickColumn('Check', 'check', 'right', 40);
$this->datagrid->addQuickColumn('Code', 'code', 'right', 70);
$this->datagrid->addQuickColumn('Name', 'name', 'left', 180);
$this->datagrid->addQuickColumn('Address', 'address', 'left', 180);
$this->datagrid->addQuickColumn('Phone', 'fone', 'left', 120);
// creates the datagrid model
$this->datagrid->createModel();
// creates the action button
$button1 = new TButton('action1');
// define the button action
$button1->setAction(new TAction(array($this, 'onSave')), 'Save');
$button1->setImage('ico_save.png');
$this->form->addField($button1);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
$vbox->add($button1);
parent::add($vbox);
}
示例3: __construct
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_Customer');
try {
// UIBuilder object
$ui = new TUIBuilder(500, 340);
$ui->setController($this);
$ui->setForm($this->form);
// reads the xml form
$ui->parseFile('app/forms/customerlist.form.xml');
$this->datagrid = $ui->getWidget('datagrid1');
$this->pageNavigation = $this->datagrid->getPageNavigation();
$this->form->add($ui);
$this->form->setFields($ui->getFields());
} catch (Exception $e) {
new TMessage('error', $e->getMessage());
}
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->form = new TForm();
// creates one datagrid
$this->datagrid = new TQuickGrid();
$this->datagrid->disableDefaultClick();
$this->form->add($this->datagrid);
// creates the action button
$button1 = new TButton('action1');
// define the button action
$action_button1 = new TAction(array($this, 'onUpdate'));
$action_button1->setParameter('id', filter_input(INPUT_GET, 'id'));
$button1->setAction($action_button1, 'Atualizar');
$button1->setImage('fa:check-circle-o green');
$this->form->addField($button1);
// add the columns
$this->datagrid->addQuickColumn('Tipo de Atividade', 'nome', 'left', 180);
$this->datagrid->addQuickColumn('Ticket', 'ticket', 'left', 180);
$this->datagrid->addQuickColumn('Sistema', 'sistema', 'left', 180);
// creates the datagrid model
$this->datagrid->createModel();
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add($button1);
$vbox->add($this->form);
parent::add($vbox);
}
示例5: __construct
/**
* Class constructor
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_pdf_shapes');
// creates a table
$table = new TTable();
// add the table inside the form
$this->form->add($table);
// create the form fields
$name = new TEntry('name');
$name->addValidation('Name', new TRequiredValidator());
$label = new TLabel('Name' . ': ');
$label->setFontColor('red');
$table->addRowSet($label, $name);
$save_button = new TButton('generate');
$save_button->setAction(new TAction(array($this, 'onGenerate')), 'Generate');
$save_button->setImage('ico_save.png');
// add a row for the form action
$table->addRowSet($save_button);
// define wich are the form fields
$this->form->setFields(array($name, $save_button));
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例6: __construct
public function __construct()
{
parent::__construct();
// creates one datagrid
$this->datagrid = new TDataGrid();
// create the datagrid columns
$code = new TDataGridColumn('code', 'Code', 'right', 70);
$name = new TDataGridColumn('name', 'Name', 'left', 180);
$address = new TDataGridColumn('address', 'Address', 'left', 180);
$telephone = new TDataGridColumn('fone', 'Phone', 'left', 160);
// add the columns to the datagrid
$this->datagrid->addColumn($code);
$this->datagrid->addColumn($name);
$this->datagrid->addColumn($address);
$this->datagrid->addColumn($telephone);
// creates two datagrid actions
$action1 = new TDataGridAction(array($this, 'onView'));
$action1->setLabel('View');
$action1->setImage('ico_find.png');
$action1->setField('name');
$action1->setDisplayCondition(array($this, 'displayColumn'));
// add the actions to the datagrid
$this->datagrid->addAction($action1);
// creates the datagrid model
$this->datagrid->createModel();
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->datagrid);
parent::add($vbox);
}
示例7: __construct
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form
$this->form = new TForm();
// create the form fields
$html = new THtmlEditor('html_text');
$html->setSize(500, 200);
// creates the action button
$button1 = new TButton('action1');
$button1->setAction(new TAction(array($this, 'onShow')), 'Show');
$button1->setImage('ico_apply.png');
// creates the table wrapper and put it inside the form
$table = new TTable();
$this->form->add($table);
// pack elements
$table->addRow()->addCell(new TLabel('HTML:'));
$table->addRow()->addCell($html);
$table->addRow()->addCell($button1);
// define wich are the form fields
$this->form->setFields(array($html, $button1));
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例8: __construct
/**
* Class constructor
* Creates the page and the registration form
*/
function __construct()
{
parent::__construct();
// creates the form
$this->form = new TForm('form_Teste');
try {
// TUIBuilder object
$ui = new TUIBuilder(500, 400);
$ui->setController($this);
$ui->setForm($this->form);
// reads the xml form
$ui->parseFile('app/forms/datagrid.form.xml');
// get the datagrid
$this->datagrid = $ui->getWidget('datagrid');
// put the TUIBuilder panel inside the TForm object
$this->form->add($ui);
// set form fields from interface fields
$this->form->setFields($ui->getFields());
} catch (Exception $e) {
new TMessage('error', $e->getMessage());
}
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->form);
parent::add($vbox);
}
示例9: __construct
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new BootstrapFormWrapper(new TQuickForm());
$this->form->setFormTitle('cadastroTarefas');
// create the form fields
$id = new TEntry('id');
$id->setEditable(FALSE);
$description = new TEntry('titulo');
$list = new TCombo('prioridade');
$text = new TText('descricao');
$combo_items = array();
$combo_items['1'] = 'Baixa';
$combo_items['2'] = 'Media';
$combo_items['3'] = 'Alta';
$list->addItems($combo_items);
// add the fields inside the form
$this->form->addQuickField('Id', $id, 40);
$this->form->addQuickField('Título', $description, 250);
$this->form->addQuickField('Descrição', $text, 120);
$this->form->addQuickField('Prioridade', $list, 120);
$text->setSize(250, 50);
// define the form action
$btn = $this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:save');
$btn->class = 'btn btn-success';
$panel = new TPanelGroup('Cadastro de taredas');
$panel->add($this->form);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add($panel);
parent::add($vbox);
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->datagrid = new TQuickGrid();
$this->datagrid->setHeight(320);
// define the CSS class
$this->datagrid->class = 'customized-table';
// import the CSS file
parent::include_css('app/resources/custom-table.css');
// add the columns
$this->datagrid->addQuickColumn('ID', 'id', 'left', 50);
$this->datagrid->addQuickColumn('Description', 'description', 'left', 250);
$this->datagrid->addQuickColumn('Amount', 'amount', 'right', 140);
$this->datagrid->addQuickColumn('Price', 'sale_price', 'right', 140);
// add the actions
$this->datagrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'id', 'ico_delete.png');
// creates the datagrid model
$this->datagrid->createModel();
$form_back = new TQuickForm();
$form_back->addQuickAction('Back', new TAction(array($this, 'onGoToCatalog')), 'ico_back.png');
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', 'ProductCatalogView'));
$vbox->add($this->datagrid);
$vbox->add($form_back);
parent::add($vbox);
}
示例11: __construct
public function __construct()
{
parent::__construct();
// creates one datagrid
$this->datagrid = new TDataGrid();
// create the datagrid columns
$code = new TDataGridColumn('code', 'Code', 'left', 50);
$name = new TDataGridColumn('name', 'Name', 'left', 180);
$address = new TDataGridColumn('address', 'Address', 'left', 140);
$telephone = new TDataGridColumn('fone', 'Phone', 'center', 100);
// add the columns to the datagrid
$this->datagrid->addColumn($code);
$this->datagrid->addColumn($name);
$this->datagrid->addColumn($address);
$this->datagrid->addColumn($telephone);
$action1 = new TAction(array($this, 'onColumnAction'));
$action1->setParameter('column', 'code');
$code->setAction($action1);
$action2 = new TAction(array($this, 'onColumnAction'));
$action2->setParameter('column', 'name');
$name->setAction($action2);
// creates the datagrid model
$this->datagrid->createModel();
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->datagrid);
parent::add($vbox);
}
示例12: __construct
public function __construct()
{
parent::__construct();
// creates one datagrid
$this->datagrid = new TDataGrid();
// make scrollable and define height
$this->datagrid->setHeight(300);
$this->datagrid->makeScrollable();
// create the datagrid columns
$code = new TDataGridColumn('code', 'Code', 'right', 70);
$name = new TDataGridColumn('name', 'Name', 'left', 180);
$address = new TDataGridColumn('address', 'Address', 'left', 180);
$telephone = new TDataGridColumn('fone', 'Phone', 'left', 160);
// add the columns to the datagrid
$this->datagrid->addColumn($code);
$this->datagrid->addColumn($name);
$this->datagrid->addColumn($address);
$this->datagrid->addColumn($telephone);
// creates the datagrid model
$this->datagrid->createModel();
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($this->datagrid);
parent::add($vbox);
}
示例13: __construct
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// create the form using TQuickForm class
$this->form = new TQuickForm('form_seek_sample');
$this->form->setFormTitle('Seek button');
$this->form->class = 'tform';
// create the form fields
$city_id1 = new TSeekButton('city_id1');
$city_name1 = new TEntry('city_name1');
$criteria = new TCriteria();
$criteria->add(new TFilter('id', '>', 1));
$criteria->add(new TFilter('id', '<', 5));
$criteria->setProperty('order', 'name');
// define the action for city_id1
$obj = new TestCitySeek();
$action = new TAction(array($obj, 'onReload'));
$city_id1->setAction($action);
$city_id1->setSize(100);
$city_name1->setEditable(FALSE);
$this->form->addQuickFields('Manual SeekButton', array($city_id1, $city_name1));
$this->form->addQuickAction('Save', new TAction(array($this, 'onSave')), 'fa:floppy-o');
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add($this->form);
parent::add($vbox);
}
示例14: __construct
/**
* Form constructor
* @param $param Request
*/
public function __construct($param)
{
parent::__construct();
// creates the form
$this->form = new TQuickForm('form_Sistema');
$this->form->class = 'tform';
// change CSS class
$this->form->style = 'display: table;width:100%';
// change style
// define the form title
$this->form->setFormTitle('Sistema');
// create the form fields
$id = new TSeekButton('id');
$nome = new TText('nome');
// add the fields
$this->form->addQuickField('Id', $id, 100);
$this->form->addQuickField('Nome', $nome, 200);
if (!empty($id)) {
$id->setEditable(FALSE);
}
/** samples
$this->form->addQuickFields('Date', array($date1, new TLabel('to'), $date2)); // side by side fields
$fieldX->addValidation( 'Field X', new TRequiredValidator ); // add validation
$fieldX->setSize( 100, 40 ); // set size
**/
// create the form actions
$this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:floppy-o');
$this->form->addQuickAction(_t('New'), new TAction(array($this, 'onClear')), 'bs:plus-sign green');
// vertical box container
$container = new TVBox();
$container->style = 'width: 90%';
// $container->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$container->add($this->form);
parent::add($container);
}
示例15: __construct
function __construct()
{
parent::__construct();
Clientes::checkCliente();
$this->pagseguro = new PPagSeguro('progs');
$this->setSize(550, 400);
$this->setTitle('Lista de Produtos');
$this->grid = new TQuickGrid();
$this->grid->addQuickColumn('id', 'id', 'right', 100);
$this->grid->addQuickColumn('nome', 'nome', 'right', 200);
$this->grid->addQuickColumn('qtd', 'qtd', 'right', 100);
$this->grid->addQuickColumn('preco', 'preco', 'right', 100);
$action = new TDataGridAction(array('Carrinho', 'updateItem'));
$this->grid->addQuickAction('UpdateItem', $action, 'id', 'ico_edit.png');
$form = new TQuickForm('frm_finalizar');
$action2 = new TAction(array($this, 'finalizar'));
$form->addQuickAction('finalizar', $action2);
$this->grid->createModel();
$produtos = PCart::getItens();
if ($produtos) {
foreach ($produtos as $p) {
$item = new stdClass();
$item->id = $p->getId();
$item->nome = $p->getNome();
$item->qtd = $p->getQtd();
$item->preco = $p->getPreco();
$this->grid->addItem($item);
}
$box = new TVBox();
$box->add($this->grid);
$box->add($form);
parent::add($box);
}
}