49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
class Bigtext {
|
|
public string $name;
|
|
public array $params;
|
|
public $content = "";
|
|
|
|
public function __construct($params = array())
|
|
{
|
|
$this->params = $params;
|
|
}
|
|
|
|
public function set_content($content)
|
|
{
|
|
$this->content = $content;
|
|
}
|
|
|
|
public function set_name($name)
|
|
{
|
|
$this->name = $name;
|
|
}
|
|
|
|
public function render_edit()
|
|
{
|
|
$bive_textarea_dom = new DOM("div");
|
|
$bive_textarea_dom->setAttribute("class", "bive-textarea mb-1");
|
|
|
|
$bive_textarea_content_dom = new DOM("textarea", true);
|
|
$bive_textarea_content_dom->setAttribute("type", "text");
|
|
$bive_textarea_content_dom->setAttribute("class", "bive-textarea__content");
|
|
$bive_textarea_content_dom->setAttribute("id", $this->name);
|
|
$bive_textarea_content_dom->setAttribute("name", $this->name);
|
|
$bive_textarea_content_dom->append($this->content);
|
|
|
|
$bive_textarea_dom->append($bive_textarea_content_dom);
|
|
$bive_textarea_dom->view();
|
|
}
|
|
|
|
public function render_value()
|
|
{
|
|
return $this->content;
|
|
}
|
|
|
|
public function render_db_value()
|
|
{
|
|
if(!$this->content) return "";
|
|
return $this->content;
|
|
}
|
|
} |