public function testVerificaSeOsDadosForamInseridos() { $textarea = new Textarea(); $textarea->setId("textareaMsg"); $textarea->setName("mensagem"); $textarea->setClass("form-control"); $textarea->setProtected("protected"); $textarea->setLabel("Mensagem"); $textarea->setAlert("Erro no field."); $textarea->setValue("valor"); $textarea->setRows(2); $this->assertEquals("textareaMsg", $textarea->getId()); $this->assertEquals("mensagem", $textarea->getName()); $this->assertEquals("form-control", $textarea->getClass()); $this->assertEquals("protected", $textarea->getProtected()); $this->assertEquals("Mensagem", $textarea->getLabel()); $this->assertEquals("Erro no field.", $textarea->getAlert()); $this->assertEquals("valor", $textarea->getValue()); $this->assertEquals(2, $textarea->getRows()); }
public function __construct($widgetUniqName = null, $content = null) { parent::__construct('about_me_form'); $this->widgetUniqName = $widgetUniqName; $this->setAjax(true); $this->setAction(OW::getRouter()->urlFor('BASE_CTRL_ComponentPanel', 'ajaxSaveAboutMe')); $input = new Textarea('about_me'); $input->addAttribute('style', 'width: 93%'); $input->setId('about_me_widget_input'); $input->setHasInvitation(true); $input->setInvitation(OW::getLanguage()->text('base', 'about_me_widget_inv_text')); //$input->setRequired(true); $input->setValue($content); $this->addElement($input); $hidden = new HiddenField('widget_uniq_name'); $hidden->setValue($widgetUniqName); $this->addElement($hidden); $submit = new Submit('save'); //$submit->setLabel(OW::getLanguage()->text('base', 'widget_about_me_save_btn')); $this->addElement($submit); OW::getDocument()->addOnloadScript(' window.owForms["about_me_form"].bind("success", function(data){ OW.info(data.message); }); window.owForms["about_me_form"].reset = false; '); }
$head->setTitle('PSA - query'); $head->setCss('./css/psa.css'); $head->setJs('./js/PSA.js'); $head->build(); $body = new Body(); $body->build(); include_once './inc/menubar.php'; $body->line('Insert raw sql query : '); $form = new Form(); $form->setAction('controller.php'); $form->build(); $inp_text = new Textarea(); $inp_text->setRows(15); $inp_text->setCols(70); $inp_text->setName('qs'); $inp_text->setId('to_text'); $inp_text->build(); $body->line(); $cmd->build(); $submit->build(); unset($form); $body->line('<hr />'); $psa = new PDO("sqlite:./data/base.sqlite"); $q = "SELECT * FROM queries ORDER BY datum DESC LIMIT 10"; $tps = $psa->prepare($q); $tps->execute(); $res = $tps->fetchAll(); if (!$res) { $body->line('no queries found.'); } else { $table = new Table();