本文整理汇总了PHP中TButton::setLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP TButton::setLabel方法的具体用法?PHP TButton::setLabel怎么用?PHP TButton::setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TButton
的用法示例。
在下文中一共展示了TButton::setLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Show the widget at the screen
*/
public function show()
{
// include the needed libraries and styles
if ($this->fields) {
$table = new TTable();
$mdr = array();
// mandatory
$fields = array();
$i = 0;
foreach ($this->fields as $name => $obj) {
$row = $table->addRow();
$label = new TLabel($obj->text);
if ($obj->inform) {
$row->addCell($label);
$row->addCell($obj->field);
}
$fields[] = $name;
$post_fields[$name] = 1;
$obj->field->setName($this->name . '_' . $name);
if (get_class($obj->field) == 'TComboCombined') {
$fields[] = $obj->field->getTextName();
$obj->field->setTextName($this->name . '_' . $obj->field->getTextName());
$i++;
}
$i++;
}
$table->show();
}
// check whether the widget is non-editable
if (parent::getEditable()) {
// create three buttons to control the MultiField
$add = new TButton("{$this->name}btnStore");
$add->setLabel(TAdiantiCoreTranslator::translate('Register'));
//$add->setName("{$this->name}btnStore");
$add->setImage('ico_save.png');
$add->addFunction("mtf{$this->name}.addRowFromFormFields()");
$del = new TButton("{$this->name}btnDelete");
$del->setLabel(TAdiantiCoreTranslator::translate('Delete'));
$del->setImage('ico_delete.png');
$can = new TButton("{$this->name}btnCancel");
$can->setLabel(TAdiantiCoreTranslator::translate('Cancel'));
$can->setImage('ico_close.png');
$table = new TTable();
$row = $table->addRow();
$row->addCell($add);
$row->addCell($del);
$row->addCell($can);
$table->show();
}
// create the MultiField Panel
$panel = new TElement('div');
$panel->{'class'} = "multifieldDiv";
$input = new THidden($this->name);
$panel->add($input);
// create the MultiField DataGrid Header
$table = new TTable();
$table->id = "{$this->name}mfTable";
$head = new TElement('thead');
$table->add($head);
$row = new TTableRow();
$head->add($row);
// fill the MultiField DataGrid
foreach ($this->fields as $obj) {
$c = $obj->text;
if (get_class($obj->field) == 'TComboCombined') {
$row->addCell('ID');
}
$cell = $row->addCell($c);
$cell->width = $obj->size . 'px';
}
$body = new TElement('tbody');
$table->add($body);
if ($this->objects) {
foreach ($this->objects as $obj) {
if (isset($obj->id)) {
$row = new TTableRow();
$row->dbId = $obj->id;
$body->add($row);
} else {
$row = new TTableRow();
$body->add($row);
}
foreach ($fields as $name) {
$cell = $row->addCell(is_null($obj->{$name}) ? '' : $obj->{$name});
if (isset($this->fields[$name]->size)) {
$cell->style = 'width:' . $this->fields[$name]->size . 'px';
}
}
}
}
$panel->add($table);
$panel->show();
echo '<script type="text/javascript">';
echo "var mtf{$this->name};";
//echo '$(document).ready(function() {';
echo "mtf{$this->name} = new MultiField('{$this->name}mfTable',{$this->width},{$this->height});\n";
$s = implode("','", $fields);
//.........这里部分代码省略.........
示例2: TForm
//.........这里部分代码省略.........
$orcamento_valor_hora->setSize(100);
$valor_desconto->setSize(100);
$valor_total->setSize(100);
$valor_saldo->setSize(121);
$forma_pagamento->setSize(400);
$data_ultimo_pgto->setSize(100);
$data_pagamento->setSize(100);
$valor_pagamento->setSize(121);
$valor_ultimo_pgto->setSize(100);
$valor_total_pago->setSize(100);
$valor_total_parcial->setSize(121);
$data_cadastro->setSize(100);
$data_prevista->setSize(100);
$data_aprovacao->setSize(100);
$observacao->setSize(400, 80);
$nome_dtr->setSize(400);
$titulo->setSize(390);
$responsavel_id->setSize(390);
$tipo_ticket_id->setSize(200);
$sistema_id->setSize(200);
$status_ticket_id->setSize(200);
$prioridade_id->setSize(200);
$combo_tipo_origens->setSize(135);
$combo_codigo_origem->setSize(250);
$combo_solicitante_id->setSize(390);
// validações
$titulo->addValidation('Titulo', new TRequiredValidator());
$combo_solicitante_id->addValidation('Solicitante', new TRequiredValidator());
$responsavel_id->addValidation('Responsável', new TRequiredValidator());
$sistema_id->addValidation('Sistema', new TRequiredValidator());
$gerar_dr = TButton::create('gerar_dr', array('RequisitoDesenvolvimentoForm', 'onEdit'), 'Gerar DTR', 'ico_add.png');
$link_dtr = new TButton('link_dtr');
$link_dtr->setImage('bs:edit green');
$link_dtr->setLabel('ir para DTR');
$link_dtr->addFunction("__adianti_load_page('index.php?class=RequisitoDesenvolvimentoForm&method=onBuscaDTR&key={$_REQUEST['key']}');");
$this->form->addField($gerar_dr);
$this->form->addField($link_dtr);
TButton::disableField('form_Ticket', 'gerar_dr');
TButton::disableField('form_Ticket', 'link_dtr');
// add one row for each form field
// notebook Cadastramento
$table->addRowSet(new TLabel('Ticket:'), array($id, new TLabel('Data Cadastro'), $data_cadastro));
$table->addRowSet($label_combo_origem = new TLabel('Origem:'), array($combo_tipo_origens, $combo_codigo_origem));
$label_combo_origem->setFontColor('#FF0000');
$table->addRowSet($label_solicitante = new TLabel('Solicitante:'), $combo_solicitante_id);
$label_solicitante->setFontColor('#FF0000');
$table->addRowSet($label_responsavel = new TLabel('Responsável:'), $responsavel_id);
$label_responsavel->setFontColor('#FF0000');
$table->addRowSet($label_titulo = new TLabel('Título:'), $titulo);
$label_titulo->setFontColor('#FF0000');
$table->addRowSet(new TLabel('Data Inicio'), array($data_inicio, $label_status = new TLabel('Status:'), $status_ticket_id));
$label_status->setSize(70);
$table->addRowSet(new TLabel('Data Encerramento:'), array($data_encerramento, $label_data_cancelamento = new TLabel('Data Cancelamento:'), $data_cancelamento));
$label_data_cancelamento->setSize(160);
$table->addRowSet(new TLabel('Prioridade:'), $prioridade_id);
$table->addRowSet(new TLabel('Origem:'), $origem);
$table->addRowSet(new TLabel('Tipo Ticket:'), $tipo_ticket_id);
$table->addRowSet($label_sistema = new TLabel('Sistema:'), $sistema_id);
$label_sistema->setFontColor('#FF0000');
$table->addRowSet(new TLabel('Descrição Solicitação:'), $solicitacao_descricao);
$table->addRowSet(new TLabel('DR.:'), $nome_dtr);
$table->addRowSet(new TLabel(''), array($gerar_dr, $link_dtr));
$table->addRowSet(new TLabel(''), $data_inicio_oculta);
// notebook Pagamento
$tablePagamento->addRowSet(new TLabel('Data Prevista:'), $data_prevista);
$tablePagamento->addRowSet(new TLabel('Data Aprovação:'), $data_aprovacao);
示例3: __construct
public function __construct()
{
parent::__construct();
parent::include_css('app/resources/myframe.css');
$vbox = new TVBox();
$bt1a = new TButton('bt1a');
$bt1b = new TButton('bt1b');
$bt1c = new TButton('bt1c');
$bt1a->setLabel('BS disk');
$bt1b->setLabel('BS edit');
$bt1c->setLabel('BS remove');
$bt1a->setImage('bs:floppy-disk red');
$bt1b->setImage('bs:edit green');
$bt1c->setImage('bs:remove-circle blue');
$hbox1 = new THBox();
$hbox1->addRowSet($bt1a, $bt1b, $bt1c);
$frame1 = new TFrame();
$frame1->setLegend('Bootstrap Glyphicons');
$frame1->add($hbox1);
$bt2a = new TButton('bt2a');
$bt2b = new TButton('bt2b');
$bt2c = new TButton('bt2c');
$bt2a->setLabel('FA save');
$bt2b->setLabel('FA edit');
$bt2c->setLabel('FA trash');
$bt2a->setImage('fa:save red');
$bt2b->setImage('fa:edit green');
$bt2c->setImage('fa:trash-o blue');
$hbox2 = new THBox();
$hbox2->addRowSet($bt2a, $bt2b, $bt2c);
$frame2 = new TFrame();
$frame2->setLegend('Font awesome icons');
$frame2->add($hbox2);
$bt3a = new TButton('bt3a');
$bt3b = new TButton('bt3b');
$bt3c = new TButton('bt3c');
$bt3a->setLabel('Warning');
$bt3b->setLabel('Info');
$bt3c->setLabel('Success');
$bt3a->class = 'btn btn-warning btn-sm';
$bt3b->class = 'btn btn-info';
$bt3c->class = 'btn btn-success btn-lg';
$hbox3 = new THBox();
$hbox3->addRowSet($bt3a, $bt3b, $bt3c);
$frame3 = new TFrame();
$frame3->setLegend('Bootstrap styles and sizes');
$frame3->add($hbox3);
$bt4a = new TButton('bt4a');
$bt4b = new TButton('bt4b');
$bt4c = new TButton('bt4c');
$bt4a->setLabel('Popover 1');
$bt4b->setLabel('Popover 2');
$bt4c->setLabel('Popover 3');
$bt4a->popover = 'true';
$bt4a->poptitle = 'Pop title 1';
$bt4a->popcontent = 'This is the <br>popover for button 1';
$bt4b->popover = 'true';
$bt4b->poptitle = 'Pop title 2';
$bt4b->popcontent = 'This is the <br>popover for button 2';
$bt4c->popover = 'true';
$bt4c->poptitle = 'Pop title 3';
$bt4c->popcontent = 'This is the <br>popover for button 3';
$hbox4 = new THBox();
$hbox4->addRowSet($bt4a, $bt4b, $bt4c);
$frame4 = new TFrame();
$frame4->setLegend('Buttons with popover');
$frame4->add($hbox4);
$bt5a = new TButton('bt5a');
$bt5b = new TButton('bt5b');
$bt5c = new TButton('bt5c');
$bt5a->setLabel('Action 1');
$bt5b->setLabel('Action 2');
$bt5c->setLabel('Action 3');
$bt5a->addFunction("alert('action 1');");
$bt5b->addFunction("alert('going to another page');__adianti_load_page('index.php?class=FormQuickView');");
$bt5c->addFunction("if (confirm('Want to go?') == true) { __adianti_load_page('index.php?class=ContainerWindowView'); }");
$hbox5 = new THBox();
$hbox5->addRowSet($bt5a, $bt5b, $bt5c);
$frame5 = new TFrame();
$frame5->setLegend('Buttons with Javascript actions');
$frame5->add($hbox5);
$vbox->add($frame1);
$vbox->add($frame2);
$vbox->add($frame3);
$vbox->add($frame4);
$vbox->add($frame5);
parent::add($vbox);
}
示例4: TNotebook
/**
* Class constructor
* Creates the page
*/
function __construct()
{
parent::__construct();
// creates a notebook
$notebook = new TNotebook(500, 250);
// creates the notebook page
$page = new TTable();
// adds the notebook page
$notebook->appendPage('Register data', $page);
// create the form fields
$field1 = new TEntry('field1');
$field2 = new TEntry('field2');
$field3 = new TEntry('field3');
$field4 = new TCombo('field4');
$field5 = new TEntry('field5');
$field6 = new TEntry('field6');
$field7 = new TEntry('field7');
$field8 = new TEntry('field8');
$field9 = new TEntry('field9');
// creates an array with items
$units = array();
$units['PC'] = 'Piece';
$units['LT'] = 'Liter';
$units['ML'] = 'Milliliter';
$units['GL'] = 'Gallon';
$units['KG'] = 'Kilogram';
$units['GR'] = 'Gram';
// add the items to the combo
$field4->addItems($units);
// define some sizes
$field1->setEditable(FALSE);
$field1->setSize(100);
$field2->setSize(300);
$field4->setSize(100);
$field3->setSize(100);
$field5->setSize(100);
$field6->setSize(100);
$field7->setSize(100);
$field8->setSize(100);
$field9->setSize(300);
// add a row for one field
$row = $page->addRow();
$row->addCell(new TLabel('Id:'));
$cell = $row->addCell($field1);
// add a row for one field
$row = $page->addRow();
$row->addCell(new TLabel('Description:'));
$cell = $row->addCell($field2);
// creates a frame
$frame = new TFrame();
$frame->oid = 'frame-measures';
$frame->setLegend('Measures');
$button = new TButton('show_hide');
$button->class = 'btn btn-default btn-sm active';
$button->setLabel('Show/hide measures');
$button->addFunction("\$('[oid=frame-measures]').slideToggle(); \$(this).toggleClass( 'active' )");
$row = $page->addRow();
$row->addCell($button);
// add the frame inside the table
$row = $page->addRow();
$cell = $row->addCell($frame);
$cell->colspan = 2;
// adds another table inside the frame
$page2 = new TTable();
$frame->add($page2);
// add a row for tow fields
$row = $page2->addRow();
$row->addCell(new TLabel('Stock:'));
$row->addCell($field3);
$row->addCell(new TLabel('Unit:'));
$row->addCell($field4);
// add a row for tow fields
$row = $page2->addRow();
$row->addCell(new TLabel('Cost Price:'));
$row->addCell($field5);
$row->addCell(new TLabel('Sell Price:'));
$row->addCell($field6);
// add a row for tow fields
$row = $page2->addRow();
$row->addCell(new TLabel('Net Weight:'));
$row->addCell($field7);
$row->addCell(new TLabel('Gross Weight:'));
$row->addCell($field8);
// add just another field
$row = $page->addRow();
$row->addCell(new TLabel('Another field:'));
$cell = $row->addCell($field9);
// wrap the page content using vertical box
$vbox = new TVBox();
$vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__));
$vbox->add($notebook);
parent::add($vbox);
}