/** * renderTextArea * * @test */ public function renderTextArea() { $htmlGenerated = tx_t3devapi_html::renderTextArea('test', 'test de contenu', array('class' => 'test')); $html = '<textarea name="test" id="test" class="test">test de contenu</textarea>'; $this->debug($htmlGenerated); $this->assertEquals(trim($htmlGenerated), $html); }
/** * Generate a field from a tca type "text" * * @param string $field * @param string|array $val * @return string */ public function getFieldFromTcaText($field, $val) { $config = $this->getFieldConfig($field); if (!empty($config['wizards']['RTE'])) { $this->loadTinyMce(); $attributes = array(); $attributes['class'] = 'tinymcerte'; $content .= tx_t3devapi_html::renderTextArea($this->pObj->getPrefix($field), $val, $attributes); return $content; // $content = '<script type="text/javascript" src="//cdn.tinymce.com/4/tinymce.min.js"></script>': // $content .= tx_t3devapi_html::renderTextArea($this->getPrefix($field), $val, $attributes); // return $content; // $this->rteCounter++; // $rte = new tx_t3devapi_fertehtmlarea(); // $rte->setTable($this->table); // $rte->setField($field); // $rte->setPA(array('itemFormElName' => $this->getPrefix($field), 'itemFormElValue' => ($val))); // $rte->setRTEcounter($this->rteCounter); // $rte->setFormName($this->formName); // $rte->setWidth('400px'); // $rte->setHeight('300px'); // $markerArray = $rte->drawRTE(); // unset($rte); // $this->onSubmit .= $markerArray['###ADDITIONALJS_SUBMIT###']; // return $markerArray['###ADDITIONALJS_PRE###'] . $markerArray['###FORM_RTE_ENTRY###'] . $markerArray['###ADDITIONALJS_POST###']; } $attributes = array(); if (!empty($config['cols'])) { $attributes['cols'] = $config['cols']; } if (!empty($config['rows'])) { $attributes['rows'] = $config['rows']; } return tx_t3devapi_html::renderTextArea($this->getPrefix($field), $val, $attributes); }