Example #1
0
 /**
  * @covers Xoops\Form\Button::render
  */
 public function testRender()
 {
     $value = $this->object->render();
     $this->assertTrue(false !== strpos($value, '<input'));
     $this->assertTrue(false !== strpos($value, 'type="button"'));
     $this->assertTrue(false !== strpos($value, 'name="button_name"'));
     $this->assertTrue(false !== strpos($value, 'id="button_name"'));
     $this->assertTrue(false !== strpos($value, 'title="button_caption"'));
     $this->assertTrue(false !== strpos($value, 'value="button_value"'));
 }
Example #2
0
 /**
  * Render button
  *
  * @return void
  */
 function render()
 {
     if (!isset($this->options['icons']['secondary'])) {
         $this->options['icons']['secondary'] = $this->js_triangle_class;
     }
     parent::render();
 }
Example #3
0
 /**
  * @covers Xoops\Form\Button::__construct
  * @covers Xoops\Form\Button::render
  * @covers Xoops\Form\Element::themeDecorateElement
  */
 public function test__construct()
 {
     $oldWay = new Button('mycaption', 'myname', 'myvalue', 'button');
     $newWay = new Button(['caption' => 'mycaption', 'type' => 'button', 'name' => 'myname', 'value' => 'myvalue']);
     $this->assertEquals($oldWay->render(), $newWay->render());
     $this->assertNotFalse($oldWay->hasClassLike('btn'));
 }
 public function testMultiplos($value = '')
 {
     $button = new Button(['value' => "Valor"]);
     $button->addBtn(new Button(['value' => "Novo"]));
     $this->assertEquals($button->renderButton(), '<input value="Valor" type="button" />');
     $this->assertEquals($button->render(), '<div class=\'form-group\'><input value="Valor" type="button" /><input value="Novo" type="button" /></div>');
 }
 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'\\&\\#x0300\\;','')");
     } else {
         $this->addClass('wrap_selection');
         $this->setOpenTag('&#x0300;');
     }
     return parent::render();
 }
 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isXhtml11()) {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<del>','</del>')");
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<s>','</s>')");
         }
     } else {
         $this->addClass('wrap_selection');
         $this->addClass('lang-html');
         $this->setOpenTag('p style=\'text-decoration: line-through;\'');
         $this->setCloseTag('p');
     }
     return parent::render();
 }
 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isXhtml11()) {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<div class=\\'s9y_typeset s9y_typeset_center\\' style=\\'text-align: center; margin: 0px auto 0px auto\\'>','</div>')");
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'<center>','</center>')");
         }
     } else {
         $this->addClass('wrap_selection');
         $this->addClass('lang-html');
         $this->setOpenTag('p style=\'text-align: center;\'');
         $this->setCloseTag('p');
     }
     return parent::render();
 }
 /**
  * @return string
  */
 public function render()
 {
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isUseRealApos() === false) {
             if ($this->isUseNamedEnts()) {
                 $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'&rsquo;','')");
             } else {
                 $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'&#8217;','')");
             }
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "'],'\\&\\#39\\;','')");
         }
     } else {
         $this->addClass('wrap_selection');
         $this->setOpenTag('&apos;');
     }
     return parent::render();
 }
 /**
  * @return string
  */
 public function render()
 {
     $this->overwriteValue();
     if ($this->isLegacyMode()) {
         $this->addClass('serendipityPrettyButton');
         $this->addClass('input_button');
         if ($this->isUseNamedEnts()) {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "']," . $this->getSurroundingNamedEntitiesStringByType() . ")");
         } else {
             $this->setOnClickEvent("wrapSelection(document.forms['serendipityEntry']['" . $this->getTextarea() . "']," . $this->getSurroundingStringByType() . ")");
         }
     } else {
         $this->addClass('wrap_selection');
         $namedEntities = $this->getCleanSurroundingStringByType();
         $tags = explode(',', $namedEntities);
         $this->setOpenTag(trim($tags[0], '\''));
         $this->setCloseTag(trim($tags[1], '\''));
     }
     return parent::render();
 }
Example #10
0
 public function render()
 {
     $this->setAttribute("type", "submit");
     return parent::render();
 }
Example #11
0
 public function render()
 {
     $this->set('type', 'submit');
     return parent::render();
 }