This commit is contained in:
Dennis Eichhorn 2018-04-13 20:37:10 +02:00
parent 589396c77c
commit 37b66cc3f2
2 changed files with 22 additions and 7 deletions

View File

@ -21,7 +21,9 @@ use phpOMS\Message\ResponseAbstract;
class TextView extends View class TextView extends View
{ {
private $id = ''; private $id = '';
private $name = '';
private $form = '';
public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response) public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response)
{ {
@ -34,9 +36,22 @@ class TextView extends View
return $this->id; return $this->id;
} }
public function getName() : string
{
return $this->name;
}
public function getForm() : string
{
return $this->form;
}
public function render(...$data) : string public function render(...$data) : string
{ {
$this->id = $data[0]; $this->id = $data[0] ?? '';
$this->name = $data[1] ?? '';
$this->form = $data[2] ?? '';
return parent::render(); return parent::render();
} }
} }

View File

@ -1,15 +1,15 @@
<div class="tabular"> <div class="tabular">
<ul class="tab-links"> <ul class="tab-links">
<li><label for="c-tab-1"><?= $this->getHtml('Text', 'Editor'); ?></label> <li><label for="<?= $this->printHtml($this->getId()); ?>-c-tab-1"><?= $this->getHtml('Text', 'Editor'); ?></label>
<li><label for="c-tab-2"><?= $this->getHtml('Preview', 'Editor'); ?></label> <li><label for="<?= $this->printHtml($this->getId()); ?>-c-tab-2"><?= $this->getHtml('Preview', 'Editor'); ?></label>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-1" checked> <input type="radio" id="<?= $this->printHtml($this->getId()); ?>-c-tab-1" name="tabular-1" checked>
<div class="tab"> <div class="tab">
<textarea style="height: 300px" placeholder="&#xf040;" name="plain" form="docForm"><?= $this->printHtml(isset($doc) ? $doc->getPlain() : ''); ?></textarea><input type="hidden" id="iParsed" name="parsed"> <textarea style="height: 300px" placeholder="&#xf040;" name="<?= $this->printHtml($this->getName()); ?>" form="<?= $this->printHtml($this->getForm()); ?>"><?= $this->printHtml(isset($doc) ? $doc->getPlain() : ''); ?></textarea><input type="hidden" id="<?= $this->printHtml($this->getId()); ?>-parsed">
</div> </div>
<input type="radio" id="c-tab-2" name="tabular-1"> <input type="radio" id="<?= $this->printHtml($this->getId()); ?>-c-tab-2" name="tabular-1">
<div class="tab"> <div class="tab">
<?= $this->printHtml(isset($doc) ? $doc->getContent() : ''); ?> <?= $this->printHtml(isset($doc) ? $doc->getContent() : ''); ?>