/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); $image = new TImage('app/images/frontpage.png'); // add the image to the page parent::add($image); }
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); }
/** * 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); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); $this->form = new TForm(); $list1 = new TSortList('list1'); $list2 = new TSortList('list2'); $list1->addItems(array('1' => 'One', '2' => 'Two', '3' => 'Three')); $list2->addItems(array('a' => 'A', 'b' => 'B', 'c' => 'C')); $list1->setSize(200, 100); $list2->setSize(200, 100); $list1->connectTo($list2); $list2->connectTo($list1); // creates the action button $button1 = new TButton('action1'); $button1->setAction(new TAction(array($this, 'onSave')), 'Save'); $button1->setImage('ico_save.png'); $table = new TTable(); $row = $table->addRow(); $row->addCell($list1); $row->addCell($list2); $table->addRow()->addCell($button1); $this->form->setFields(array($list1, $list2, $button1)); $this->form->add($table); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
function __construct() { parent::__construct(); // create the form using TQuickForm class $this->form = new TQuickForm(); $this->form->class = 'tform'; $this->form->setFormTitle('Formas de Pagamentos'); $combo = new TCombo('pagamento'); $combo_items = array(); $combo_items['a'] = 'Cartão de Crédito Visa'; $combo_items['b'] = 'Cartão de Crédito Mastercard'; $combo_items['c'] = 'Ticket Vale Refeição'; $combo_items['d'] = 'PagSeguro'; $combo_items['e'] = 'PayPal'; $combo_items['f'] = 'DriverCoins'; $combo->addItems($combo_items); $this->form->addQuickField('Forma de Pagamentos', $combo, 500); $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png'); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->style = 'width: 100%'; $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->form); parent::add($vbox); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the notebook $this->notebook = new TNotebook(); $this->notebook->setSize(400, 170); // creates the form $this->form = new TQuickForm('form_account'); $this->notebook->appendPage('Personal details', $this->form); // create the form fields $email = new TEntry('email'); $first_name = new TEntry('first_name'); $last_name = new TEntry('last_name'); $phone = new TEntry('phone'); $email->setEditable(FALSE); // add the fields $this->form->addQuickField('Email: ', $email, 200); $this->form->addQuickField('First name: ', $first_name, 200); $this->form->addQuickField('Last name: ', $last_name, 200); $this->form->addQuickField('Phone: ', $phone, 200); // validations $first_name->addValidation('First name', new TRequiredValidator()); $last_name->addValidation('Last name', new TRequiredValidator()); $phone->addValidation('Phone', new TRequiredValidator()); // add a form action $this->form->addQuickAction('Confirm', new TAction(array($this, 'onConfirm')), 'ico_apply.png'); $this->form->addQuickAction('Back', new TAction(array($this, 'onBackForm')), 'ico_back.png'); // add the form to the page parent::add($this->notebook); }
public function __construct() { parent::__construct(); // show the message dialog new TMessage('error', 'Error message'); parent::add(new TXMLBreadCrumb('menu.xml', __CLASS__)); }
/** * Constructor method */ public function __construct() { parent::__construct(); // load the styles TPage::include_css('app/resources/styles.css'); // define two actions $action1 = new TAction(array($this, 'onAction1')); $action2 = new TAction(array($this, 'onAction2')); // create a quick form with two action buttons $form = new TQuickForm(); $form->addQuickAction('Action 1', $action1, 'ico_view.png'); $form->addQuickAction('Action 2', $action2, 'ico_view.png'); try { // create the HTML Renderer $this->html = new THtmlRenderer('app/resources/content.html'); // define replacements for the main section $replace = array(); $replace['name'] = 'Test name'; $replace['address'] = 'Test address'; // replace the main section variables $this->html->enableSection('main', $replace); // Table wrapper (form and HTML) $table = new TTable(); $table->addRow()->addCell(new TXMLBreadCrumb('menu.xml', __CLASS__)); $table->addRow()->addCell($form); $table->addRow()->addCell($this->html); parent::add($table); } catch (Exception $e) { new TMessage('error', $e->getMessage()); } }
/** * Class constructor * Cria da página e o formulário de registro */ function __construct() { parent::__construct(); // cria o formulário $this->form = new TQuickForm('form_Funcionalidade'); $this->form->setFormTitle('Cadastro de Funcionalidades'); $this->form->class = 'tform'; // CSS class // Cria os campos do formulário $id = new TEntry('id'); $nome = new TEntry('nome'); $classe = new TEntry('classe'); $id->setEditable(false); // Adiciona os campos ao formulário $this->form->addQuickField('Código:', $id, 50); $this->form->addQuickField('Nome: ', $nome, 500); $this->form->addQuickField('Classe de controle: ', $classe, 500); // Validadores $nome->addValidation('Nome', new TRequiredValidator()); $classe->addValidation('Classe de controle', new TRequiredValidator()); // Adiciona as ações do formulário $this->form->addQuickAction('Salvar', new TAction(array($this, 'onSave')), 'ico_save.png'); $this->form->addQuickAction('Novo', new TAction(array($this, 'onEdit')), 'ico_new.png'); $this->form->addQuickAction('Voltar para a listagem', new TAction(array('FuncionalidadeList', 'onReload')), 'ico_datagrid.png'); $container = new TTable(); $container->style = 'width: 80%'; $container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'FuncionalidadeList')); $container->addRow()->addCell($this->form); // Adiciona o formulário a pagina parent::add($container); }
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); }
public function __construct() { parent::__construct(); // instancia objeto DataGrid $this->datagrid = new TDataGrid(); // instancia as colunas da DataGrid $codigo = new TDataGridColumn('codigo', 'Código', 'left', 50); $nome = new TDataGridColumn('nome', 'Nome', 'left', 180); $endereco = new TDataGridColumn('endereco', 'Endereço', 'left', 140); $telefone = new TDataGridColumn('fone', 'Fone', 'center', 100); // adiciona as colunas à DataGrid $this->datagrid->addColumn($codigo); $this->datagrid->addColumn($nome); $this->datagrid->addColumn($endereco); $this->datagrid->addColumn($telefone); // instancia duas ações da DataGrid $action1 = new TDataGridAction(array($this, 'onDelete')); $action1->setLabel('Deletar'); $action1->setImage('ico_delete.png'); $action1->setField('codigo'); $action2 = new TDataGridAction(array($this, 'onView')); $action2->setLabel('Visualizar'); $action2->setImage('ico_view.png'); $action2->setField('nome'); // adiciona as ações à DataGrid $this->datagrid->addAction($action1); $this->datagrid->addAction($action2); // cria o modelo da DataGrid, montando sua estrutura $this->datagrid->createModel(); // adiciona a DataGrid à página parent::add($this->datagrid); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); $table = new TTable(); $table->width = '100%'; // creates the form $this->form = new TForm('form_login'); $this->form->class = 'tform'; $this->form->style = 'margin:auto;width: 350px'; // add the notebook inside the form $this->form->add($table); // create the form fields $login = new TEntry('login'); $password = new TPassword('password'); // define the sizes $login->setSize(150, 40); $password->setSize(150, 40); // create an action button (save) $save_button = new TButton('save'); $save_button->setAction(new TAction(array($this, 'onLogin')), _t('Login')); $save_button->setImage('ico_apply.png'); // add a row for the field login $row = $table->addRow(); $cell = $row->addCell(new TLabel('Login')); $cell->colspan = 2; $row->class = 'tformtitle'; $table->addRowSet(new TLabel(_t('User') . ': '), $login); $table->addRowSet(new TLabel(_t('Password') . ': '), $password); $row = $table->addRowSet($save_button, ''); $row->class = 'tformaction'; $this->form->setFields(array($login, $password, $save_button)); // add the form to the page parent::add($this->form); }
public function __construct() { parent::__construct(); $this->form = new TQuickForm('sqlpanel'); $this->form->class = 'tform'; $this->form->setFormTitle('SQL Panel'); $this->form->style = 'width:100%'; $list = scandir('app/config'); $options = array(); foreach ($list as $entry) { if (substr($entry, -4) == '.ini') { $options[substr($entry, 0, -4)] = $entry; } } $database = new TCombo('database'); $select = new TText('select'); $database->addItems($options); $this->form->addQuickField(_t('Database'), $database, '50%', new TRequiredValidator()); $this->form->addQuickField('SELECT', $select, '80%', new TRequiredValidator()); $this->form->addQuickAction(_t('Generate'), new TAction(array($this, 'onGenerate')), 'fa:check-circle green'); $select->setSize('80%', 100); $this->container = new TTable(); $this->container->style = 'width: 80%'; $this->container->addRow()->addCell(new TXMLBreadCrumb('menu.xml', 'SystemProgramList')); $this->container->addRow()->addCell($this->form); parent::add($this->container); }
/** * 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); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // create the form using TQuickForm class $this->form = new TQuickForm('form_dynamic_filter'); // create the notebook $notebook = new TNotebook(530, 160); // adds the notebook page $notebook->appendPage('Dynamic filtering', $this->form); $check_gender = new TCheckGroup('check_gender'); $check_gender->addItems(array('M' => 'Male', 'F' => 'Female')); $check_gender->setLayout('horizontal'); $combo_status = new TCombo('combo_status'); $combo_status->addItems(array('S' => 'Single', 'C' => 'Committed', 'M' => 'Married')); $combo_customers = new TCombo('customers'); // add the fields inside the form $this->form->addQuickField('Load customers: ', $check_gender, 200); $this->form->addQuickField('', $combo_status, 200); $this->form->addQuickField('', $combo_customers, 200); $check_gender->setChangeAction(new TAction(array($this, 'onGenderChange'))); $combo_status->setChangeAction(new TAction(array($this, 'onGenderChange'))); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($notebook); parent::add($vbox); }
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); }
public function __construct() { parent::__construct(); // creates one datagrid $this->datagrid = new TQuickGrid(); $this->datagrid->setHeight(320); // add the columns $this->datagrid->addQuickColumn('Code', 'code', 'right', 200); $this->datagrid->addQuickColumn('Name', 'name', 'left', 400); // add the actions $this->datagrid->addQuickAction('Delete', new TDataGridAction(array($this, 'onDelete')), 'code', 'ico_delete.png'); // creates the datagrid model $this->datagrid->createModel(); $this->form = new TQuickForm('over_form'); $this->form->class = 'tform'; $this->form->setFormTitle('Add items'); $this->form->addQuickAction('Add', new TAction(array('NewWindowForm', 'onLoad')), 'ico_add.png'); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($this->datagrid); $vbox->add(' '); $vbox->add($this->form); parent::add($vbox); }
/** * 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); }
public function __construct() { parent::__construct(); $this->form = new TQuickForm(); $this->form->class = 'tform'; $this->form->setFormTitle(_t('Profile')); $name = new TEntry('name'); $login = new TEntry('login'); $email = new TEntry('email'); $password1 = new TPassword('password1'); $password2 = new TPassword('password2'); $login->setEditable(FALSE); $this->form->addQuickField(_t('Name'), $name, '80%', new TRequiredValidator()); $this->form->addQuickField(_t('Login'), $login, '80%', new TRequiredValidator()); $this->form->addQuickField(_t('Email'), $email, '80%', new TRequiredValidator()); $table = $this->form->getContainer(); $row = $table->addRow(); $row->style = 'background: #FFFBCB;'; $cell = $row->addCell(new TLabel(_t('Change password') . ' (' . _t('Leave empty to keep old password') . ')')); $cell->colspan = 2; $this->form->addQuickField(_t('Password'), $password1, '80%'); $this->form->addQuickField(_t('Password confirmation'), $password2, '80%'); $this->form->addQuickAction(_t('Save'), new TAction(array($this, 'onSave')), 'fa:save'); $bc = new TBreadCrumb(); $bc->addHome(); $bc->addItem('Profile'); $container = TVBox::pack($bc, $this->form); $container->style = 'width:80%'; parent::add($container); }
/** * 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); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the notebook $this->notebook = new TNotebook(); $this->notebook->setSize(400, 140); // creates the form $this->form = new TQuickForm('form_account'); $this->notebook->appendPage('Create account', $this->form); // create the form fields $email = new TEntry('email'); $password = new TPassword('password'); $confirm = new TPassword('confirm'); $this->form->addQuickField('Email: ', $email, 200); $this->form->addQuickField('Password: '******'Confirm password: '******'Email', new TRequiredValidator()); $email->addValidation('Email', new TEmailValidator()); $password->addValidation('Password', new TRequiredValidator()); $confirm->addValidation('Confirm password', new TRequiredValidator()); // add a form action $this->form->addQuickAction('Next', new TAction(array($this, 'onNextForm')), 'ico_apply.png'); // add the form to the page parent::add($this->notebook); }
/** * 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); }
/** * Class constructor * Creates the page and the registration form */ function __construct() { parent::__construct(); // creates the form $this->form = new TForm(); try { // UIBuilder object $ui = new TUIBuilder(500, 300); $ui->setController($this); $ui->setForm($this->form); // reads the xml form $ui->parseFile('app/forms/sample.form.xml'); // add the TUIBuilder panel inside the form $this->form->add($ui); // set the form fields from the interface $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); }
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); }
/** * 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); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // creates the scroll panel $scroll = new TScroll(); $scroll->setSize(400, 300); // creates a table for the fields $fields_table = new TTable(); // adds the table inside the scroll $scroll->add($fields_table); // create the form fields $fields = array(); for ($n = 1; $n <= 20; $n++) { $object = new TEntry('field' . $n); $fields[$n] = $object; // adds a row for each form field $row = $fields_table->addRow(); $row->addCell(new TLabel('Field:' . $n)); $row->addCell($object); } // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($scroll); parent::add($vbox); }
/** * Class constructor * Creates the page */ function __construct() { parent::__construct(); // loads the galleria javascript library TPage::include_js('app/lib/jquery/galleria/galleria-1.2.2.min.js'); // creates a table $table = new TTable(); // creates the DIV element with the images $galleria = new TElement('div'); $galleria->id = 'images'; $galleria->style = "width:600px;height:460px"; for ($n = 1; $n <= 4; $n++) { $img = new TElement('img'); $img->src = "app/images/nature/nature{$n}.jpg"; $galleria->add($img); } // add the DIV to the table $table->addRow()->addCell($galleria); // creates the script element $script = new TElement('script'); $script->type = 'text/javascript'; $script->add(' Galleria.loadTheme("app/lib/jquery/galleria/themes/classic/galleria.classic.min.js"); $("#images").galleria(); '); // add the script to the table $table->addRow()->addCell($script); // wrap the page content using vertical box $vbox = new TVBox(); $vbox->add(new TXMLBreadCrumb('menu.xml', __CLASS__)); $vbox->add($table); parent::add($vbox); }
public function __construct() { parent::__construct(); // instancia objeto DataGrid $this->datagrid = new TDataGrid(); // instancia as colunas da DataGrid $codigo = new TDataGridColumn('id', 'Código', 'left', 50); $nome = new TDataGridColumn('nome', 'Nome', 'left', 180); $endereco = new TDataGridColumn('endereco', 'Endereço', 'left', 140); $qualifica = new TDataGridColumn('qualifica', 'Qualificações', 'left', 200); // adiciona as colunas à DataGrid $this->datagrid->addColumn($codigo); $this->datagrid->addColumn($nome); $this->datagrid->addColumn($endereco); $this->datagrid->addColumn($qualifica); // cria o modelo da DataGrid, montando sua estrutura $this->datagrid->createModel(); $this->navbar = new TPageNavigation(); $this->navbar->setAction(new TAction(array($this, 'onReload'))); $table = new TTable(); $row = $table->addRow(); $row->addCell($this->datagrid); $row = $table->addRow(); $row->addCell($this->navbar); // adiciona a DataGrid à página parent::add($table); }
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); }
public function __construct() { parent::__construct(); // instancia objeto DataGrid $this->datagrid = new TDataGrid(); // instancia as colunas da DataGrid $codigo = new TDataGridColumn('id', 'Código', 'right', 50); $nome = new TDataGridColumn('nome', 'Nome', 'left', 180); $endereco = new TDataGridColumn('endereco', 'Endereço', 'left', 140); $qualifica = new TDataGridColumn('qualifica', 'Qualificações', 'left', 200); $action1 = new TAction(array($this, 'onReload')); $action1->setParameter('order', 'id'); $action2 = new TAction(array($this, 'onReload')); $action2->setParameter('order', 'nome'); $codigo->setAction($action1); $nome->setAction($action2); // adiciona as colunas à DataGrid $this->datagrid->addColumn($codigo); $this->datagrid->addColumn($nome); $this->datagrid->addColumn($endereco); $this->datagrid->addColumn($qualifica); // cria o modelo da DataGrid, montando sua estrutura $this->datagrid->createModel(); // adiciona a DataGrid à página parent::add($this->datagrid); }